Playbooks

MLOps & AI Production Operations: The 2026 Guide

An end-to-end guide to CI/CD and production operations for AI systems, covering the MLOps pipeline, tooling, cloud infrastructure, deployment and release patterns, monitoring, drift, LLMOps, cost optimization, and governance.


How I think about taking AI from a working notebook to something that runs reliably in production — the full path from commit to monitoring, and the decisions that matter along the way.

01 — DevOps vs MLOps: What’s Different

MLOps extends DevOps principles to machine learning — but ML systems have fundamentally different properties that traditional CI/CD wasn’t built for. Everything here assumes the architecture upstream of it is already settled; that groundwork is the AI architecture field guide.

Traditional DevOpsMLOps
What you versionCodeCode + data + model weights + hyperparameters + environment
What you testCorrectness (unit/integration)Correctness + accuracy + fairness + drift + latency
What degradesBugs (introduced by code changes)Bugs + model drift (performance degrades even without code changes, because real-world data shifts)
Deployment artifactContainer / binaryContainer + model weights + feature schema + serving config
RollbackRevert to last good containerRevert model version + verify feature compatibility + validate data pipeline
MonitoringLatency, errors, CPU, memoryAll the above + prediction quality + data distribution + feature drift + business KPIs

The fundamental difference: In software, code is the complete specification — if the code hasn’t changed, the behavior hasn’t changed. In ML, the data is part of the specification — the model can degrade silently even when no code changes, because the real-world data distribution shifted. This is why MLOps adds continuous training and continuous monitoring to the DevOps loops.

02 — The MLOps Pipeline (End-to-End)

The production MLOps pipeline:

Data ingestion (sources → lake)
  → Data validation (schema + quality)
  → Feature engineering (feature store)
  → Model training (GPU/TPU cluster)
  → Evaluation (metrics + tests)
  → Model registry (versioning)
  → CI/CD gate (approve / reject)
  → Deployment (container + endpoint)
  → Monitoring (drift + quality)
  → ⤴ Retrain

What each stage does

StageWhat happensKey tool(s)
Data ingestionCollect data from sources (DBs, APIs, streams, files) into storagePub/Sub, Kinesis, Airflow, dbt
Data validationSchema checks, null detection, distribution validation — reject bad data before it reaches trainingGreat Expectations, TFX Data Validation, Evidently
Feature engineeringTransform raw data into model features; store in feature store for consistency between training and servingFeast, Vertex AI Feature Store, SageMaker Feature Store
Model trainingRun training job on GPU/TPU cluster; track experiments, hyperparameters, metricsPyTorch/TF, MLflow, W&B, cloud training services
EvaluationCompare new model against baseline on held-out test set + fairness/bias checksMLflow, Evidently, custom eval harnesses
Model registryVersion and store the trained model with metadata, lineage, and lifecycle stage (staging → production)MLflow Model Registry, cloud registries
CI/CD gateAutomated tests pass → human approval (optional) → promote to productionGitHub Actions, GitLab CI, Jenkins, cloud pipelines
DeploymentPackage model into container, deploy to serving endpoint (real-time/batch/serverless)Docker, KServe, Seldon, cloud endpoints
MonitoringTrack prediction quality, data drift, latency, cost, business KPIs — trigger retraining when neededEvidently, Arize, Langfuse, Prometheus+Grafana

The 20/80 rule: Training a model is ~20% of the effort. The other 80% is testing, packaging, versioning, deploying, monitoring, and maintaining it. Teams that treat ML like one-off experiments instead of production software always fail at scale.

03 — CI/CD for ML: The Three Loops

Traditional DevOps has one CI/CD loop (code change → test → deploy). ML has three:

Loop 1 — Continuous Integration (code): code change → lint + unit tests → integration tests → data validation tests → model training tests (small subset)

Loop 2 — Continuous Training (model): new data arrives or drift detected → feature pipeline runs → training job executes → evaluation against baseline → register new model version

Loop 3 — Continuous Deployment + Monitoring: promote model to staging → canary/shadow deploy → monitor quality + drift → auto-rollback if degraded → trigger retraining if drift exceeds threshold

Google’s MLOps maturity levels

LevelDescriptionAutomation
Level 0Manual — data scientists train in notebooks, hand-off model as a file, manual deploymentNone
Level 1ML pipeline automation — automated training pipeline, but deployment is still manual or semi-autoTraining automated
Level 2CI/CD for ML — automated testing, automated deployment, continuous training triggered by data/drift, monitoring closes the loopFull automation

Target: Most teams start at Level 0. The goal is Level 2 — where new data automatically triggers retraining, evaluation gates ensure quality, and deployment is hands-free with auto-rollback. Level 1 (automated training, manual deploy) is a practical intermediate milestone.

04 — DevOps / MLOps Tool Catalog

Organized by function. Pick one tool per row — don’t try to use all of them.

Core DevOps tools (you still need these)

FunctionToolsNotes
Version controlGit (GitHub, GitLab, Bitbucket)Foundation for everything — code, configs, IaC
CI/CD runnerGitHub Actions, GitLab CI, Jenkins, CircleCIGitHub Actions is the default for most teams in 2026
ContainersDocker, PodmanContainerize everything: training, serving, pipelines
Container orchestrationKubernetes (GKE, EKS, AKS), Docker ComposeK8s for production scale; Compose for local dev
Container registryArtifact Registry (GCP), ECR (AWS), ACR (Azure), Docker HubStore training + serving container images
Infrastructure as CodeTerraform, Pulumi, CloudFormation, BicepTerraform is cross-cloud default; use cloud-native for single-cloud
Secrets managementVault, Secret Manager (GCP/AWS), Azure Key VaultNever hardcode API keys, model weights paths, DB creds

ML-specific tools

FunctionToolsChoose when
Experiment trackingMLflow, Weights & Biases, Comet, NeptuneMLflow (open-source, self-host) is the default; W&B for teams wanting managed + collaboration
Data versioningDVC, LakeFS, Delta LakeDVC for small teams; LakeFS/Delta for lake-scale versioning
Feature storeFeast, Tecton, Vertex AI/SageMaker built-inFeast (open-source) or cloud-native for managed simplicity
Pipeline orchestrationKubeflow Pipelines, Airflow, Prefect, Dagster, cloud pipelinesAirflow for general orchestration; Kubeflow for K8s-native ML pipelines
Model registryMLflow Model Registry, cloud registriesMLflow for portability; cloud-native for tight integration
Model servingvLLM, TGI, KServe, Seldon Core, BentoML, cloud endpointsvLLM/TGI for LLM serving; KServe for K8s; cloud endpoints for managed
Data quality / validationGreat Expectations, Evidently, PanderaGreat Expectations for schema; Evidently for drift + quality reports
Model formatONNX, SafeTensors, GGUF, TorchScriptONNX for portability; SafeTensors for safe LLM weights; GGUF for local inference

LLM-specific tools

FunctionToolsChoose when
LLM observabilityLangfuse, LangSmith, Arize Phoenix, HeliconeLangfuse (open-source, self-host); LangSmith (LangChain teams); Arize (RAG debugging)
LLM gateway / proxyLiteLLM, Portkey, TrueFoundry Gateway, customMulti-provider routing, failover, cost tracking, rate limiting
Prompt managementLangfuse, PromptLayer, Humanloop, AgentaVersion prompts like code; A/B test prompt variants
LLM evaluationDeepEval / Confident AI (its managed platform), RAGAS, custom judgesDeepEval / RAGAS for RAG eval; LLM-as-judge for generation quality
Vector databaseQdrant, Pinecone, Weaviate, Chroma, pgvectorQdrant (greenfield); pgvector (existing Postgres); Pinecone (managed)

Starter stack (if you’re choosing today): Git + GitHub Actions + Docker + Terraform + MLflow + Evidently + vLLM + Langfuse + Qdrant covers 90% of production needs for both traditional ML and LLM systems. Add Kubernetes and Feast as you scale. Avoid tool sprawl — one tool per function.

05 — Cloud Infrastructure Selection

Training infrastructure

OptionBest forTrade-off
Cloud managed (SageMaker/Vertex/Azure ML)Most teams — spin up training, tear down after20–40% premium over raw VMs but zero cluster management
Raw GPU VMs + custom stackTeams with MLOps expertise, steady high utilizationCheapest per hour but you manage scaling, fault tolerance, storage
TPU pods (GCP only)Large-scale training (>10B params), researchBest $/FLOP for large models; requires JAX/XLA expertise
Spot/preemptible instancesFault-tolerant training (checkpoint frequently)60–91% cheaper but can be interrupted; use with checkpointing

Inference infrastructure

PatternLatencyCostUse when
Real-time endpoint (always-on)Low (ms)Steady — pay even at zero trafficUser-facing, low-latency requirements
Serverless inference (scale-to-zero)Higher (cold start)Pay per requestDev/staging, low-traffic, variable demand
Batch inferenceHoursCheapest per predictionOvernight scoring, recommendations, ETL
Multi-model endpointLowShared infra (up to 80% savings)Many models with moderate traffic each
Edge inferenceLowestDevice costOffline, privacy-sensitive, real-time on-device

Infrastructure decision tree

QuestionAnswer
User-facing, <100ms latency required?Real-time endpoint (GPU)
Variable traffic, can tolerate cold starts?Serverless inference
Bulk scoring, overnight, not time-sensitive?Batch inference (cheapest)
Many models, moderate traffic each?Multi-model endpoint
Privacy / offline / on-device?Edge (quantized model)

Trade-off — managed vs self-hosted serving: Managed endpoint (SageMaker/Vertex/Azure ML) = autoscaling, monitoring, blue-green deployment built in — but higher per-hour cost and less control. Self-hosted (vLLM on K8s) = cheapest at scale, full control over batching/quantization — but you build your own scaling, health checks, and rollback. Start managed; migrate to self-hosted when monthly inference spend exceeds ~$10K and you have dedicated ops capacity.

06 — Model Deployment Patterns

The model packaging and deployment pipeline:

Trained model (from registry)
  → Containerize (Docker + serving runtime)
  → Push to registry (ECR / Artifact Registry)
  → Deploy to endpoint (real-time / batch / serverless)
  → Health check (smoke test + canary)
  → Live traffic

Serving runtimes for LLMs

RuntimeBest forKey feature
vLLMProduction LLM inference — the 2026 defaultPagedAttention, continuous batching, OpenAI-compatible API, ~2–4x throughput vs naive
TGI (Text Generation Inference)Hugging Face models, production servingTensor parallelism, watermarking, streaming
OllamaLocal development and testingOne-command local LLM serving; not for production
TensorRT-LLMMaximum NVIDIA GPU throughputNVIDIA-optimized; best throughput but NVIDIA-only
Cloud endpointsManaged, zero-ops servingSageMaker/Vertex/Azure ML handle everything

07 — Release Strategies for Models

StrategyHow it worksUse when
Shadow deployNew model receives real traffic but its predictions aren’t served to users — only logged for comparisonFirst deployment of a new model; validate on real data without risk
Canary releaseRoute 5–10% of traffic to new model; watch metrics; gradually increaseModel updates; limit blast radius
Blue/greenTwo full environments; instant switch + instant rollbackCritical models where fast rollback is essential
A/B testingRoute traffic by user segment; measure business outcomes over weeksCompeting model architectures; product experiments
Multi-armed banditDynamically shift traffic toward the better-performing model variantRecommendation / ranking models where real-time optimization matters

ML-specific release difference: In software, a canary catches code bugs. In ML, a canary catches accuracy degradation under real traffic — which is much harder to detect because the model returns HTTP 200 even when its predictions are wrong. You need quality metrics (accuracy, latency percentiles, business KPIs) in your canary monitoring, not just error rates.

08 — Monitoring & Observability

ML monitoring has four layers — each catches different failure modes.

Layer 1 — Infrastructure monitoring (DevOps standard): CPU/GPU utilization, memory, latency (p50/p95/p99), error rate, throughput (QPS), disk/network

Layer 2 — Model performance monitoring (ML-specific): prediction accuracy, precision / recall / F1, confidence distribution, prediction vs actual (when labels arrive)

Layer 3 — Data / feature monitoring (drift detection): input feature distributions, data schema validation, missing value rates, statistical drift tests (PSI, KL, JS)

Layer 4 — Business KPI monitoring (the only one that really matters): conversion rate, revenue impact, customer satisfaction, false positive cost, escalation rate

Monitoring tool stack

LayerOpen-sourceManaged
InfrastructurePrometheus + GrafanaDatadog, New Relic, CloudWatch, Cloud Monitoring
Model performanceEvidently, MLflowArize, WhyLabs, SageMaker Model Monitor, Vertex AI Model Monitoring
Data/driftEvidently, Great ExpectationsArize, WhyLabs, cloud monitoring
Business KPIsGrafana dashboards, custom metricsLooker, Power BI, Datadog Business Monitoring
LLM-specificLangfuse, Arize PhoenixLangSmith, Helicone, Confident AI

Common mistake: Teams monitor Layer 1 (infrastructure) and think they’re covered. The model returns HTTP 200 even when predictions are garbage. Infrastructure can be perfectly healthy while the model is silently failing. You need all four layers.

09 — Model Drift & Retraining

Three types of drift

TypeWhat shiftsExampleDetection
Data drift (covariate)Input feature distributions changeCustomer demographics shift; new product categoriesStatistical tests (PSI, KL divergence, JS distance) on input features
Concept driftRelationship between inputs and outputs changesWhat “spam” looks like evolves; customer preferences shiftMonitor prediction accuracy vs actual labels (delayed)
Prediction driftOutput distribution changesModel suddenly predicts mostly one classMonitor output distribution (class balance, score histogram)

Retraining strategies

Whichever trigger you pick, what actually runs is a training job — the techniques, data curation, and eval gates behind it are in model training, fine-tuning and evaluation.

StrategyWhen to use
Scheduled (time-based)Stable environments; retrain weekly/monthly regardless. Simple, predictable.
Drift-triggeredWhen drift metrics cross a threshold → automatically kick off retraining pipeline
Performance-triggeredWhen accuracy/business KPI drops below a threshold (requires ground truth labels)
Continuous trainingModels retrain on every new data batch (streaming or micro-batch). Most mature but complex.

Trade-off — retrain frequency: More frequent = more current model, less drift — but more compute cost, more operational complexity, and more risk of training on noisy/insufficient data. Less frequent = cheaper, simpler — but model degrades between retrains. Match frequency to data volatility: fraud models retrain weekly, product recs daily, medical models with regulatory review quarterly.

10 — LLMOps: What’s Different for LLMs

LLMs add new concerns that traditional MLOps doesn’t cover well. Think of LLMOps as an extension layer.

ConcernTraditional MLOpsLLMOps (what’s new)
What you versionCode + data + model weights+ prompts (system prompt, few-shot examples, templates)
TestingAccuracy metrics on test set+ eval harnesses (faithfulness, hallucination, safety, tool-use accuracy)
Deployment artifactContainerized modelOften just API calls to a provider + prompt config — no weights to deploy
Cost modelCompute hours for training + inference+ per-token costs that scale with prompt length and output length
Failure modeAccuracy drops silently+ hallucination (confidently wrong), prompt injection, tool misuse
MonitoringFeature drift, accuracy+ semantic drift (embedding space shifts), prompt regression, retrieval quality

LLMOps pipeline additions

Prompt versioning (track + A/B test)
  → LLM evaluation (judge + metrics)
  → Prompt caching (90% cheaper reads)
  → Model gateway (route + failover)
  → Guardrails (input/output filters)
  → LLM observability (traces + quality scores)

LLM observability: what to monitor

  • Quality metrics: faithfulness (is the output grounded in context?), relevance (does it answer the question?), safety (no toxicity/PII/bias).
  • RAG metrics: retrieval precision, context relevance, groundedness — is the retrieval pipeline returning useful chunks?
  • Operational metrics: tokens per request, time to first token (TTFT), cache hit rate, cost per session, agent step count.
  • Drift metrics: embedding drift (semantic shift in queries/outputs), prompt regression (quality drops after prompt edit), model version regression.
  • Agent metrics: tool selection accuracy, planning quality, loop count, escalation rate.

The key insight: LLMs fail silently — a hallucinated answer returns HTTP 200. Infrastructure monitoring cannot catch this. You need quality scoring on every trace (or a sample). The best practice is to run an LLM-as-judge on 5–10% of production traces and alert on statistically significant quality drops.

11 — Cost Optimization

LeverSavingsHow
Model right-sizing60–80%Use Haiku for routing, Sonnet for main work, Opus only for hardest tasks
Prompt caching90% on cached readsCache static system prompts, tool definitions, reference docs. Default TTL is 5 minutes; a longer option exists at a higher write premium, which pays off only for traffic bursty enough to otherwise let the cache expire
Batch API50%Async processing for non-real-time workloads (24-hr window)
Spot/preemptible GPUs60–91%For training jobs with checkpointing; not for serving
Quantization2–4x throughputINT8/INT4 quantization reduces model size; slight accuracy trade-off
Token budgetsVariableSet per-user/per-team/per-project token limits; alert on anomalies
Progressive summarizationVariableCompress older conversation turns; reduces per-request token count
Committed/reserved capacity30–70%SageMaker Savings Plans, GCP CUDs, Azure EA for steady-state workloads
Auto-scaling + scale-to-zeroVariableServerless inference for dev/staging; autoscale production endpoints

Measure cost per outcome, not cost per token: A cheaper model that gets the answer wrong 30% of the time costs more than an expensive model that’s right 95% of the time — because you pay for retries, escalations, and lost customers. Track cost per successful resolution, not just token spend.

12 — Security & Governance

  • Version everything: code (Git), data (DVC/LakeFS), models (MLflow registry), prompts (Langfuse/version control), infrastructure (Terraform). If you can’t reproduce it, you can’t audit it.
  • Access control: RBAC on model registry (who can promote to production?), IAM on training resources, API auth on serving endpoints.
  • Data lineage: track which data trained which model, which model is serving which endpoint. Metadata stores (MLflow, cloud registries) maintain this.
  • Audit trail: log every training run, evaluation result, deployment, and rollback. Required for EU AI Act, HIPAA, SOC2.
  • Model cards: document each model’s purpose, training data, known limitations, fairness evaluations, and intended use. This is both good practice and increasingly required by regulation.
  • Supply chain security: scan model weights for trojans (backdoors injected during training). Don’t download untrusted models from the internet without verification. Use SafeTensors format, not pickle.
  • Prompt injection defense: input validation + output verification + separation of trusted/untrusted content + guardrail hooks.

The EU AI Act: High-risk AI systems (Annex III) must demonstrate: transparency, explainability, human oversight, data governance, accuracy/robustness testing, and a conformity assessment. Note the timeline has shifted — the May 2026 “Digital Omnibus” postponed the high-risk (Annex III) obligations from August 2, 2026 to December 2, 2027, so the near-term compliance deadline is no longer 2026. That’s more runway, not a reprieve: building MLOps pipelines that version, test, monitor, and audit is how you demonstrate compliance, and it’s far easier to bake in now than to retrofit later. If your pipeline can’t reproduce a training run and explain a prediction, you won’t be EU AI Act compliant when the obligations land.

13 — Trade-off Master Reference

DecisionOption AOption BDefault
Managed platform vs self-hostedSageMaker / Vertex / Azure MLRaw VMs + custom stackManaged unless >$10K/mo + dedicated MLOps team
Training on spot vs on-demandSpot (60–91% off)On-demand (guaranteed)Spot with checkpointing for training; on-demand for serving
Real-time vs batch inferenceReal-time endpointBatch transformReal-time for user-facing; batch for scoring/ETL
Model serving: vLLM vs managedSelf-hosted vLLM on K8sCloud managed endpointManaged to start; self-hosted when scale justifies ops cost
Experiment trackingMLflow (open-source)W&B (managed)MLflow for portability and cost; W&B for team collaboration
Pipeline orchestrationAirflow / PrefectCloud-native (Vertex/SageMaker Pipelines)Cloud-native for single-cloud; Airflow for multi-cloud
Monitoring: open-source vs managedPrometheus + Grafana + EvidentlyDatadog + ArizeOpen-source for cost; managed for faster setup
LLM observabilityLangfuse (self-hosted)LangSmith / Arize (managed)Langfuse for data sovereignty; managed for speed
Retraining triggerScheduled (time-based)Drift-triggered (automated)Scheduled to start; drift-triggered at maturity (Level 2)
Model release strategyBlue/green (instant rollback)Canary (gradual rollout)Shadow first → canary for ongoing updates → blue/green for critical
IaC toolTerraform (multi-cloud)CloudFormation / Bicep (cloud-native)Terraform unless deeply single-cloud
Container orchestrationKubernetesServerless (Cloud Run / Lambda)K8s for complex serving; serverless for simple functions
CI/CD platformGitHub ActionsGitLab CI / JenkinsGitHub Actions is the 2026 default; Jenkins for legacy/complex
Data versioningDVC (lightweight)LakeFS / Delta (lake-scale)DVC for small teams; LakeFS when data exceeds TB scale

Built from current industry practice and production patterns. Independent reference — not affiliated with any vendor. Tools and pricing change rapidly; verify before procurement decisions.

Riddam Jain

Staff Engineer · Amsterdam

I write about cloud and application architecture, AI, and leading engineers. If this was useful, let's connect.