Model Registry
Training ends with a file, serving starts with an approved version. A registry is the shelf between them, where every model is versioned, staged, and one pointer move from rollback.
Why Does This Exist?
Training ends with a file on someone's laptop: fraud-model-v4.pkl. Serving starts with an API owned by another team. Between them sits a gap made of emailed attachments, shared-drive folders named final-v2-REALLY, and nobody able to answer which version is live right now. When the live model breaks at 2 a.m., rollback becomes archaeology.
A registry closes that gap with one shelf every team reads. Each trained model is stored once, versioned, labeled with its stage, and promoted through approvals instead of file copies. This page covers the shelf: what gets stored, the four stages, and the promotion that moves one pointer instead of one file. The run history that earns a version its promotion lives in experiment tracking. The code-data-environment bundle each version pins lives in model versioning. The alarm that sends a version back off Production lives in model monitoring.
Think of It Like This
A parcel shelf with labelled cubbies
A post office wall has cubbies labelled Incoming, Checking, Ready for Pickup, and Returned. A parcel moves from cubby to cubby with a scan each time, and anyone can see exactly where any parcel sits. Nobody carries parcels home in pockets and nobody wonders which one is ready.
Model versions are the parcels. None, Staging, Production, and Archived are the cubbies. Approvals are the scans, the registry is the wall, and rollback is sliding a parcel one cubby back.
Where it stops: parcels never change inside their cubbies, while teams keep retraining. The registry handles that by never editing a version, only adding new ones, so every cubby move stays auditable.
How It Actually Works
A registry stores three things per version: the artifact itself, the metadata that explains it, and the stage label that says where it stands. Metadata means training data hash, hyperparameters, validation scores, and who approved what. The model card entry describes the document many teams attach to each version, and the MLOps entry places the registry inside the wider release machine.
Stages are four, in order. None means just uploaded, untested. Staging means under QA or shadowing live traffic. Production means serving users right now, exactly one version per model name. Archived means retired but kept, because the next rollback may need it. Promotion moves the label forward only with approvals, typically two senior clicks, and promoting a new version to Production archives the old one in the same transaction. That pairing is the whole trick: there is always exactly one live version and always a known previous one.
Worked example: fraud model versions 1 through 4
Version 1 scored 0.81 and sits Archived. Version 2 scored 0.84 and serves Production. Version 3 scored 0.87, passed two weeks of shadow QA in Staging, and collects its second approval. Promotion runs: version 3 becomes Production, version 2 becomes Archived, in one move. The ledger now reads v1 Archived, v2 Archived, v3 Production. Version 4 trains tomorrow and lands in None, touching nothing live.
Rollback is the same move in reverse. Version 3 misbehaves on Friday night, the on-call engineer repoints Production at version 2, and the site serves the 0.84 model within minutes. No file hunt, no rebuild, no argument about which artifact was live. That single-pointer rollback is the diagram: four shelves, one arrow from Staging to Production, and version 2 sliding to Archived at the same instant.
Code
The point is the check: model the four-stage ledger in plain Python and confirm promotion archives the old live version while rollback repoints one label.
ledger: dict[str, dict[str, str]] = { "v1": {"stage": "Archived", "accuracy": "0.81"}, "v2": {"stage": "Production", "accuracy": "0.84"}, "v3": {"stage": "Staging", "accuracy": "0.87"},}
approvals: int = 2if approvals >= 2: # promotion: v3 live, old live archived ledger["v2"]["stage"] = "Archived" ledger["v3"]["stage"] = "Production"
for version in ("v1", "v2", "v3"): print(version, ledger[version]["stage"])# -> v1 Archived# -> v2 Archived# -> v3 ProductionThe printout matches the worked example: one live version, two archived, and rollback would only change the v2 and v3 labels back. Add a version 4 in None and rerun to confirm promotion logic never touches unapproved entries.
Watch Out For
Dumping every experiment into the registry
A pipeline registers all 200 daily training runs, and the registry becomes the experiment tracker with a new name. The curated shelf turns into a junk drawer: nobody can find the three versions that matter, approvals get clicked blindly, and rollback means scrolling through noise at 2 a.m.
Symptom: hundreds of versions per model name, most without scores or approvers, and engineers asking which one is live despite the registry existing. Fix: register only models that pass the promotion bar, roughly one a week, and keep every raw attempt in experiment tracking instead. The registry holds releases, not attempts.
Overwriting artifacts instead of adding versions
A team reuses one filename per model and uploads each retrain over the last. Friday's rollback then restores nothing, because the previous bytes are gone. Worse, two endpoints that loaded at different times now serve different models under one name, and no audit can say which served which user.
Symptom: rollback replays the same broken behavior, or two replicas disagree with no version difference to explain it. Fix: make artifacts immutable, one upload per version number, and reproduce any version bit for bit through reproducibility instead of reusing files.
The Quick Version
- A registry stores each model artifact once with its metadata and a stage label, ending emailed files and mystery versions.
- Stages run None to Staging to Production to Archived, with exactly one Production version per model name.
- Our fraud v3 at 0.87 takes Production while v2 at 0.84 slides to Archived in the same approved move.
- Rollback repoints one label at the previous version, restoring the 0.84 model in minutes without a rebuild.
- Only promoted releases enter the registry, while every raw training attempt stays in experiment tracking.