/mlops-skills:model-packaging-and-versioningfrom mlops-skills
Guides packaging trained ML/LLM models into versioned, reproducible artifacts with semantic versioning and promotion across dev/staging/production stages. Covers model registries (MLflow, Vertex AI, SageMaker, Hugging Face Hub), ONNX/TorchScript bundles, and rollback strategies.
Ships in mlops-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A trained model is not production-ready just because it produces good offline metrics. It becomes production-ready when it is packaged into an immutable, traceable artifact — with a fixed version identifier, a recorded lineage back to the code/data/config that produced it, a declared runtime dependency set, and a documented promotion state (dev/staging/production). Without this discipline, teams end up unable to answer "which model is live right now," "what exactly changed between v12 and v13," or "can we roll back in the next five minutes." Model packaging and versioning turns a model from a loose file on someone's laptop into a governed, auditable release artifact that a serving system, a compliance reviewer, and an on-call engineer can all reason about.
.tar.gz bundle
for SageMaker/Vertex).torch.jit.trace/torch.onnx.export
(PyTorch ≥ 2.0), tf.saved_model.save (TensorFlow ≥ 2.x), optimum/onnxruntime
for transformer export.<model-name>-v<major>.<minor>.<patch>+<short-git-sha>.<training-run-id>.
major: incompatible input/output schema change (new feature set, new
label space, new tokenizer).minor: retrain on new data or materially changed hyperparameters,
same schema.patch: bug-fix retrain (e.g. fixed a data leak, no architecture change).fraud-scorer-v2.3.1+a1b2c3d.run-8841.pip freeze or conda env export
snapshot, or a locked pyproject.toml).import torch
model.eval()
example_input = torch.randn(1, 3, 224, 224)
traced = torch.jit.trace(model, example_input)
# Parity check before trusting the exported artifact
with torch.no_grad():
ref_out = model(example_input)
traced_out = traced(example_input)
assert torch.allclose(ref_out, traced_out, atol=1e-4), "export parity check failed"
traced.save("fraud-scorer-v2.3.1.pt")
import mlflow
with mlflow.start_run(run_id="run-8841"):
mlflow.pytorch.log_model(
traced,
artifact_path="model",
registered_model_name="fraud-scorer",
)
client = mlflow.tracking.MlflowClient()
client.update_model_version(
name="fraud-scorer",
version="14",
description="v2.3.1+a1b2c3d.run-8841 — retrain on Q3 fraud labels, fixes leaky feature",
)
client.set_model_version_tag("fraud-scorer", "14", "semver", "2.3.1")
client.set_model_version_tag("fraud-scorer", "14", "git_sha", "a1b2c3d")
dev → automated on every merge to main; no gate.staging → requires passing offline eval thresholds and a schema
compatibility check against the current production model.production → requires a human approval or an automated canary result
(see model-serving-and-scaling
for canary/shadow rollout mechanics) plus monitoring hooks already wired
up (see
model-monitoring-and-drift-detection).Symptom: Two engineers each retrain and register a model with the same version tag, and it's unclear which one is actually serving. Fix: Make version identifiers include an immutable, unique component (registry auto-increment ID or content hash) in addition to the human-assigned semver, and make the registry (not a spreadsheet or Slack message) the single source of truth.
Symptom: A model scores well in offline evaluation but performs
differently in production (training/serving skew) — often because the
serving code reimplements feature preprocessing slightly differently than
the training code.
Fix: Package the preprocessing/feature transformation logic as part of
the versioned artifact (e.g. a sklearn.Pipeline, a transformers
tokenizer config, or an ONNX graph with preprocessing baked in) so training
and serving execute the identical code path, not a reimplementation.
Symptom: A bad model is promoted to production and the team spends
30+ minutes locating the previous good artifact to roll back.
Fix: Never delete or overwrite a previous production registry entry on
promotion — archive it instead, and keep a documented one-command rollback
procedure (e.g. mlflow models transition-stage back to Production) that
has been tested, not just written down.
Symptom: An exported ONNX/TorchScript model gives different predictions than the original PyTorch/TensorFlow model on the same input. Fix: Always run a numerical parity check (allclose on a batch of real or representative inputs) between the training-time model and the exported artifact as a required step before registering; treat a failed parity check as a blocking packaging failure, not a warning.
Symptom: Someone runs a "cleanup" script that deletes registry versions older than N days, and it turns out a currently-serving canary was pointing at one of them. Fix: Never treat registry deletion as routine housekeeping. Warn explicitly before any deletion of registered model versions or their underlying artifacts; prefer archiving/soft-delete with a retention policy, and check active deployment references before any hard delete.
A team maintains a fraud-scoring model, fraud-scorer, retrained weekly.
run-8841 (tracked per
experiment-tracking) completes with
AUC 0.912 on the held-out set, git SHA a1b2c3d, trained on data snapshot
s3://data-lake/fraud/snapshots/2026-07-20.fraud-scorer version 14, tagged
semver=2.3.1, git_sha=a1b2c3d, data_snapshot=2026-07-20, stage None.Staging after confirming:
AUC ≥ 0.90 (gate threshold), inference schema matches production's input
contract, and p95 latency on a 1,000-row sample batch is ≤ 40 ms.Production; version 13 is moved to Archived
(not deleted). The serving layer (see
model-serving-and-scaling) is
configured to route 5% of traffic to version 14 as a canary for 24 hours
before full cutover.Archived to Production — a two-minute
action because the artifact and its metadata were never deleted.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mlops, model-registry, model-versioning, deployment-pipeline
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin mlops-skills22 skills in this plugin
/complete-mlops-platform-deployment-on-aws-from-scratchSequences a complete, end-to-end MLOps platform deployment on AWS from a bare AWS Organization to a production-ready platform serving a first retrained model — AWS landing zone, the SageMaker-vs-EKS+Kubeflow platform decision (EKS+Kubeflow is the worked path here), GPU node pools via the NVIDIA GPU Operator, MLflow experiment tracking on S3, a Kubeflow Pipelines retraining DAG, model registry/packaging with gated promotion, KServe canary/shadow serving, and drift monitoring. This is an integration/orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "stand up an MLOps platform on AWS from scratch," "build the full ML training-to-serving pipeline on EKS/SageMaker," "give me the end-to-end sequence from AWS account to a retrained, monitored production model," or "decide between SageMaker and EKS+Kubeflow for our ML platform."
/complete-mlops-platform-deployment-on-azure-from-scratchSequences a complete, end-to-end MLOps platform deployment on Azure from a bare tenant to a production-ready platform serving a first retrained model — Azure landing zone, the Azure-ML-vs-AKS+Kubeflow platform decision (Azure ML is the worked path), GPU compute clusters/quota, MLflow-compatible experiment tracking, an Azure ML pipeline retraining DAG, Model Registry with gated promotion, managed online endpoints with traffic-split canary rollout, and data-drift monitoring. An integration/ orchestration skill that sequences existing tool-specific skills in the right order and flags handoff points — it does not restate their internals. Use when a user asks to "stand up an MLOps platform on Azure from scratch," "build the full ML training-to-serving pipeline on Azure ML/AKS," "give me the end-to-end sequence from Azure tenant to a retrained, monitored production model," or "decide between Azure ML and AKS+Kubeflow for our ML platform."
/complete-mlops-platform-deployment-on-gcp-from-scratchSequences a complete, end-to-end MLOps platform deployment on GCP from a bare Google Cloud Organization to a production-ready platform serving a first retrained model — GCP landing zone, the Vertex-AI-vs-GKE+Kubeflow platform decision (Vertex AI is the worked path), GPU quota and accelerator-backed custom training, Vertex AI Experiments tracking, a Vertex AI Pipelines retraining DAG, Model Registry with gated promotion, endpoints with traffic-split canary rollout, and Vertex AI Model Monitoring for drift. An integration/orchestration skill that sequences existing tool-specific skills in the right order and flags handoff points — it does not restate their internals. Use when a user asks to "stand up an MLOps platform on GCP from scratch," "build the full ML training-to-serving pipeline on Vertex AI/GKE," "give me the end-to-end sequence from GCP org to a retrained, monitored production model," or "decide between Vertex AI and GKE+Kubeflow for our ML platform."
/complete-mlops-platform-deployment-self-hosted-k8s-from-scratchSequences a complete, end-to-end, self-hosted and cloud-agnostic MLOps platform on any Kubernetes cluster — no managed ML service from any vendor — from a bare cluster to production: GPU node pools via the NVIDIA GPU Operator, a Kubeflow-vs-Ray orchestration choice, self-hosted MLflow-style tracking and registry on self-operated object storage and Postgres, on-cluster serving, and self-hosted drift monitoring. An integration/orchestration skill sequencing existing tool-specific skills in the right order, explicit about the added operational burden of self-hosting every layer versus a managed-cloud MLOps platform. Use when a user asks to "build a self-hosted MLOps platform on Kubernetes," "stand up MLflow and Kubeflow ourselves with no managed cloud ML service," "design a vendor-agnostic ML platform we can run on any cluster," or "give me the full sequence for a fully self-managed ML platform from bare cluster to production."
/data-and-model-lineageGuides tracking end-to-end lineage from raw data sources through feature computation, training runs, and model versions, to enable root-cause tracing, impact analysis, and compliance/audit answers. Use when the user asks to "trace where a feature/model came from", set up data/model lineage tracking, do impact analysis before changing an upstream table, answer an audit/compliance question about a model's training data, or debug a bad prediction back to its source.
/data-catalog-and-lineage-governance-datahub-amundsenGuides deploying and operating enterprise data catalog and governance tooling — DataHub or Amundsen — for discovering, tagging, classifying, and owning datasets, features, and models across an organization, including deprecation workflows that must check downstream consumers before deletion. Use when the user asks to "set up a data catalog", "make datasets/models searchable and discoverable", "tag PII/sensitive data", assign data ownership, install or configure DataHub or Amundsen, write an ingestion recipe, or safely deprecate/delete an old dataset or model artifact without breaking a consumer.
Other plugins' skills for the same job