---
title: MLOps and LLMOps
url: https://gurkanozkan.ai/learn/topics/mlops/
markdown: https://gurkanozkan.ai/learn/topics/mlops.md
kind: topic
tracks:
  - ML engineering
  - Applied LLM
  - AI leadership
json: https://gurkanozkan.ai/api/learn/topics/mlops.json
---

# MLOps and LLMOps

MLOps is the engineering that keeps models correct after the notebook: reproducible training, a single feature path for training and serving, automated validation gates, safe rollouts, monitoring with delayed labels, and retraining that is triggered by evidence. LLMOps adds prompt and model versioning, eval-in-CI for non-deterministic outputs, tracing of multi-step agents (OpenTelemetry's GenAI conventions are the emerging shared vocabulary), provider upgrades you do not control, cache-aware serving for self-hosted open models, and cost tracking per request. Regulation now reaches the lifecycle too: EU AI Act duties for general-purpose model providers have applied since August 2025, and high-risk obligations follow from December 2027. Interviewers probe whether you have operated a model in production: what you version, what blocks a deploy, how you detect silent failure and what you do at 9 am when a metric triples.

## Key concepts

### Training–serving skew and feature stores

Skew arises when features are computed differently offline and online: duplicated transformation code, different sources or freshness, time zones, unit or default-value bugs, and point-in-time leakage in training joins. Prevent it with one transformation definition, logging served features and training on those logs, and point-in-time-correct joins; a feature store provides an offline store for training sets and a low-latency online store backed by the same definitions.

### Reproducibility and the model registry

To rebuild a model months later you need the code commit, data snapshot or query plus timestamp, feature definitions, config and hyperparameters, environment (container digest, library versions), random seeds and hardware notes. A registry stores numbered model versions with lineage to the run that produced them, evaluation results, tags and mutable aliases such as 'champion', which is what deployment references. For LLM applications the versioned unit is the whole app (code commit, prompts, model snapshot, tool and retrieval config); MLflow 3's LoggedModel, for example, groups that version's traces and evaluation results together.

### CI/CD/CT for ML

Beyond unit tests, an ML pipeline validates data (schema, ranges, null rates, distribution shifts), validates the model (offline metrics against the current champion on fixed and recent sets, slice metrics, fairness, latency and size budgets) and tests the serving contract. Google's maturity levels run from manual (level 0) to automated continuous training (level 1) to automated CI/CD of the pipeline itself (level 2).

### Deployment strategies

Shadow mode scores live traffic without acting, which catches crashes, latency and skew at zero user risk but cannot measure outcomes. A canary sends a small share of real traffic with automated rollback on guardrails. An A/B or champion–challenger test measures causal business impact but needs enough traffic and time. Blue–green keeps the old version warm for instant rollback.

### Monitoring with delayed or missing labels

Monitor in layers: service health (latency, errors), inputs (schema, missingness, drift via PSI or KS tests), outputs (score distribution, decline or escalation rates) and, when labels arrive, quality (AUC, calibration, precision at the operating threshold). When labels lag by weeks, as with chargebacks, output and input drift are the early warning and you backfill true performance later by cohort. LLM applications rarely get labels at all, so trace every request (model calls, retrieval, tool calls, agent steps), score a sample of production traces with validated LLM judges and human review, and watch token use, refusals, fallbacks and the topic mix of inputs as drift signals.

### Retraining cadence

Measure decay by backtesting performance against model age, then compare the cost of decay with the cost of a retrain-and-validate cycle. Scheduled retraining is simple; drift- or performance-triggered retraining is cheaper but needs trustworthy triggers. Every automatic retrain must pass the same gates as a manual release, with automatic rollback.

### LLMOps specifics

Version prompts (in a prompt registry with rollback), tool schemas, retrieval config and model IDs together, and pin dated model snapshots. Eval-in-CI must cope with non-determinism: fixed temperature where possible, several samples per item, thresholds on pass rate with confidence intervals and per-slice regression checks, and LLM judges checked against human labels before they gate a deploy. A gateway centralises keys, routing, fallbacks, rate limits, caching and per-feature cost and token accounting; for self-hosted open models a plain round-robin Service is a poor balancer, so LLM-aware routers (the Kubernetes Gateway API Inference Extension, llm-d) pick replicas by queue depth, memory, loaded LoRA adapters and prefix-cache hits.

### Incident response for model-driven failures

First stop the harm (roll back, raise or lower a threshold, fall back to rules), then diagnose by checking what changed: deploys, upstream data, feature pipelines, traffic mix and seasonality. Hold a blameless postmortem and turn the root cause into a new test, monitor or gate.

## Worked examples

### Population stability index for a drifting feature

A credit model's 'months at address' feature was binned into quartiles on training data (25% each). This week's traffic falls into the bins as 10%, 20%, 30% and 40%. Compute PSI and decide what to do.

**Solution**

PSI = Σ (actualᵢ − expectedᵢ) × ln(actualᵢ / expectedᵢ)

| bin | expected | actual | (a − e) × ln(a/e) |
|---|---|---|---|
| 1 | 0.25 | 0.10 | (−0.15) × ln 0.4 = 0.1374 |
| 2 | 0.25 | 0.20 | (−0.05) × ln 0.8 = 0.0112 |
| 3 | 0.25 | 0.30 | 0.05 × ln 1.2 = 0.0091 |
| 4 | 0.25 | 0.40 | 0.15 × ln 1.6 = 0.0705 |

**PSI ≈ 0.228.** Common credit-risk rules of thumb: below 0.1 stable, 0.1–0.25 moderate shift,
above 0.25 major shift. So: investigate, do not auto-retrain blindly.

Next steps: check whether a pipeline change (new default value, unit change) caused it, which
would be a bug to fix rather than real drift; if the population genuinely changed (a new marketing
channel), check score distribution and early-label proxies by segment, then decide on retraining.
Note PSI is a symmetrised KL divergence, so it is sensitive to sparse bins: add a small floor.


### Choosing a retraining cadence from a decay backtest

Backtests show a fraud model loses about 0.003 AUC per week after training. Each 0.01 AUC is worth about £10,000 per week in fraud losses. A retrain-validate-deploy cycle costs £5,000 (compute plus review time). How often should you retrain?

**Solution**

With retraining every T weeks the AUC loss is a sawtooth from 0 to 0.003T, average **0.0015T**.

Weekly decay cost = (0.0015T / 0.01) × £10,000 = **£1,500 × T**

Weekly retraining cost = **£5,000 / T**

Total C(T) = 1,500T + 5,000/T. Setting dC/dT = 1,500 − 5,000/T² = 0 gives
T* = √(5,000 / 1,500) ≈ **1.8 weeks**.

| T (weeks) | decay | retrain | total per week |
|---|---|---|---|
| 1 | £1,500 | £5,000 | £6,500 |
| 2 | £3,000 | £2,500 | **£5,500** |
| 4 | £6,000 | £1,250 | £7,250 |

Retrain fortnightly. Caveats: labels for the last 30–90 days are incomplete, so the training window
lags; automate the gates first, because cheaper cycles push T* down.


### Sizing a canary for a new fraud model

Card traffic is 400,000 transactions a day; the canary gets 5%. The current decline rate is 0.5%. You want to catch a regression that doubles declines within about six hours, alerting when declines exceed a fixed threshold. Pick a threshold and estimate false-alarm and detection rates.

**Solution**

Canary volume: 5% × 400,000 = 20,000/day ≈ 833/hour → about **5,000 transactions in six hours**.

Expected declines in six hours (Poisson):
- healthy: 5,000 × 0.5% = **25** (SD ≈ 5)
- regressed: 5,000 × 1.0% = **50** (SD ≈ 7)

Threshold at 35 declines (2 SD above healthy):
- false alarm: P(Poisson(25) ≥ 35) ≈ **3.4%**
- detection: P(Poisson(50) ≥ 35) ≈ **99%**

Six hours at 5% is adequate for doubling. To catch a 20% increase you would need far more traffic
or time, which is why canaries guard against gross failures and the A/B test measures subtle
effects. Compare against a concurrent control slice, not yesterday, to cancel time-of-day effects.


## What changed recently

- **Oct 2026: llm-d 1.0: production Kubernetes stack for open-model serving.** llm-d, the Kubernetes-native distributed inference project led by Red Hat, IBM and Google and running on engines such as vLLM and SGLang, reached 1.0 with a focus on day-2 operations: prefix-cache-aware routing, KV-cache offloading, prefill/decode disaggregation, multi-tenant QoS, session pinning for multi-turn agents and zero-downtime upgrades. IBM reports its router captured 97% of the available cache reuse on an agentic coding workload. Interviewers now ask why self-hosted LLM serving needs load- and cache-aware routing rather than a plain Service, and how to upgrade models without dropping sessions. [Source](https://research.ibm.com/blog/llmd-1-0-is-ready-for-production-inference-serving)
- **Jun 2026: EU Digital Omnibus pushes AI Act high-risk obligations back.** The Council's final approval at the end of June 2026 moved the high-risk obligations from 2 August 2026 to 2 December 2027 for stand-alone systems and 2 August 2028 for AI embedded in regulated products, and shortened the grace period for marking AI-generated content to 2 December 2026. The high-risk obligations include technical documentation, automatic event logging and post-market monitoring, all of which should come out of the ML pipeline rather than be written by hand. Interviewers at regulated firms that sell into the EU ask what you would build now and what the delay really changes. [Source](https://eeas.europa.eu/delegations/chile/artificial-intelligence-council-gives-final-green-light-simplify-and-streamline-rules_en)
- **Jun 2026: OpenTelemetry GenAI conventions move to their own repository.** Semantic conventions release v1.42.0 deprecated every gen_ai.* attribute, metric, event and span in the core repository and moved them to a dedicated GenAI repository covering inference, embeddings, retrieval, tool execution, agent invocation, MCP and provider-specific conventions. They are still marked Development, and capture of prompt and completion content is opt-in because it often holds personal data. Interviewers ask how you would trace agents in a vendor-neutral way while the schema still churns. [Source](https://github.com/open-telemetry/semantic-conventions/releases/tag/v1.42.0)
- **Aug 2025: EU AI Act obligations for general-purpose model providers apply.** From 2 August 2025, providers placing general-purpose AI models on the EU market must keep technical documentation, adopt a copyright policy and publish a summary of training content using the Commission's template, with extra duties above the 10^25 FLOP systemic-risk presumption. Models already on the market have until 2 August 2027, and a voluntary Code of Practice offers a route to show compliance. Data lineage and training records therefore become regulatory artefacts, not just good engineering hygiene. [Source](https://digital-strategy.ec.europa.eu/en/news/eu-rules-general-purpose-ai-models-start-apply-bringing-more-transparency-safety-and-accountability)
- **Jun 2025: MLflow 3 rebuilds the registry around GenAI applications.** MLflow 3 introduced LoggedModel as a first-class version of an application, linked to its prompts, traces and evaluation runs, along with OpenTelemetry-based tracing for over 20 GenAI libraries, LLM judges, expert review of traces and a prompt registry with diffs and rollback. It made eval-driven development and trace-level monitoring standard features of a mainstream open-source MLOps tool, so interviewers expect candidates to describe LLM release gates in those terms. [Source](https://www.databricks.com/blog/mlflow-30-unified-ai-experimentation-observability-and-governance)

## Pitfalls

- Using shadow mode to claim business impact; shadow traffic cannot measure outcomes the model would have changed.
- Retraining on a fixed schedule with no validation gate, or letting an automatic retrain bypass the champion comparison.
- Monitoring only aggregate accuracy, which arrives weeks late and hides failures in small slices.
- Reimplementing feature logic separately in the online service, the classic source of training–serving skew.
- Calling a model reproducible because the code is in git while the data snapshot and environment are not versioned.
- Treating LLM prompts as configuration outside CI, so a one-line prompt edit ships with no regression eval.

## How interviewers probe it

- Walk through a 9 am incident: what do you check first, how do you stop the bleeding, who do you tell?
- Design dashboards and alerts for a new model with delayed labels; which alerts page someone at night?
- Compare shadow, canary and A/B for a specific model and justify the rollout plan with traffic numbers.
- What exactly is versioned and stored in a registry; how would you reproduce last March's model?
- LLMOps: eval-in-CI with non-deterministic outputs, validating LLM judges against human labels, pinning provider model versions, tracing agents with OpenTelemetry GenAI spans, cost per feature.
- Lead angle: minimum engineering bar before production, how to fund platform work against feature requests, and which EU AI Act evidence (technical documentation, logs, post-market monitoring) the pipeline should produce automatically.

## Reading

- [Rules of Machine Learning: Best Practices for ML Engineering](https://developers.google.com/machine-learning/guides/rules-of-ml) (Docs, 60 min, Intro): Zinkevich's pragmatic rules, including logging served features and measuring training–serving skew.
- [MLflow for Agents and LLMs](https://mlflow.org/docs/latest/genai/) (Docs, 45 min, Intro): Open-source MLflow docs with quickstarts for OpenTelemetry-compatible tracing, LLM-judge evaluation and prompt versioning.
- [MLOps: Continuous delivery and automation pipelines in machine learning](https://docs.cloud.google.com/architecture/mlops-continuous-delivery-and-automation-pipelines-in-machine-learning) (Docs, 30 min, Core): The level 0/1/2 maturity model and what continuous training adds to CI/CD.
- [Data Distribution Shifts and Monitoring](https://huyenchip.com/2022/02/07/data-distribution-shifts-and-monitoring.html) (Blog, 45 min, Core): Clear taxonomy of covariate, label and concept shift, plus what to monitor when labels are delayed.
- [Hidden Technical Debt in Machine Learning Systems](https://papers.nips.cc/paper/5656-hidden-technical-debt-in-machine-learning-systems) (Paper, 30 min, Core): Classic catalogue of ML-specific debt: entanglement, feedback loops, glue code, configuration.
- [The ML Test Score: A Rubric for ML Production Readiness and Technical Debt Reduction](https://research.google/pubs/the-ml-test-score-a-rubric-for-ml-production-readiness-and-technical-debt-reduction/) (Paper, 30 min, Core): A concrete checklist of data, model, infrastructure and monitoring tests to quote as a production bar.
- [OpenTelemetry semantic conventions for generative AI](https://github.com/open-telemetry/semantic-conventions-genai/tree/main/docs/gen-ai) (Docs, 40 min, Core): The vendor-neutral span, metric and event vocabulary for model calls, retrieval, tool execution, agents and MCP (moved to its own repository in 2026, still in Development).
- [Operationalizing Machine Learning: An Interview Study](https://arxiv.org/abs/2209.09125) (Paper, 50 min, Deep): Interviews with 18 ML engineers; the velocity–validation–versioning framing is useful in lead interviews.

## Practise this topic

- [What causes training–serving skew and how do you prevent and detect it?](https://gurkanozkan.ai/learn/questions/mle-training-serving-skew-34.md)
- [What problems does a feature store solve? Describe its offline and online parts and how features flow between them.](https://gurkanozkan.ai/learn/questions/mle-what-a-feature-store-is-for-33.md)
- [What must you version to reproduce a model six months later, and what does a model registry store?](https://gurkanozkan.ai/learn/questions/mle-reproducibility-and-the-model-registry-39.md)
- [How do you decide how often to retrain, and what safeguards gate an automatically retrained model?](https://gurkanozkan.ai/learn/questions/mle-retraining-cadence-scheduled-vs-triggered-40.md)
- [What does a CI/CD pipeline for an ML service test that a normal service pipeline does not?](https://gurkanozkan.ai/learn/questions/mle-ci-cd-for-ml-41.md)
- [Compare shadow deployment, canary and an A/B champion/challenger test for a new fraud model. When is each appropriate?](https://gurkanozkan.ai/learn/questions/mle-shadow-canary-and-champion-challenger-rollouts-42.md)
- [At 9 am, false declines on card payments triple. Walk through your response.](https://gurkanozkan.ai/learn/questions/mle-responding-to-a-model-driven-incident-44.md)
- [Design the dashboards and alerts for a newly launched credit-risk model.](https://gurkanozkan.ai/learn/questions/mle-a-monitoring-plan-for-a-production-model-47.md)
- [How do you stop prompt or model changes from silently breaking things? Describe eval-in-CI that copes with non-deterministic outputs.](https://gurkanozkan.ai/learn/questions/applied-llm-evl-05.md)
- [What is your minimum engineering bar before an ML model goes to production?](https://gurkanozkan.ai/learn/questions/lead-td-12.md)
- [Design a system that monitors a production ML model's performance in real time.](https://gurkanozkan.ai/learn/questions/lead-td-03.md)
- [Chargebacks arrive 30–90 days after a transaction, and some never arrive. How does this affect training, evaluation and monitoring?](https://gurkanozkan.ai/learn/questions/mle-delayed-and-noisy-labels-30.md)
- [You are instrumenting a production agent with a planner, retrieval, tool calls and two model providers, and you want vendor-neutral traces. How would you use…](https://gurkanozkan.ai/learn/questions/recent-b-mlops-01.md)
- [The EU's Digital Omnibus on AI moved the AI Act's high-risk obligations to December 2027 for stand-alone systems, while duties for general-purpose model…](https://gurkanozkan.ai/learn/questions/recent-b-mlops-03.md)
- [You are moving about 3,000 concurrent coding agents from a managed API to a self-hosted open model served with vLLM on Kubernetes. Why does a standard…](https://gurkanozkan.ai/learn/questions/recent-b-mlops-02.md)
- [Anthropic's September 2025 postmortem described routing, configuration and compiler bugs that degraded answer quality for weeks without raising error rates…](https://gurkanozkan.ai/learn/questions/recent-b-systems-reliability-01.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
