promptdojo_

Model registry shape — step 1 of 7

The model registry: which model is live, and why

"The model" is a fiction; there are only versions of models. The registry is the system of record that answers, at 2am: which version is in production, what data and features built it, how good was it, and how do we go back one?

Run the shape

Each registry entry ties together everything this course has been versioning separately:

  • the artifact (weights/pipeline file — chapter 43's checkpoint, graduated),
  • the provenance: data version (chapter 37), feature contract version (lesson 01), and the tracker run that produced it (lesson 03) — the full "why does this model exist" chain,
  • metrics at registration time (chapter 41's report), and
  • a stage label: staging → production → archived.

The promote() call is the deployment moment as data: the old production model is archived (not deleted — it's your rollback), the new one takes the label, and chapter 46's serving code asks the registry for "churn, stage=production" instead of hardcoding a file path. Rollback is promote(name, previous_version) — one move, because the artifact and its provenance never left.

MLflow's Model Registry implements this shape — versions, lineage back to runs, and deploy labels. (Currency note: MLflow's original fixed stages are deprecated in favor of flexible aliases like @champion; the concept you just ran — a label that names the live version — is the same either way.) Cloud ML platforms have equivalents. As with the tracker: the dict you just ran is the concept — the tools add durability, access control, and hooks.

Promotion is a gate, not a mood

What earns staging → production? A checklist that should look like this course: eval suite passed at least as well as the incumbent, on the same slices (chapters 21/41); contract checks green (lesson 01); a skew smoke-test through the real serving path (lesson 02). Chapter 46 wires that checklist into CI so promotion without evidence isn't even possible.

Where AI specifically gets this wrong

  • model_final_v2_REAL.pkl. Filesystem archaeology instead of a registry. If the answer to "what's live?" involves ls, there is no answer.
  • Artifacts without provenance. Weights whose training data and feature versions are unknown can be served but never debugged — chapter 47's drift work needs that lineage.
  • Deleting the old model on deploy. The rollback IS the old version. Archive, never delete, at least until the new one has survived chapter 47's monitoring.