Skip to content
Tutorials Center
My learning

Topics

Lesson 17 of 41 ยท Model Packaging and Registry

Model Registry and Stages

Learn what a model registry stores, how versions move through staging and production with approval checks, how aliases make rollback instant, and build a small registry in Python.

By now you can produce many trained models. The question becomes: which one is in production right now, who approved it, and how do we go back if it misbehaves? A model registry is the catalogue that answers this. It is the bridge between training and deployment.

What a registry stores

A registry holds

Versions Immutable numbered models.
Links Run, data, code, metrics.
Stage or alias Which version serves.
History Who promoted what, when.

The registry is the single source of truth.

1 / 2

Key rules: a registered version is immutable (never edit it; register a new one), and the deployment asks the registry for "the production model" instead of hard-coding a file path.

A registry in forty lines

This stand-in registry shows the mechanics: versions, stages, a promotion rule, and rollback. Real systems (MLflow Model Registry, SageMaker, Vertex AI, Azure ML) offer the same concepts with storage and a UI.

Python A tiny model registry

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Version 2 is blocked by the quality rule, version 3 is promoted and version 1 is archived automatically. See quality gates for how such rules are defined in practice.

Aliases make rollback instant

Because serving asks for the production alias, rollback is just moving the alias back to the previous version. No retraining, no rebuild.

Python Rollback by moving an alias

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Some registries use fixed stages (Staging, Production, Archived); newer ones prefer free-form aliases and tags (champion, challenger, approved=true), which are more flexible than a rigid ladder.

Registry practices

  • Register from the pipeline, not by hand, so every version has lineage (metadata, run id, data hash).
  • Gate promotion on automated checks plus, for risky models, a human approval recorded in the history.
  • Deploy by alias ("production"), never by file path.
  • Keep old versions at least as long as audits or rollbacks might need them.
  • Pair promotion with a safe rollout, such as canary or shadow deployment.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why should a registered model version be immutable?

    Immutability makes versions trustworthy for audit and rollback; changes are new versions.
  2. 2. How does an alias like 'production' simplify rollback?

    Serving resolves the alias at load time, so changing what it points to changes what is served, without a rebuild.
  3. 3. What should happen when a candidate fails a quality check?

    Gated promotion blocks unqualified models, and the log explains why.
  4. 4. Which is the best way for a service to find its model?

    Resolving through the registry keeps deployment and model choice decoupled.

Summary

  • A registry catalogues immutable model versions with lineage, metrics and a stage or alias.
  • Promotion is a gated decision and is logged.
  • Serving resolves the production alias, so rollback is a pointer change.
  • Register from the pipeline and pair promotion with a safe rollout.

Next: Packaging and Environments