Model registry & versioning

In one sentence

A versioned catalog of deployable models with their lineage, metrics and approval state, so deploying and rolling back means moving a pointer, not retraining and hoping.

Analogy: A package registry like npm or Docker Hub, but for models: immutable versions, tags like `prod`, and you roll back by pointing the tag at the previous version.

Serving resolves an alias, never a file; promotion and rollback are both just moving that alias.

How it works

  • Each registered version is immutable and carries the artifact, eval metrics, model card, owner and input/output signature.
  • Lineage links each version to its code commit, training data version and the experiment run that produced it.
  • Deploys point at an alias like @champion; promotion passes automated checks, then human approval where risk demands it.
  • Keep the last 2–3 production versions loadable, so rolling back to N-1 takes seconds.
  • For LLM apps, version model id, prompt, index, tool schemas and guardrails together as one bundle.

Check yourself

Answer to mark it learned; your answers aren't scored.

Two days after v14 of a credit model is promoted, approvals in one region drop 6%. The registry still holds v13, approved and loadable. What do you do first?

Go deeper

Full explanation

A model registry is the system of record between training and serving. Every training run good enough to ship is registered as an immutable, numbered version that carries:

  • the artifact (weights, or a container image/URI);
  • lineage: code commit, training data version, and the Experiment tracking & reproducibility run that produced it;
  • eval metrics, model card, owner and signature (input/output schema).

Deployment never points at a file path. It points at a stage or alias (staging, production, @champion), and promotion is a gated transition: automated checks (eval thresholds, bias tests), then human approval where risk demands it. Rollback is moving the alias back to version N-1: seconds, no retraining.

Tools: MLflow (open source; 2.9 deprecated fixed stages in favor of aliases), SageMaker Model Registry (model package groups with an approval status), and Google Cloud's Model Registry (Vertex AI, renamed Gemini Enterprise Agent Platform in 2026).

For LLM apps the deployable unit is a bundle: model id + prompt version + index version + tool schemas + guardrail config. Version and promote them together; changing any one of them is a release.

Code Register, gate and roll back with MLflow aliases
pythonRegister, gate and roll back with MLflow aliases
import mlflow
from mlflow import MlflowClient

client = MlflowClient()
NAME = "fraud-scorer"

# Register the model logged by a tracked run: lineage comes for free
mv = mlflow.register_model(f"runs:/{run_id}/model", NAME)
client.set_model_version_tag(NAME, mv.version, "data_version", "txns@2026-10-31")

prev = client.get_model_version_by_alias(NAME, "champion")  # keep for rollback

# Promotion = gated alias move, never a file copy
if eval_auc(mv) >= prev_auc(prev) and approved_by_risk(mv):
    client.set_registered_model_alias(NAME, "champion", mv.version)

# Serving resolves the alias at load time
model = mlflow.pyfunc.load_model(f"models:/{NAME}@champion")

# Rollback: repoint the alias, no retraining
client.set_registered_model_alias(NAME, "champion", prev.version)
Real example

A credit-risk team ships v14 of a scoring model: offline AUC beats v13 by 0.8 points and the risk officer approves it in the registry. Two days later approvals in one region drop 6%. On-call repoints @production to v13 in under a minute. The registry's lineage shows v14 was trained on applications@2026-10-01, a snapshot with a broken join for that region, so the fix goes into the data pipeline, not the model.

Trade-offs +3 · −3

+ You gain

  • One source of truth for what is running in production and how it was built.
  • Rollback is an alias move measured in seconds, not a retrain.
  • Approval gates plus lineage give auditors (EU AI Act, SR 11-7 model risk) a paper trail.

− You pay

  • Only as good as the discipline: one model deployed around it turns the registry into fiction.
  • Lineage is shallow unless experiment tracking and data versioning are wired in too.
  • A registry is not a deployment system: you still need CD that resolves aliases and rolls out safely.

Use it when

As soon as more than one model version or more than one person touches production, and always for regulated decisions that need an audit trail.

Avoid it when

A throwaway prototype, or an API-only LLM app with one prompt: git tags plus a prompt registry suffice until versions multiply.

Numbers to know 3
  • MLflow 2.9 (Dec 2023) deprecated the fixed Staging/Production stages in favor of free-form aliases (e.g. @champion, added in 2.8) plus tags.
  • Rule of thumb: keep the last 2–3 production versions loadable so rollback is instant.
  • Rule of thumb: an LLM release pins ~5 things together: model snapshot, prompt, retrieval index, tool schemas, guardrail config.
Common pitfalls 4
  • Deploying latest or a file path instead of an immutable version: nobody can say what is serving.
  • Registering a model without its data version, so it can't be reproduced or explained later.
  • Versioning the prompt in one place and the model in another: a 'prompt fix' silently ships on a different model.
  • Promotion by hand-clicking with no eval gate: the registry becomes a rubber stamp.
Interview questions 2

Answer out loud first, then reveal.

How would you version an LLM application, not just a model?Show answer

I treat the release as a bundle: a pinned, dated model snapshot, the prompt version, the retrieval index version, tool schemas and guardrail config, plus the eval report that justified it. The bundle gets one version and one alias, so promotion and rollback move all of it together. The failure I'm avoiding is a floating provider alias moving underneath a prompt tuned for the old snapshot, so I pin model ids and re-run the eval suite on any change.

Walk me through promoting a model to production.Show answer

Training registers an immutable version with lineage: commit, data snapshot, run id. CI runs the gate: metrics against the current champion on the same frozen eval set, per-slice metrics so a global win can't hide a segment regression, plus latency and size checks. If it passes, and a human signs off for high-risk models, it goes to shadow or canary, then the @production alias moves. Rollback is repointing the alias, and I rehearse it, because an untested rollback isn't one.