integrate-apeiron
Advises on and implements the integration of Apeiron drift-detection into existing ML training frameworks.
Install
mkdir -p .claude/skills/integrate-apeiron && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13595" && unzip -o skill.zip -d .claude/skills/integrate-apeiron && rm skill.zipInstalls to .claude/skills/integrate-apeiron
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Add apeiron drift-detection or continual-learning behavior to an existing training framework. Use when the user already has a training loop, such as vanilla PyTorch, Lightning, Hugging Face Trainer, or Accelerate, and wants to integrate apeiron rather than adopt apeiron's runner. Inspects the target repo, recommends the lightest viable integration path, writes adapter glue, and smoke-tests it. If `import apeiron` fails, use install-apeiron first.Key capabilities
- →Inspect a target repository for framework indicators
- →Recommend the lightest viable integration path for apeiron
- →Write adapter glue code for apeiron drift detection
- →Write adapter glue code for apeiron continual learning
- →Smoke-test the integrated apeiron functionality
- →Report on the integration process and assumptions
How it works
The skill identifies the existing training framework and then generates adapter code to integrate Apeiron's drift detection or continual learning features, followed by a smoke test.
Inputs & outputs
When to use integrate-apeiron
- →Add drift detection to training loop
- →Integrate continuous learning models
- →Adapt existing models for apeiron
About this skill
Integrate Apeiron
Integrate apeiron into an existing training framework with the least coupling that meets the user's goal.
Input
- Target project directory: use the path the user gives, otherwise the current working directory.
Background
Verify APIs against source before writing glue:
cat src/main.py
cat src/apeiron/drift_detection/detectors/base.py
cat src/apeiron/drift_detection/load_drift_detector.py
grep -nA12 "class ContinuousMonitor" src/apeiron/driver/continuous_monitor.py
Current conceptual paths:
- Drift detectors are standalone:
detector.update(metric_value: float) -> DriftSignal. DriftSignalcarries fields such asdrift_detected,regime, anddrift_score; confirm exact fields in source.ContinuousMonitordrives the full apeiron loop and requires aBaseModelHarness, config, and detector.- CL updaters such as EWC, JVP, and KFAC are harness-coupled, so using them implies the harness and monitor path.
Procedure
1. Confirm Apeiron Is Importable
From the target project environment, run:
python -c "import apeiron; print('apeiron', apeiron.__file__)"
If this fails, stop and use or recommend install-apeiron before continuing.
2. Discover The Framework
In the target project, locate:
- framework indicators such as
pytorch_lightning,lightning,transformers,Trainer, oraccelerate - manual PyTorch loops with
loss.backward()andoptimizer.step() - the scalar quality metric available per step or epoch, such as validation accuracy or loss
- the model object and data iterator when the full monitor path may be needed
Summarize what you found before proposing changes.
3. Choose The Integration Path
Recommend the lightest path that satisfies the user's goal:
- Detectors-only adapter: best when the user wants drift detection or wants to trigger their own retraining.
- Harness plus
ContinuousMonitor: required when the user wants apeiron CL regularizers or the full monitor-to-adapt loop.
Confirm the chosen path with the user before editing their training loop.
4. Detectors-Only Adapter
For the light path, add a small module such as <their_pkg>/apeiron_drift.py that:
- constructs one detector, such as ADWIN, KSWIN, or PageHinkley
- exposes a hook called from the existing eval step
- calls
signal = detector.update(metric) - calls a user-provided callback when
signal.drift_detected - leaves the drift response, such as log, retrain, or reload, to the user's callback
Wire the hook into the loop with a minimal, clearly marked edit.
5. Harness And Monitor Adapter
For the full path:
- Write a
BaseModelHarnesssubclass wrapping the existing model and data loaders. - Read
src/apeiron/model/torch_model_harness.pyandexamples/mnist/model.pyfor the current abstract methods. - Preserve current method names exactly, including
get_optmizerif that is what the ABC declares. - Build a config with
build_configfrom a small TOML or construct the current config object directly. - Construct and run
ContinuousMonitorusingsrc/main.pyas the wiring reference.
6. Smoke-Test
Prove the wiring before handing back:
- Detectors-only: run a short script feeding synthetic metric values through the hook and assert that a
DriftSignalis returned. Use an obvious shift when trying to exercise the callback. - Full path: run only a tiny CPU-bound loop or monitor pass with minimal iterations, no network logging, and small stream settings.
Read failures, fix the glue, and re-run until the smoke test passes.
7. Report
Report:
- detected framework
- chosen integration path
- files added or edited
- exact insertion point in the loop
- how to run the smoke test
- what happens when drift is detected
- assumptions the user should revisit, especially the detection metric and detector sensitivity
Notes
- Keep edits to the user's loop minimal and easy to revert.
- Do not hardcode detector, monitor, or harness signatures; read them from source first.
When not to use it
- →When apeiron is not importable in the target project environment
- →When the user wants to adopt apeiron's runner instead of integrating into an existing loop
Limitations
- →Requires an existing training framework such as PyTorch, Lightning, Hugging Face Trainer, or Accelerate
- →Integration paths are limited to detectors-only or harness plus ContinuousMonitor
How it compares
This skill automates the process of integrating Apeiron into an existing training loop by generating adapter code, unlike manual integration which requires writing custom code.
Compared to similar skills
integrate-apeiron side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| integrate-apeiron (this skill) | 0 | 2mo | Review | Intermediate |
| langfuse | 7 | 6mo | No flags | Intermediate |
| langsmith-observability | 4 | 7mo | Review | Intermediate |
| mlflow | 3 | 7mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
langfuse
davila7
Expert in Langfuse - the open-source LLM observability platform. Covers tracing, prompt management, evaluation, datasets, and integration with LangChain, LlamaIndex, and OpenAI. Essential for debugging, monitoring, and improving LLM applications in production. Use when: langfuse, llm observability, llm tracing, prompt management, llm evaluation.
langsmith-observability
davila7
LLM observability platform for tracing, evaluation, and monitoring. Use when debugging LLM applications, evaluating model outputs against datasets, monitoring production systems, or building systematic testing pipelines for AI applications.
mlflow
davila7
Track ML experiments, manage model registry with versioning, deploy models to production, and reproduce experiments with MLflow - framework-agnostic ML lifecycle platform
mlops-observability
fmind
Guide to implement full stack observability including reproducibility, lineage, monitoring, alerting, and explainability.
trulens-instrumentation
truera
Instrument LLM apps with TruLens OTEL-based tracing - from setup to debugging and optimization
retraining-worker
GaneshMadarasu
Reference for the retraining-worker service (port 8005): Celery app setup, subprocess worker pattern, retrain_model task, shadow accuracy testing, model version promotion to Redis, and known gotchas including the scored_events gap. Load when working on anomaly-detection/services/retraining-worker/ma