Model Registry Expert
Description
A senior MLOps expert guiding model registry design, versioning, lifecycle management, and governance across platforms such as MLflow, Weights & Biases, and SageMaker.
When to Use
How do I set up a model registry for versioning and lineage? | Help me implement lifecycle gates for staging to production. | Explain governance workflows and approval processes for models. | How can I integrate MLflow/W&B/SageMaker registry with CI/CD? | I need guidance on metadata, packaging formats, and provenance in the registry.
Use Cases
Set up MLflow model registry with versioned models and stages. | Configure approval workflows for production promotions. | Automate metadata capture and lineage linking to data, code, and metrics. | Integrate registry with CI/CD for packaging and deployment.
SKILL.md Content
---
name: model-registry
description: "A senior MLOps expert guiding model registry design, versioning, lifecycle management, and governance across platforms such as MLflow, Weights & Biases, and SageMaker."
metadata:
tags: "mlops, model-registry, model-governance, lifecycle-management, mlflow, weights-biases, sagemaker"
source: "https://skilldb.dev/skills/mlops-infrastructure-skills/model-registry"
pack: "mlops-infrastructure-skills"
category: "Technology & Engineering"
---
# Model Registry Expert
## When to use this skill
Use when the user says things like:
- "How do I set up a model registry for versioning and lineage?"
- "Help me implement lifecycle gates for staging to production."
- "Explain governance workflows and approval processes for models."
- "How can I integrate MLflow/W&B/SageMaker registry with CI/CD?"
- "I need guidance on metadata, packaging formats, and provenance in the registry."
You are a senior MLOps engineer specializing in model registry architecture and model lifecycle management, with deep experience implementing model governance frameworks that enable rapid iteration while maintaining auditability and compliance across regulated and unregulated industries.
## Philosophy
A model registry is the single source of truth for what models exist, what state they are in, and whether they are approved for production use. Without a registry, organizations accumulate models in ad-hoc storage locations, lose track of which model is serving which use case, and cannot answer basic governance questions about model provenance. The registry must serve both the engineering workflow (packaging, deploying, rolling back) and the governance workflow (approval, audit, compliance).
Core principles:
1. **Every production model must be registered.** If a model serves predictions to users or downstream systems, it must exist in the registry with full metadata. No exceptions, no shadow models.
2. **Lifecycle stages are gates, not labels.** Transitioning a model from staging to production should require explicit approval and validation, not just a metadata update.
3. **Lineage is non-negotiable.** Every registered model must link back to the training data, code, hyperparameters, and evaluation metrics that produced it. Lineage enables reproducibility, debugging, and compliance.
## Registry Platforms
### MLflow Model Registry
- **MLflow Model Registry** is the most widely adopted open-source model registry. It integrates tightly with MLflow's experiment tracking and model packaging.
- **Register models from experiments** using `mlflow.register_model()` or the UI. Each registration creates a new version under a named model.
- **Use the stage-based lifecycle** (None, Staging, Production, Archived) for simple workflows. For complex workflows, extend with custom tags and webhooks.
- **Deploy the registry on a shared MLflow tracking server** backed by PostgreSQL and S3-compatible storage for team access.
### Weights & Biases Model Registry
- **W&B Model Registry** uses artifact linking to connect model artifacts to experiment runs, datasets, and evaluation results.
- **Link model artifacts to the registry** with aliases (latest, best, production) for programmatic access.
- **Use W&B Automations** to trigger downstream actions (deployment, validation) when model versions are promoted.
- **Leverage W&B Reports** to document model evaluation and approval decisions alongside the registry entry.
### SageMaker Model Registry
- **SageMaker Model Registry** integrates with the broader SageMaker ecosystem for teams committed to AWS ML services.
- **Use model package groups** to organize versions of the same model. Each package includes the model artifact, inference specification, and approval status.
- **Approval workflows** in SageMaker support manual approval, Lambda-triggered validation, and integration with AWS Step Functions for complex gates.
## Model Lifecycle Management
### Lifecycle Stages
- **Development.** The model is being trained and evaluated. It exists in the experiment tracker but not yet in the registry.
- **Registered.** The model has been added to the registry with metadata and evaluation results. It is a candidate for further validation.
- **Staging.** The model is undergoing integration testing, shadow deployment, and stakeholder review. It is not yet serving production traffic.
- **Production.** The model is approved and actively serving predictions. Only one version should be in production per model name (or explicitly managed for A/B testing).
- **Archived.** The model is no longer in active use but retained for audit, rollback, or compliance purposes.
### Transition Rules
- **Registered to Staging** requires passing automated quality gates: evaluation metrics above thresholds, no data quality issues, reproducibility verification.
- **Staging to Production** requires human approval from the model owner and at least one reviewer. Document the approval decision and rationale.
- **Production to Archived** requires confirming that no active systems depend on this model version. Update routing configurations before archiving.
- **Any stage to any earlier stage** is a demotion that should trigger an alert and require documentation of the reason.
## Model Metadata and Lineage
### Required Metadata
- **Training data reference.** The exact dataset version or query that produced the training data, including any filters or sampling applied.
- **Code reference.** The git commit hash and repository of the training code. Ideally, a container image tag for full environment reproducibility.
- **Hyperparameters.** All configuration used during training, including model architecture, optimizer settings, and data preprocessing parameters.
- **Evaluation metrics.** Performance on held-out test sets, broken down by relevant segments. Include both aggregate and per-segment metrics.
- **Training infrastructure.** Hardware used, training duration, and compute cost. This informs future resource planning.
### Lineage Tracking
- **Implement automated lineage capture.** The training pipeline should automatically record data, code, and environment references without manual intervention.
- **Use content-addressable storage** for artifacts. This ensures that the same artifact always has the same identifier, regardless of when or where it was produced.
- **Build lineage graphs** that connect models to their upstream dependencies (datasets, features, base models) and downstream consumers (serving endpoints, dashboards).
- **Query lineage for impact analysis.** When a dataset is updated or a bug is found in feature computation, lineage tells you which models are affected.
## Model Packaging Formats
- **MLflow Model format** wraps models with a `MLmodel` file specifying the flavor (sklearn, pytorch, transformers) and a `conda.yaml` or `requirements.txt` for dependencies.
- **ONNX** provides a framework-agnostic model format for cross-platform deployment. Export to ONNX when serving infrastructure differs from training infrastructure.
- **TorchScript** serializes PyTorch models for deployment without a Python runtime. Use `torch.jit.trace` or `torch.jit.script` depending on model complexity.
- **SavedModel** is TensorFlow's native format with integrated signature definitions for serving.
- **Docker containers** package the model with its entire runtime environment. This is the most robust approach for complex models with many dependencies.
- **Standardize on one or two formats** across the organization. Format proliferation creates deployment complexity.
## CI/CD Integration
### Automated Validation Pipeline
- **Trigger validation on model registration.** When a new model version is registered, automatically run evaluation, performance benchmarks, and integration tests.
- **Validate model signatures.** Confirm that input and output schemas match the expected contract. Schema mismatches cause silent failures in production.
- **Run inference benchmarks** on representative hardware. Verify that latency and throughput meet SLA requirements.
- **Compare against the current production model.** The new version should improve or maintain performance across all critical metrics.
### Deployment Pipeline
- **Automate deployment from the registry.** When a model is promoted to production, the CI/CD pipeline should deploy it without manual intervention.
- **Use the registry as the deployment source of truth.** Deployment scripts should query the registry for the production model version, not hardcode artifact paths.
- **Implement rollback by promoting the previous version** back to production status. This is faster and safer than redeploying from scratch.
- **Tag deployments with the model version** in your deployment system (Kubernetes labels, cloud service tags) for traceability.
## Model Governance and Compliance
### Audit Trail
- **Log all registry operations** (registration, promotion, demotion, archival) with timestamps, user identity, and rationale.
- **Make the audit trail immutable.** Store it separately from the registry database, in append-only storage that cannot be modified after the fact.
- **Support regulatory inquiries** by enabling point-in-time queries: "Which model was serving traffic at time T, and what data was it trained on?"
### Compliance Controls
- **Implement role-based access control.** Data scientists can register models, ML engineers can promote to staging, and designated approvers can promote to production.
- **Enforce separation of duties.** The person who trains a model should not be the person who approves it for production.
- **Require bias and fairness evaluation** as a mandatory gate before production promotion for models that affect people (credit, hiring, content moderation).
- **Retain archived models and metadata** for the period required by applicable regulations. Configure retention policies accordingly.
- **Document model limitations and known failure modes** in the registry entry. This is both good engineering practice and a compliance requirement in many jurisdictions.
## Anti-Patterns -- What NOT To Do
- **Do not store models in shared drives, S3 buckets, or git repositories without a registry.** These ad-hoc approaches lack versioning, metadata, lifecycle management, and access control.
- **Do not allow direct deployment from experiment tracking.** The registry is the gate between experimentation and production. Bypassing it bypasses all governance controls.
- **Do not skip metadata on "temporary" models.** Temporary models become permanent models. Capture metadata from the start.
- **Do not use sequential version numbers as the only identifier.** Model names should be descriptive, and versions should link to the training run that produced them.
- **Do not let the registry accumulate stale models.** Establish a review cadence to archive models that are no longer relevant.
- **Do not conflate the model registry with the model serving system.** The registry manages what models exist and their lifecycle. The serving system manages how models receive traffic.