MLOps & LLMOps / The Model Lifecycle
Automating the path from commit to deployment.
Reviewed by Yuvaraj
Continuous integration and continuous delivery automate the journey from a code change to a running system: tests run on every commit, the artifact is built, and a release becomes routine rather than a nerve-wracking event. The whole point is to catch breakage early and make shipping boring. For models this is harder, because the behavior you care about depends on three things that can each change independently, the code, the data, and the trained weights, and the reassurance that "it compiles and the unit tests pass" tells you nothing about whether the model is any good. Model CI/CD keeps the familiar pipeline and extends it with two things software pipelines never needed: data validation and a quality gate.
Ordinary CI validates code. A model pipeline has to validate more surface area.
Ask about this lesson, or about anything in AI. Answers cite the lessons they draw on.
Finished this lesson?
Mark it complete to earn XP, keep your streak, and schedule a review.
The quality gate is the heart of model CI. Instead of the binary "tests pass / fail", the pipeline runs the candidate model against a frozen evaluation set and blocks the merge or deploy if a key metric falls below either an absolute floor or the incumbent production model. Concretely: block if accuracy on the regression suite falls below 0.90, or if it drops more than one point versus the current production model, whichever bites first.
Aggregate accuracy is not enough. A model can improve overall while quietly getting worse for an important subgroup, so the gate should include behavioral and slice tests, accuracy on specific locales, new users, or high-value segments, not just the headline number. And because model evals are stochastic (sampling, non-determinism, small eval sets), a flaky gate that randomly passes or fails is worse than none: run the evaluation enough times, or on a large enough frozen set, that the metric is stable.
evaluate:
dataset: eval/regression_v3 # frozen, versioned
metrics:
accuracy:
min: 0.90 # absolute floor
no_regression_vs: production # must not drop > 1 point
slices: [locale_de, new_users] # must also hold per-slice
A model is reproducible only if its inputs are pinned, so the pipeline records the exact data version, code commit, hyperparameters, random seed, and container image alongside the artifact. With that lineage attached, any build can be recreated from scratch and any regression can be bisected, you can walk backward through data versions and commits to find the change that moved the metric. This is exactly what the model registry from the previous lesson is for: the registry holds the versioned weights, and the CI run stamps them with the metadata needed to trust and trace them.
| Stage | Software CI/CD | Model CI/CD adds |
|---|---|---|
| Validate | Lint + unit tests | + data validation (schema, ranges, leakage) |
| Build | Compile / package | + reproducible training run (pinned data, seed, env) |
| Test | Unit + integration | + quality gate on a held-out set |
| Release | Deploy binary | + register versioned artifact, gated promotion |
Common mistakes