RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /MLOps for Local AI
  6. /Ch. 5
MLOps for Local AI

05. Model Registry

Chapter 5 of 24 · 20 min
KEY INSIGHT

The registry enforces lifecycle stages. `Staging` is for testing before production. `Production` is for active serving. `Archived` retains models for rollback or audit without cluttering active lists. Query and transition models: ```python # List all versions of a model versions = client.search_model_versions("name='spam-classifier'") for v in versions: print(f"Version {v.version}, Stage: {v.current_stage}, Run: {v.run_id}") # Transition to production client.transition_model_version_stage( name="spam-classifier", version=3, stage="Production" ) # Add description client.update_model_version( name="spam-classifier", version=3, description="Updated with balanced class weights, +2% accuracy" ) ``` Model metadata matters. Store what the model does, who approved it, and what validation it passed. This turns the registry into an audit trail. ```python # Annotate model with rich metadata client.set_model_version_tag( name="spam-classifier", version=3, key="validation_report", value="Passed accuracy > 0.92, latency < 50ms" ) client.set_model_version_tag( name="spam-classifier", version=3, key="approved_by", value="jane@ops-team" ) ```

The model registry is MLflow's mechanism for managing model versions through their lifecycle: staging, production, and archival. Without a registry, "the current model" is whoever uploaded it last. With a registry, every model has an owner, a stage, and an approval trail.

Register a model from a run:

from mlflow.tracking import MlflowClient

client = MlflowClient()

# Register model from completed run
model_uri = "runs:/<run_id>/model"
client.register_model(
    model_uri=model_uri,
    name="spam-classifier"
)

This creates a new model version under the spam-classifier model name. Each training run that produces a model can become a new version.

Local verification checkpoint

Run the smallest example from this chapter in a local workspace and record the package version, runtime, data path, and observed output. If the result depends on model size, vector count, CPU/GPU backend, or available memory, note that constraint beside the exercise so the lesson remains reproducible.

Local verification checkpoint

Run the smallest example from this chapter in a local workspace and record the package version, runtime, data path, and observed output. If the result depends on model size, vector count, CPU/GPU backend, or available memory, note that constraint beside the exercise so the lesson remains reproducible.

EXERCISE

Complete three training runs with different hyperparameters. Register each model. List all versions via the API. Transition one to Production. Verify in the MLflow UI that the production model is marked distinctly.

← Chapter 4
MLflow Tracking Server
Chapter 6 →
Model Versioning