This MLOps pipeline design guide explains how to move a machine learning model from a notebook to production without losing track of what changed along the way. The central question is what a good pipeline actually contains, and the answer is short: versioned data, reproducible training, automated tests, a model registry, a controlled rollout and monitoring that feeds back into retraining. If any of those pieces is missing, the pipeline is a script with a fancy name.
Most ML failures are pipeline failures, not model failures. A model that cannot be reproduced, a dataset nobody versioned, or a deploy nobody can roll back will cause more damage than a slightly weaker algorithm. This guide walks through each stage, compares the main tools, and gives you a design checklist you can use on your next project.
Key takeaways
- A pipeline is a loop: data, training, testing, registry, deployment, monitoring, retraining.
- Version everything: code, data, features and model artefacts, or you cannot reproduce a result.
- Keep the pipeline simple at first; add orchestration only when manual steps start failing.
- Gate promotion on tests, not on habit, and make every rollout reversible.
- Monitor data and predictions, not just servers, because model quality decays silently.
What an MLOps pipeline is, and what it is not
An MLOps pipeline is an automated, repeatable path from raw data to a model serving predictions in production, with a feedback loop back to retraining. Each run records exactly which code, data and settings produced which model. When a prediction goes wrong, you can trace it back to its source in minutes.
It is not a single tool. No product covers the whole loop well, so a pipeline is always a combination: an orchestrator runs the steps, a tracker records experiments, a registry stores approved models, and a serving layer delivers predictions. Understanding the stages matters more than memorising tool names, because tools change and the stages do not.
It is also not a training script with a scheduler attached. Scheduling is one small part. The hard parts are data validation, reproducibility, testing, promotion rules and monitoring, and they deserve most of your design effort.
The six stages of a working pipeline
Every mature pipeline has the same six stages, even if the tools differ. Design each one deliberately, and the pipeline holds together. Skip one, and the gap shows up at the worst possible moment.
1. Data ingestion and validation
The pipeline starts by pulling data from its sources and checking it before anything trains on it. Validation means checking row counts, schema, missing values and value ranges against expectations. Bad data caught here costs minutes; bad data caught after deployment costs customers.
Store the validated data with a version or a hash so a later run can reproduce the exact input. Data versioning tools such as DVC tie dataset versions to Git commits, which makes this straightforward.
Best for: teams whose data changes often, or where a silent schema change could break a model.
2. Feature engineering
Features are the inputs a model actually learns from, and the same features must be computed identically in training and in production. A feature store solves this by holding one definition of each feature and serving it to both sides. Without one, training-serving skew creeps in: the model sees different numbers live from the ones it learned on, and accuracy falls for no obvious reason.
Keep feature logic in versioned code, not in notebooks. Notebooks are fine for exploration, but a pipeline step should be a tested, reviewable function.
Best for: any team serving models in real time, where training and serving must agree exactly.
3. Training and experiment tracking
Training runs should be launched by the pipeline, not by hand, with settings and results logged automatically. Experiment tracking records the parameters, metrics and artefacts of every run, so the team can compare attempts and pick a winner with evidence instead of memory.
MLflow is the most widely used open-source tracker and registry, and its 3.x releases made logged models first-class objects with a clearer lifecycle. Log every run, even the failed ones, because a failed run is still evidence about what does not work.
Best for: teams running many experiments who need to know exactly which run produced the model in production.
4. Model evaluation and testing
Before a model can be promoted, it must pass tests. That means accuracy or quality metrics on a held-out set, checks for bias across important groups, robustness tests on edge cases, and a comparison against the model currently in production. A model that beats the old one on average but fails badly on one customer segment should not ship.
Automate these tests in the pipeline so promotion is a decision based on results, not on a developer’s confidence. The test suite is part of the product, and it should be reviewed as carefully as model code.
Best for: regulated or customer-facing models, where a bad release has real consequences.
5. Registry and promotion
The model registry is the single place where approved models live, each with a version, a stage such as staging or production, and a link back to the run and data that made it. Promotion moves a model from staging to production only when the tests pass and a human or a rule approves it. Nothing should reach production from a laptop.
Promotion rules are a governance decision, not a technical one. Decide who can approve, what evidence is required, and how long a model can stay in production before it must be revalidated.
Best for: organisations that need an audit trail for every model serving customers.
6. Deployment and monitoring
Deployment puts the registered model behind an endpoint, usually with a canary or blue-green rollout so a bad version reaches few users first. Monitoring then watches three things: the infrastructure, the data coming in, and the predictions going out. Data drift and prediction drift are the early warnings that a model is going stale.
When monitoring flags a problem, the pipeline should make retraining easy: the same steps, the same code, fresh data. That feedback loop is what turns a one-off deploy into a living system, and it is the subject of our guide to the AI agent lifecycle, which covers the full journey from design to retirement.
Best for: every production model, because an unmonitored model is a model you have already lost track of.

Choosing an orchestrator
The orchestrator runs the pipeline steps in order, retries failures and records what happened. The choice depends on where you run and how complex your graphs are, and the CI/CD for AI guide explains how it connects to your existing delivery process.
| Tool | Style | Strength | Watch out for |
|---|---|---|---|
| GitHub Actions / GitLab CI | CI runner | Already in place, simple | Struggles with long, heavy jobs |
| Apache Airflow | Scheduler | Mature, huge ecosystem | Heavy to operate |
| Kubeflow Pipelines 2.x | Kubernetes-native | Scales with containers | Needs Kubernetes expertise |
| Prefect | Python-native | Easy to write and debug | Smaller ecosystem than Airflow |
| Argo Workflows | Kubernetes-native | Strong for container DAGs | YAML-heavy configuration |
Small teams should start with their existing CI runner and move to a dedicated orchestrator only when pipelines outgrow it. Kubernetes-native tools such as Kubeflow Pipelines 2.x and Argo Workflows suit teams already running Kubernetes, while Airflow remains the default for scheduled batch work.
Best for: GitHub Actions for small teams, Airflow for scheduled batch pipelines, and Kubeflow Pipelines for Kubernetes-native ML platforms.
Design principles that keep pipelines healthy
Five principles separate pipelines that last from pipelines that collapse under their own weight. They are simple to state and worth enforcing in code review.
First, make every step idempotent, so rerunning it produces the same result. Second, keep steps small and single-purpose, so a failure points at one thing. Third, pass data through files or object storage, not through hidden state, so any step can be rerun alone.
Fourth, log everything a future debugger will need: inputs, outputs, versions and timings. Fifth, treat pipeline code like application code, with tests, reviews and version control.
These principles also make the pipeline portable. A team that follows them can move from one orchestrator to another without rewriting the logic, because the logic lives in small, testable steps.
Data and lineage: the part teams skip
Lineage is the record of where each model came from: which dataset, which features, which code and which run. Without it, an audit question or a production incident becomes a guessing game. With it, you can answer in minutes.
Our guide to data lineage tracking shows how to record it without slowing the team down.
Start simple: log the dataset hash, the code commit and the feature versions with every run, and store them alongside the model in the registry. That alone covers most audit and debugging needs.
Pipeline design checklist
Use this checklist when designing or reviewing a pipeline. Every unchecked item is a risk you are accepting knowingly.
- Data versioned. Every run records the exact dataset version or hash it trained on.
- Features shared. Training and serving compute features from the same definitions.
- Runs tracked. Parameters, metrics and artefacts are logged for every run, good or bad.
- Tests automated. Promotion requires passing quality, robustness and comparison tests.
- Registry gated. Only registered, approved models reach production, never laptop artefacts.
- Rollout reversible. A bad deploy can be rolled back by shifting traffic, not by redeploying.
- Monitoring live. Data drift, prediction drift and infrastructure health are all watched.
- Retraining easy. The same pipeline reruns on fresh data with no manual steps.
Common mistakes to avoid
The most common mistake is automating a mess. If the manual process is unclear, automating it produces a faster mess. Map the process on paper first, then automate it step by step.
Another mistake is letting notebooks become pipeline steps. Notebooks are wonderful for exploration and terrible as production components: they hide state, resist testing and make reruns unreliable. Convert the logic to tested code first.
A third mistake is monitoring servers but not models. CPU and memory dashboards will not tell you that incoming data has changed or that predictions have drifted.
Add data and prediction monitoring from the start, and set alerts that reach a human. The data pipeline architecture guide covers the data side of this in more depth.
Frequently asked questions
How long does it take to build an MLOps pipeline?
A minimal pipeline for one model can take a few days: data validation, training, a registry and a simple deploy. A full platform with feature stores, drift monitoring and automated retraining is a multi-month effort. Start with the minimal version and grow it.
What is the difference between MLOps and DevOps?
DevOps covers code, builds and deploys. MLOps adds data, features, models and their lifecycle to the same discipline. The practices overlap, but ML adds versioning and monitoring problems that code alone does not have.
Which tool should I choose for orchestration?
Use what your team already runs. A CI runner is fine for small pipelines, Airflow for scheduled batch work, and Kubeflow Pipelines for Kubernetes-native platforms. The orchestrator matters less than versioned data and automated tests.
How often should models be retrained?
Retrain when monitoring shows drift or falling quality, or on a schedule set by how fast your data changes. Either way, retraining should be a pipeline run, not a manual project.
What is continuous training?
Continuous training means the pipeline retrains and revalidates models automatically when new data arrives or drift is detected. It is the ML equivalent of continuous delivery.
Final thoughts
A good MLOps pipeline is boring in the best sense: the same steps run the same way every time, every artefact is traceable, and a bad model cannot reach production by accident. Build the six stages, version everything, gate promotion on tests, and monitor what the model actually does.







