mlopsmodelserving
Use when: designing or reviewing model serving workflows, registry usage, versioning, A/B tests, canary deployments, or drift monitoring.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when: designing or reviewing model serving workflows, registry usage, versioning, A/B tests, canary deployments, or drift monitoring.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when: reviewing .prompt.md, .agent.md, SKILL.md, or .instructions.md files for contradictions, ambiguity, persona consistency, cognitive load, coverage gaps, and composition conflicts.
Use when: checking xanadAssistant workspace health, install status, repair reasons, or lockfile validity before proposing install, update, repair, or restore operations.
Use when: designing or reviewing CI/CD pipelines, GitHub Actions, stage design, environment gates, or artifact discipline.
Use when: writing or reviewing Dockerfiles, container images, multi-stage builds, layer caching, or image security.
Use when: writing or reviewing Infrastructure as Code for naming, state management, modularity, and drift detection.
Use when: reviewing DevOps changes for pipeline safety, secret hygiene, permissions, rollback, and deployment risk.
| name | mlopsModelServing |
| description | Use when: designing or reviewing model serving workflows, registry usage, versioning, A/B tests, canary deployments, or drift monitoring. |
| type | reference |
| version | 1.0 |
| license | MIT |
Skill metadata: version "1.0"; tags [mlops, model-serving, deployment, drift]; recommended tools [].
Use this skill when deploying, versioning, or monitoring ML models in production.
mlopsExperimentsmlopsDataPipelinesimport mlflow
# Register a model
result = mlflow.register_model(
model_uri=f"runs:/{run_id}/model",
name="my-classifier",
)
# Transition to Staging
client = mlflow.MlflowClient()
client.transition_model_version_stage(
name="my-classifier",
version=result.version,
stage="Staging",
)
| Field | Required | Example |
|---|---|---|
| Model name | Yes | fraud-detector |
| Version | Yes | Semantic (v1.2.0) or auto-incremented |
| Stage | Yes | None → Staging → Production → Archived |
| Dataset version | Yes | DVC tag or S3 URI |
| Training run ID | Yes | Links to experiment metadata |
| Champion metric | Yes | e.g., val_auc=0.94 |
# Example: route 10% of traffic to new model
- model: fraud-detector-v2
traffic: 10
- model: fraud-detector-v1
traffic: 90
| Drift type | What to monitor | Alert threshold |
|---|---|---|
| Data drift | Input feature distributions vs. training baseline | PSI > 0.2 or KS p-value < 0.05 |
| Prediction drift | Output distribution vs. baseline | Distribution shift by > 5% |
| Concept drift | Model accuracy vs. ground-truth labels | Primary metric drops > 3% |
| Serving drift | Latency percentiles (p50, p95, p99) | p99 > 2× baseline |
# MLflow: transition previous version back to Production
mlflow models set-version-tag -n my-classifier -v <prev-version> --key stage --value Production
# Or via client:
client.transition_model_version_stage(name="my-classifier", version=<prev-version>, stage="Production")
| Anti-pattern | Fix |
|---|---|
| Deploying directly to Production | Always go through Staging |
| No model registry | Use MLflow, Vertex AI, or SageMaker Model Registry |
| Model artefact committed to git | Store in object storage; log URI in registry |
| Serving the same model version for months without drift check | Schedule weekly drift evaluation |