MLOps and LLMOps
MLOps applies the discipline of DevOps to machine learning: every model is versioned, built by a repeatable pipeline, tested before release, deployed gradually, monitored, and can be rolled back. LLMOps is the same discipline for systems built on large language models, where the thing you change most often isn’t a trained model but a prompt, a retrieval configuration or a choice of hosted model.
The common idea: anything that changes what the system outputs is a release, and needs the same control as code.
Diagram
Section titled “Diagram”- A change to data, model, prompt or configuration is committed, never edited in production.
- A pipeline trains the model or assembles the prompt and configuration, and versions the result.
- The versioned artifact is evaluated against fixed test sets before it can be released.
- It is released gradually, first in shadow or to a small share of traffic.
- Production quality, drift and cost are monitored, and the findings feed the next change.
What gets versioned
Section titled “What gets versioned”| Classic ML | LLM systems |
|---|---|
| Training data snapshot | Retrieval index and the documents in it |
| Feature definitions | Prompt templates and system instructions |
| Model weights and hyperparameters | Choice of hosted model and its version |
| Training code | Tool definitions, chains and agent configuration |
| Evaluation results | Evaluation results, including the test set version |
If you can’t say exactly which version of each of these produced a given output, you can’t debug it, reproduce it or explain it to an auditor.
The pipeline
Section titled “The pipeline”Classic ML: data validation → feature engineering → training → evaluation → registration in a model registry → deployment. A feature store keeps feature definitions identical between training and serving, avoiding training-serving skew, where the model sees data in production computed differently from its training data.
LLM systems: prompt and configuration changes go through version control and review like code. The pipeline assembles the configuration, rebuilds the retrieval index if documents changed, runs the evaluation suite and publishes a versioned release.
The evaluation gate
Section titled “The evaluation gate”No change reaches production without passing an evaluation against fixed test sets, with thresholds agreed in advance. See evaluation and monitoring for what to measure. Keep a set of past failures as regression tests: every incident adds a case.
Deploying and rolling back
Section titled “Deploying and rolling back”- Shadow: the new version runs on real traffic, but its outputs aren’t used. Compare them with the current version.
- Canary: a small share of users gets the new version, with automatic rollback on quality or error metrics.
- A/B test: when the question is which version users prefer, not just whether the new one is safe.
- Rollback: previous versions stay deployable. For hosted models, pin a specific model version; don’t let a provider’s silent upgrade change your behavior.
Retraining and refresh
Section titled “Retraining and refresh”Classic models degrade as the world changes. Retrain on a schedule, or when monitoring shows drift, through the same pipeline. For RAG systems, the equivalent is keeping the index fresh: a document updated in the source should be re-indexed within an agreed time.
- Reproducible outputs and fast, safe rollback.
- Changes are reviewed and tested, not made live in a console.
- A clear record for audit and incident analysis.
- Real investment in pipelines, registries and test sets before the first feature ships.
- Evaluation sets need constant curation, and LLM evaluation is partly subjective.
When to use it
Section titled “When to use it”- Any model or LLM feature that customers or decisions depend on.
- As soon as more than one person changes prompts or models.
When to avoid it
Section titled “When to avoid it”- Throwaway experiments and notebooks. Apply the discipline when something is heading to production, not before.
Common pitfalls
Section titled “Common pitfalls”- Editing prompts in production through an admin screen, with no version or review.
- Floating model versions that change behavior when the provider updates them.
- Evaluation sets that leak into training data, which makes scores look better than reality.
- Monitoring infrastructure but not output quality: the system is up and answering badly.
Related patterns
Section titled “Related patterns”- Evaluation and monitoring of model output
- Model gateways and routing
- AI governance and audit trails
- Canary release
Further reading
Section titled “Further reading”- Google Cloud: MLOps, continuous delivery and automation pipelines in machine learning (opens in a new tab)
- Hidden technical debt in machine learning systems (opens in a new tab), the 2015 NeurIPS paper that described why ML systems are hard to maintain
Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.