Q&A-1What is a model registry, and why is standard code version control (such as Git) insufficient for versioning machine learning models in production?
Answer
The 90-second answer. A model registry is the system of record for deployable models. It holds three things Git does not: the artifact bytes themselves; the metadata that makes them loadable and reproducible (training run, dataset snapshot, hyperparameters, input/output signature, dependency lockfile); and mutable deployment pointers, aliases like champion or staging, that move between immutable versions without touching code. Git versions text deterministically. A model is a non-deterministic binary whose identity depends on data and environment as much as on code, and whose promotion is an operational act, not a code change. Assume the team already has CI on Git and a training pipeline; the open question is where the trained artifact and its serving state live.
1. Size and storage topography. A trained artifact is an opaque binary: a 14 GB LLM checkpoint, an 800 MB gradient-boosted tree ensemble. Git stores a full blob per version, so twenty weekly retrains of that 14 GB checkpoint put roughly 280 GB into the object store, and every clone that checks out the branch pays for it. Git LFS moves the bytes to a separate store but keeps a pointer file in the tree and still smudges on checkout, so a fresh CI runner materializes gigabytes before it can run a single test. Serving runtimes don't want a checkout at all; they pull from object storage with a presigned URL or an S3/GCS API call.
2. Non-determinism and lineage. In software, commit C1 compiles to binary B1: same input, same output. In ML, the same commit trained on a different data partition, seed, or CUDA version produces different weights. Git's SHA identifies the code, not the artifact, so it cannot answer "which dataset and hyperparameters produced the model that is serving right now?" A registry binds the artifact to its run_id, dataset snapshot digest, hyperparameters, and evaluation metrics, which is what makes an incident review or a rollback decision possible.
3. Contract enforcement. Git cannot validate a model's signature. If training writes user_age as int64 and the serving path sends a float or a string, nothing in the repository catches it; the mismatch surfaces as a 500 on the first request. A registry records the input/output signature and the dependency lockfile next to the artifact, so the serving container can be built and its payload validated before rollout. Detect it at the gateway: a signature mismatch should be a 4xx naming the offending field, not a 500 from inside the model.
4. Promotion is not a merge. Git expresses state through branches and tags, which tie deployment intent to a code commit. Promoting a validated model changes operational intent without changing the artifact. Moving alias champion from version 11 to version 12 is a metadata write; rolling back is moving it back. Doing the same in Git means a commit or tag that describes nothing about the artifact, plus a rebuild that may not reproduce the same weights.
Comparison: Git vs. Model Registry
| Dimension | Git / Git LFS | Dedicated Model Registry (MLflow / SageMaker / Vertex) |
|---|---|---|
| Primary asset | Source code, human-readable text diffs | Packaged binary artifacts, tokenizer/preprocessing, runtime environments |
| Identity | Tree hash / commit SHA | Model name, integer version, artifact content digest (SHA-256) |
| Metadata tracked | Commit message, author, timestamp | Training run ID, dataset snapshot hash, hyperparameters, validation metrics |
| Model interface | None | Enforced input/output signature (tensors/columns) and dependency lockfile |
| Lifecycle control | Branch merges, PR approvals | Deployment aliases (champion/challenger), approval states (Pending, Approved) |
Minimal MLflow model representation
When a model is registered, MLflow writes an MLmodel contract next to the artifact linking the loader, the environment, and the exact schema (abridged, MLflow 2.x):
artifact_path: model
flavors:
python_function:
env:
conda: conda.yaml
virtualenv: python_env.yaml
loader_module: mlflow.sklearn
model_path: model.pkl
python_version: 3.11.8
sklearn:
pickled_model: model.pkl
serialization_format: cloudpickle
sklearn_version: 1.3.2
mlflow_version: 2.9.2
run_id: 8a7f09d8e52a46c1b3c9489a2bf405e1
signature:
inputs: '[{"name": "user_age", "type": "integer"}, {"name": "spend_30d", "type": "double"}]'
outputs: '[{"type": "float"}]'
utc_time_created: '2025-02-15 10:24:01.320110'The registry API is what makes this queryable: list versions, diff validation metrics across them, and reassign a serving target without rewriting repository history.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.