LearnTopic guide

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.

ML engineering · Applied LLM · AI leadership8 key concepts16 questions

Start: Key concepts 6 lessons · about 17 min
Contents

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.

Stack · 5 layersLayered monitoring when labels lag

  1. Monitor latency and errors.

  2. Monitor schema, missingness and drift via PSI or KS tests.

  3. Monitor score distribution, decline or escalation rates.

  4. When labels arrive, monitor AUC, calibration and precision at the operating threshold.

  5. Rarely labelled: trace every request and score a sample with validated LLM judges and human review.

When labels lag, service health, inputs, outputs and quality are monitored in layers, with LLM applications traced and sampled rather than judged by delayed labels.Diagram drafted by a local AI model (Inkling 2 Mini) from this page's text and drawn from data. Checked by an independent reviewer.

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.

Next: Worked examples Lesson 3 of 6 · about 4 min

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.

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?

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.

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.

Next: What changed Lesson 4 of 6 · about 3 min

What changed recently

  1. 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

  2. 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

  3. 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

  4. 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

  5. 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

Next: Pitfalls and interview angles Lesson 5 of 6 · about 2 min

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.
Next: Quiz Lesson 6 of 6 · about 3 min

Quiz

Three questions from this guide. Answer each in your head or out loud, show the model answer, then rate yourself. The cards join your practice deck and come back when they are due.

  1. Question 1 of 3 · ML engineering · Technical · Medium

    What causes training–serving skew and how do you prevent and detect it?

  2. Question 2 of 3 · ML engineering · Technical · Medium

    What problems does a feature store solve? Describe its offline and online parts and how features flow between them.

  3. Question 3 of 3 · ML engineering · Technical · Easy

    What must you version to reproduce a model six months later, and what does a model registry store?

Reading

Practise this topic

  1. What causes training–serving skew and how do you prevent and detect it?ML engineering · Technical · Medium
  2. What problems does a feature store solve? Describe its offline and online parts and how features flow between them.ML engineering · Technical · Medium
  3. What must you version to reproduce a model six months later, and what does a model registry store?ML engineering · Technical · Easy
  4. How do you decide how often to retrain, and what safeguards gate an automatically retrained model?ML engineering · Technical · Medium
  5. What does a CI/CD pipeline for an ML service test that a normal service pipeline does not?ML engineering · Technical · Medium
  6. Compare shadow deployment, canary and an A/B champion/challenger test for a new fraud model. When is each appropriate?ML engineering · Technical · Medium
  7. At 9 am, false declines on card payments triple. Walk through your response.ML engineering · Technical · Medium
  8. Design the dashboards and alerts for a newly launched credit-risk model.ML engineering · Technical · Easy
  9. How do you stop prompt or model changes from silently breaking things? Describe eval-in-CI that copes with non-deterministic outputs.Applied LLM · Technical · Medium
  10. What is your minimum engineering bar before an ML model goes to production?AI leadership · Technical · Medium
  11. Design a system that monitors a production ML model’s performance in real time.AI leadership · System design · Hard
  12. Chargebacks arrive 30–90 days after a transaction, and some never arrive. How does this affect training, evaluation and monitoring?ML engineering · Technical · Hard
  13. 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 the OpenTelemetry GenAI semantic conventions, and what would you do about the fact that they are still marked Development?Applied LLM · System design · Medium
  14. 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 providers have applied since August 2025. You lead the ML platform at a London fintech that sells a credit-scoring model to EU lenders and fine-tunes an open-weight LLM for customer support. What do you build now, and what can safely wait?AI leadership · Case study · Medium
  15. 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 Kubernetes Service balance this traffic badly, and what would your routing, scheduling and model-upgrade design look like?ML engineering · System design · Hard
  16. Anthropic’s September 2025 postmortem described routing, configuration and compiler bugs that degraded answer quality for weeks without raising error rates. Design the monitoring that would catch a model that is up but subtly wrong in your own serving stack.ML engineering · Technical · Hard

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.