/mlops-skills:mlflow-experiment-tracking-and-model-registryfrom mlops-skills
Sets up and operates MLflow: tracking server deployment, backend/artifact stores, Model Registry stage transitions and alias-based promotion, MLproject files, framework autologging, and self-hosted vs. Databricks-managed tradeoffs.
Ships in mlops-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
MLflow is the most widely deployed open-source experiment tracking and model lifecycle tool, built around four components: Tracking (params/metrics/ artifacts per run), Projects (a packaging format for reproducible runs), Models (a standard packaging format with framework "flavors"), and the Model Registry (versioned models with stage/lifecycle metadata). This skill covers MLflow's specific mechanics — how the tracking server is deployed, what a backend store actually is, how registry stage transitions work, how autologging hooks into training frameworks, and how self-hosted deployment differs operationally from Databricks-managed MLflow. It does not repeat the vendor-neutral case for experiment tracking itself, which is covered in experiment-tracking — read that first if the question is "why track experiments," not "how does MLflow do it."
Staging → Production → Archived, or adopting the newer alias/tag
model that supersedes stages in recent MLflow versions.MLproject file so a training run is reproducible
by mlflow run on another machine or in CI.mlflow.autolog() or a framework-specific autolog call
(scikit-learn, PyTorch, XGBoost, TensorFlow/Keras, LightGBM) and
diagnosing why expected params/metrics aren't appearing.mlflow --version) before assuming a given
API is available.sqlite:///... for local/single-user experimentation
only, or a real SQLAlchemy-compatible database
(postgresql://, mysql://) for any shared/team/production tracking
server. The plain local file store (./mlruns, MLflow's zero-config
default) does not support the Model Registry and is unsafe under
concurrent writers.5000), and from the tracking server to both the
backend database and the artifact store.mlflow server --app-name basic-auth) or a reverse
proxy handling authn/authz — MLflow does not enforce authentication by
default.Choose and start a real backend store before anyone treats the tracking server as shared infrastructure. The default file store works for a single developer's local experiments but has no Model Registry support and corrupts under concurrent writers:
mlflow server \
--backend-store-uri postgresql://mlflow:${MLFLOW_DB_PASSWORD}@mlflow-db.internal:5432/mlflow \
--default-artifact-root s3://ml-artifacts-<ACCOUNT_ID>/mlflow \
--host 0.0.0.0 \
--port 5000
The backend store holds run metadata (params, metrics, tags, registry entries); the artifact store holds the actual files (models, plots, checkpoints). They are configured separately and can point at entirely different systems.
Point training clients at the tracking server, not a local path:
import mlflow
mlflow.set_tracking_uri("http://mlflow.internal:5000")
mlflow.set_experiment("fraud-scorer")
Use autologging to instrument standard training calls with minimal code changes, then add manual logging only for what autolog doesn't capture:
import mlflow
import mlflow.xgboost
import xgboost as xgb
mlflow.xgboost.autolog() # or mlflow.sklearn.autolog(), mlflow.pytorch.autolog(), etc.
with mlflow.start_run(run_name="xgb-baseline"):
model = xgb.train(params, dtrain, evals=[(dval, "validation")])
# autolog already captured params, per-iteration eval metrics, and
# the model artifact; add anything autolog can't infer:
mlflow.log_metric("business_precision_at_1pct_fpr", custom_metric)
The generic mlflow.autolog() enables autologging for every supported
flavor installed in the environment; call the framework-specific
version (mlflow.sklearn.autolog()) when only one framework is in use
to avoid surprises from unrelated libraries also being instrumented.
Autolog only instruments the framework's own training entry points
(.fit(), xgb.train(), a Keras .fit() loop) — a fully custom
training loop that doesn't call through those APIs won't be captured
and needs manual mlflow.log_metric/log_param calls.
Package training as an MLproject for anyone (or any CI job) to reproduce the exact run:
# MLproject
name: fraud-scorer
python_env: python_env.yaml
entry_points:
main:
parameters:
max_depth: {type: int, default: 6}
learning_rate: {type: float, default: 0.05}
data_snapshot: {type: string, default: "s3://data-lake/fraud/snapshots/latest"}
command: >
python train.py --max-depth {max_depth} --learning-rate {learning_rate}
--data-snapshot {data_snapshot}
# python_env.yaml — pin exact versions, not ranges, for reproducibility
python: "3.11.6"
dependencies:
- mlflow==2.16.2
- xgboost==2.1.1
- pandas==2.2.2
mlflow run . -P max_depth=8 -P learning_rate=0.03 \
--experiment-name fraud-scorer
mlflow run recreates the declared environment before executing the
entry point, so the run is reproducible by someone who has never seen
the training script's ad hoc setup steps.
Register the winning run's model artifact to the Model Registry:
result = mlflow.register_model(
model_uri="runs:/<RUN_ID>/model",
name="fraud-scorer",
)
Move a registered version through its lifecycle deliberately. The
classic stage model (None → Staging → Production → Archived)
is being superseded by a tag/alias-based model starting around MLflow
2.9 — check which your server version and client expect:
from mlflow import MlflowClient
client = MlflowClient()
# Classic stage-based transition (still supported, deprecated path):
client.transition_model_version_stage(
name="fraud-scorer",
version=14,
stage="Staging",
archive_existing_versions=False,
)
# Newer alias-based promotion (recommended on MLflow >= 2.9):
client.set_registered_model_alias(name="fraud-scorer", alias="champion", version=14)
client.set_registered_model_alias(name="fraud-scorer", alias="challenger", version=15)
Aliases are mutable pointers (like a Git tag) rather than a fixed
enum, so a team can define its own promotion vocabulary
(champion/challenger, canary/stable) instead of being locked
into Staging/Production/Archived.
Warning — promoting a version straight to
Production/championwithout a rollback plan is a risky action. Before transitioning, confirm: (a) which version is currently serving and can be restored by re-pointing the alias or re-transitioning it back, (b) that the previous version's artifact and run are still retained (not archived-and-deleted), and (c) that there is a fast, tested path to revert if the new version misbehaves under real traffic. Treat a registry promotion with no documented rollback the same as a production deploy withautoRollbackConfigurationdisabled — do not present it as a routine, low-risk action.
Serve or load a specific registered version explicitly by version/alias, never "whatever is latest" implicitly:
model = mlflow.pyfunc.load_model("models:/fraud-scorer@champion")
# or, pinned to an explicit version:
model = mlflow.pyfunc.load_model("models:/fraud-scorer/14")
Decide self-hosted vs. Databricks-managed deliberately, based on operational capacity, not default inertia:
mlflow server on your own compute, own Postgres/
MySQL, own S3/GCS bucket): full control over cost and data locality,
but your team owns HA, backups of the backend database, artifact
store lifecycle policies, and access control (MLflow's own
authentication is basic; most teams front it with a reverse proxy or
SSO gateway).autolog() calls over the blanket
mlflow.autolog() in shared training code, so enabling MLflow for one
framework doesn't silently start instrumenting an unrelated library also
imported in the same process.MLproject's environment file — a
range-pinned or unpinned dependency defeats the reproducibility
mlflow run is meant to provide.transition_model_version_stage or
set_registered_model_alias for the Production/champion designation
to a controlled release process (CI job, on-call approval), not any
script with registry write access.Symptom: A team starts logging to MLflow's default local ./mlruns
file store from multiple machines/CI jobs, and runs occasionally go
missing or the store becomes corrupted.
Fix: Stand up a real tracking server backed by Postgres/MySQL before
more than one process writes concurrently — the file store has no
concurrency guarantees and no Model Registry support.
Symptom: A model version is transitioned straight to Production
(or aliased champion) right after training, it turns out to regress a
key metric under real traffic, and there's no quick way back because the
previous version's alias was overwritten with no record of what it was.
Fix: Before promoting, record which version is being replaced (query
get_model_version_by_alias first), keep that version's artifact
un-archived, and have a tested one-line rollback
(set_registered_model_alias back to the prior version) ready — never
promote without knowing the exact revert step.
Symptom: mlflow.autolog() is called in a custom PyTorch training
loop that doesn't use a supported Trainer abstraction, and expected
per-epoch metrics never show up in the run.
Fix: Autologging only instruments the framework's own recognized
entry points; for a fully custom loop, either restructure it to use a
supported wrapper (e.g. a Lightning Trainer) or add explicit
mlflow.log_metric calls inside the loop instead of assuming autolog
covers it.
Symptom: mlflow run . fails on a teammate's machine with a
dependency resolution error, even though it worked for the original
author.
Fix: The MLproject's environment file used unpinned or
range-pinned dependencies; pin exact versions (mlflow==2.16.2, not
mlflow>=2.0) so the recreated environment matches what actually
produced the original run's results.
Symptom: The tracking server's artifact store fills up with thousands of large checkpoint artifacts from abandoned exploratory runs, and storage costs climb steadily. Fix: Apply a retention/lifecycle policy at the artifact store level (e.g. S3 lifecycle rules) for experiments tagged as exploratory, while explicitly excluding any run referenced by a current registry entry — consistent with the retention guidance in experiment-tracking; never let a blanket age-based deletion rule reach a run backing a production model.
Scenario: A team self-hosts MLflow for a fraud-scoring model, using Postgres as the backend store and S3 as the artifact store, with XGBoost autologging and alias-based registry promotion.
mlflow server \
--backend-store-uri postgresql://mlflow:${MLFLOW_DB_PASSWORD}@mlflow-db.internal:5432/mlflow \
--default-artifact-root s3://ml-artifacts-<ACCOUNT_ID>/mlflow \
--host 0.0.0.0 --port 5000
mlflow run for reproducibility, with
XGBoost autologging enabled:
import mlflow, mlflow.xgboost, xgboost as xgb
mlflow.set_tracking_uri("http://mlflow.internal:5000")
mlflow.set_experiment("fraud-scorer")
mlflow.xgboost.autolog()
with mlflow.start_run(run_name="xgb-depth6-lr0.05") as run:
model = xgb.train(
{"max_depth": 6, "eta": 0.05, "objective": "binary:logistic"},
dtrain, evals=[(dval, "validation")], num_boost_round=300,
)
mlflow.log_param("data_snapshot", "s3://data-lake/fraud/snapshots/2026-07-20")
run_id = run.info.run_id
from mlflow import MlflowClient
client = MlflowClient()
mv = mlflow.register_model(f"runs:/{run_id}/model", "fraud-scorer")
# Record the currently-promoted version before touching the alias,
# so there's an explicit rollback target.
previous_champion = client.get_model_version_by_alias("fraud-scorer", "champion")
print(f"current champion is version {previous_champion.version} — rollback target if needed")
client.set_registered_model_alias("fraud-scorer", "champion", mv.version)
model = mlflow.pyfunc.load_model("models:/fraud-scorer@champion")
client.set_registered_model_alias("fraud-scorer", "champion", previous_champion.version)
because step 3 captured the rollback target before promoting, this is
a one-line fix rather than an incident-time scramble.MLproject-style training run fits into an orchestrated
pipeline rather than being invoked ad hoc.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
22 skills in this plugin
/complete-mlops-platform-deployment-on-aws-from-scratchSequences a complete, end-to-end MLOps platform deployment on AWS from a bare AWS Organization to a production-ready platform serving a first retrained model — AWS landing zone, the SageMaker-vs-EKS+Kubeflow platform decision (EKS+Kubeflow is the worked path here), GPU node pools via the NVIDIA GPU Operator, MLflow experiment tracking on S3, a Kubeflow Pipelines retraining DAG, model registry/packaging with gated promotion, KServe canary/shadow serving, and drift monitoring. This is an integration/orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "stand up an MLOps platform on AWS from scratch," "build the full ML training-to-serving pipeline on EKS/SageMaker," "give me the end-to-end sequence from AWS account to a retrained, monitored production model," or "decide between SageMaker and EKS+Kubeflow for our ML platform."
/complete-mlops-platform-deployment-on-azure-from-scratchSequences a complete, end-to-end MLOps platform deployment on Azure from a bare tenant to a production-ready platform serving a first retrained model — Azure landing zone, the Azure-ML-vs-AKS+Kubeflow platform decision (Azure ML is the worked path), GPU compute clusters/quota, MLflow-compatible experiment tracking, an Azure ML pipeline retraining DAG, Model Registry with gated promotion, managed online endpoints with traffic-split canary rollout, and data-drift monitoring. An integration/ orchestration skill that sequences existing tool-specific skills in the right order and flags handoff points — it does not restate their internals. Use when a user asks to "stand up an MLOps platform on Azure from scratch," "build the full ML training-to-serving pipeline on Azure ML/AKS," "give me the end-to-end sequence from Azure tenant to a retrained, monitored production model," or "decide between Azure ML and AKS+Kubeflow for our ML platform."
/complete-mlops-platform-deployment-on-gcp-from-scratchSequences a complete, end-to-end MLOps platform deployment on GCP from a bare Google Cloud Organization to a production-ready platform serving a first retrained model — GCP landing zone, the Vertex-AI-vs-GKE+Kubeflow platform decision (Vertex AI is the worked path), GPU quota and accelerator-backed custom training, Vertex AI Experiments tracking, a Vertex AI Pipelines retraining DAG, Model Registry with gated promotion, endpoints with traffic-split canary rollout, and Vertex AI Model Monitoring for drift. An integration/orchestration skill that sequences existing tool-specific skills in the right order and flags handoff points — it does not restate their internals. Use when a user asks to "stand up an MLOps platform on GCP from scratch," "build the full ML training-to-serving pipeline on Vertex AI/GKE," "give me the end-to-end sequence from GCP org to a retrained, monitored production model," or "decide between Vertex AI and GKE+Kubeflow for our ML platform."
/complete-mlops-platform-deployment-self-hosted-k8s-from-scratchSequences a complete, end-to-end, self-hosted and cloud-agnostic MLOps platform on any Kubernetes cluster — no managed ML service from any vendor — from a bare cluster to production: GPU node pools via the NVIDIA GPU Operator, a Kubeflow-vs-Ray orchestration choice, self-hosted MLflow-style tracking and registry on self-operated object storage and Postgres, on-cluster serving, and self-hosted drift monitoring. An integration/orchestration skill sequencing existing tool-specific skills in the right order, explicit about the added operational burden of self-hosting every layer versus a managed-cloud MLOps platform. Use when a user asks to "build a self-hosted MLOps platform on Kubernetes," "stand up MLflow and Kubeflow ourselves with no managed cloud ML service," "design a vendor-agnostic ML platform we can run on any cluster," or "give me the full sequence for a fully self-managed ML platform from bare cluster to production."
/data-and-model-lineageGuides tracking end-to-end lineage from raw data sources through feature computation, training runs, and model versions, to enable root-cause tracing, impact analysis, and compliance/audit answers. Use when the user asks to "trace where a feature/model came from", set up data/model lineage tracking, do impact analysis before changing an upstream table, answer an audit/compliance question about a model's training data, or debug a bad prediction back to its source.
/data-catalog-and-lineage-governance-datahub-amundsenGuides deploying and operating enterprise data catalog and governance tooling — DataHub or Amundsen — for discovering, tagging, classifying, and owning datasets, features, and models across an organization, including deprecation workflows that must check downstream consumers before deletion. Use when the user asks to "set up a data catalog", "make datasets/models searchable and discoverable", "tag PII/sensitive data", assign data ownership, install or configure DataHub or Amundsen, write an ingestion recipe, or safely deprecate/delete an old dataset or model artifact without breaking a consumer.
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin mlops-skillsOther plugins' skills for the same job