MLOps and LLMOps
In most ML system design interviews, the model is the easy part. A gradient-boosted tree or a two-tower network can be named in one sentence. What separates a strong answer is everything around the model: where the features come from, how the training data is built, how a new version reaches production without breaking anything, how predictions are served at 100,000 requests per second, and how you notice when the model quietly gets worse. That surrounding machinery is MLOps. Its newer cousin, LLMOps, covers the same questions for systems built on large language models, where the "model" is often a prompt, a retrieval index and an API you don't control.
This post builds the picture up in the order a model lives through it:
- The lifecycle, and why ML systems fail differently from ordinary software.
- Features and training data: training-serving skew, point-in-time correctness and the feature store.
- Training pipelines: reproducibility, orchestration, the model registry and retraining.
- Deployment: batch, online, streaming and edge prediction, and safe rollouts.
- Real-time prediction at scale, with the arithmetic.
- Monitoring: drift, delayed labels and feedback loops.
- LLMOps: what changes when the model is an LLM.
- The decision you'll be asked about most: train your own model, call an LLM API, or self-host an open-source model.
Why ML Systems Need Their Own Ops
Ordinary software fails loudly. A null pointer throws, a request returns 500, an alert fires. ML systems usually fail silently. The service returns a prediction, with normal latency, and the prediction is wrong. Nothing in your HTTP dashboards changes. Revenue or user trust slowly drops, and weeks later someone asks why.
There are three reasons for this:
- Behavior comes from data, not code. The same code trained on different data gives a different model. So the data, and the exact snapshot of it, is part of the build. If you can't say which rows trained a model, you can't reproduce or debug it.
- The world moves. A fraud model trained before a new attack pattern, or a demand model trained before a holiday, degrades without any change on your side. Models have a shelf life.
- Training and serving are two different programs. Features are computed one way in a Spark job for training and another way in a Java service at request time. If they disagree even slightly, the model sees inputs at serving time that it never saw in training.
MLOps is the set of practices that closes these gaps: version everything that affects the model, compute features once, deploy models the way you'd deploy risky code, and monitor the predictions and the data, not just the servers.
The Lifecycle
Every production model goes around the same loop:
- Data: raw events, logs and labels land in a warehouse or lake (Snowflake, BigQuery, Iceberg on S3).
- Features: pipelines turn raw data into model inputs and store them for training (offline) and serving (online).
- Training: a pipeline builds a training set, trains, and evaluates against a held-out set and the current production model.
- Registry: the trained model, its metrics, and pointers to its exact data, code and config are recorded as an immutable version.
- Deployment: the version is rolled out behind a shadow, canary or A/B test.
- Monitoring: input distributions, prediction distributions, and (when labels arrive) quality metrics are tracked. Drift or decay triggers retraining, and the loop starts again.
In an interview, you don't need to draw all of this every time. But when you design any ML system, say which parts of this loop you're building and which you assume a platform already gives you. The full platform version is its own problem in Design a Machine Learning Platform.
Features and Training Data
Training-Serving Skew
The most common production ML bug is training-serving skew: the feature values a model sees at serving time differ from the ones it was trained on. Some typical causes:
- Two implementations. The training pipeline computes
avg_order_value_30din SQL. The serving team reimplements it in Go and handles refunds differently. - Different freshness. Training used end-of-day snapshots. Serving reads a value that's updated every minute. The model learned how "yesterday's" feature relates to the label, then gets "now."
- Missing values. Training data dropped nulls. At serving time, a cache miss returns
0, which the model reads as a real value.
The fix is structural: define each feature once and compute it with the same logic for both paths, then log the exact feature values used at serving time. Logged serving features are the best training data you can have, because they're exactly what the model will see.
Point-in-Time Correctness
The second classic bug is label leakage through time. Say you're training a fraud model on transactions from March, with a feature "number of chargebacks on this card." If you join the transaction to the current value of that feature, you're giving the model information from after the transaction happened, including the chargeback that is its own label. Offline metrics look superb. In production the model is useless.
A training set must use each feature's value as it was at the moment of the prediction. This is an as-of join:
-- For each labeled transaction, take the latest feature row
-- that was available BEFORE the transaction time.
SELECT t.txn_id, t.label, f.chargebacks_90d, f.txn_count_1h
FROM transactions t
ASOF JOIN card_features f
ON t.card_id = f.card_id
AND f.available_at <= t.event_time;
ASOF JOIN is native in some engines (DuckDB, ClickHouse, kdb+); elsewhere you write it with a window function that picks the latest row per key. Note the column is available_at, not computed_for. A daily batch feature for March 3 might not be written until 4 a.m. on March 4, and a prediction at 1 a.m. on March 4 couldn't have seen it.
If an interviewer asks why a model did great offline and badly online, lead with two suspects: training-serving skew and leakage through time. Then say how you'd check: compare logged serving features with recomputed training features for the same requests, and audit every feature's timestamp against the label's.
Batch, Streaming and Request-Time Features
Features come in three freshness tiers, and a real model usually mixes all three:
| Tier | Example | Computed by | Freshness | Cost |
|---|---|---|---|---|
| Batch | user's purchases in the last 90 days, item popularity | Spark or SQL, daily or hourly | hours | cheapest |
| Streaming | card's transactions in the last 10 minutes | Flink or Spark Structured Streaming over Kafka | seconds | moderate |
| Request-time | query text, device, distance from user to store | the serving code, from the request | instant | adds latency per request |
The rule of thumb: use the stalest tier that still captures the signal. "Logins in the last minute" matters for account-takeover detection, so it must be streaming. "Favorite cuisine" changes slowly, so a daily batch is fine and far cheaper.
The Feature Store
A feature store packages all of this: a registry of feature definitions, an offline store (columnar files in a warehouse or lake) for building point-in-time correct training sets, and an online store (Redis, DynamoDB, Cassandra or ScyllaDB) for low-latency lookups at serving time, both filled from the same definitions. Feast is the common open-source one; Tecton, Databricks and SageMaker have managed versions.
You don't always need one. A single team with three models can get far with a well-tested feature library used by both the training job and the service. Reach for a feature store when many teams reuse features, when streaming features are involved, or when skew bugs have already bitten. The design of one is covered in Design a Feature Store.
Training Pipelines
Reproducibility
A model version is reproducible when you can rebuild it, or at least explain it, months later. That requires pinning four things:
- Data: an immutable snapshot or version of the training set (Iceberg/Delta table version, a dated Parquet path, or a DVC/lakeFS commit). "The
eventstable as of last Tuesday" isn't a version if the table can be rewritten. - Code: the git commit of the training code and its container image digest.
- Config: hyperparameters, feature list, label definition, random seeds.
- Environment: library versions (a different XGBoost or CUDA version can change results).
An experiment tracker (MLflow, Weights & Biases) records these with each run, along with metrics and artifacts. The model registry (MLflow Model Registry, SageMaker, Vertex AI or a table you own) promotes a run to a named, versioned model with a stage such as staging or production. Deployments refer to registry versions, never to a path on someone's laptop.
Orchestration
Training is a pipeline of steps, not a script: extract the training window, build features with an as-of join, split by time, train, evaluate, compare with production, register. Each step's output is an artifact the next step consumes. Orchestrators like Airflow, Kubeflow Pipelines, Argo Workflows, Dagster or Metaflow run these as DAGs with retries and caching:
@pipeline(schedule="0 3 * * *") # nightly
def train_ranker(date: str):
train, valid, test = build_dataset(
features=RANKER_FEATURES, label="clicked", end=date,
window_days=28, split="by_time") # never random-split time series
model = train_gbdt(train, valid, params=RANKER_PARAMS)
report = evaluate(model, test, baseline="ranker@production",
slices=["country", "new_users", "device"])
if report.passes(min_auc_gain=0.0, max_slice_regression=0.005):
register(model, report, stage="staging")
Two details matter here. Split by time, not randomly: train on weeks 1-3 and test on week 4, because that's how the model will be used, and random splits leak future patterns into training. And compare against production on slices, not just overall. A model that's 0.3% better on average and 4% worse for new users is often a regression.
When to Retrain
There are three common policies:
- Scheduled: retrain daily or weekly on a sliding window. Simple and predictable. Most recommendation and ranking models work this way.
- Triggered: retrain when monitoring shows drift or quality decay. Saves compute, but needs good monitoring and still needs a schedule as a backstop.
- Continuous / online: update the model incrementally as new labeled data streams in (common in ads CTR models, where yesterday's model is already stale). Powerful, but harder to validate, because there is no clean "candidate vs production" comparison before each update.
How fast does a model go stale? Measure it: take a model trained on data up to day D and evaluate it on days D+1, D+7 and D+30. If AUC drops 0.5% in a week, weekly retraining loses at most that much. If it drops 3% in a day, you need daily or online training.
Large-scale training (models that need many GPUs) brings in data, tensor and pipeline parallelism, which are covered in Inference Optimization and Distributed Training.
Deployment
Four Ways to Serve Predictions
The first deployment question isn't "which serving framework," it's when the prediction is computed:
| Mode | How it works | Latency | Use it for |
|---|---|---|---|
| Batch | a job scores every entity on a schedule and writes results to a table or key-value store | prediction is precomputed; lookup is milliseconds | churn scores, daily recommendations, email targeting, lead scoring |
| Online (request-response) | a service scores the request synchronously | 1-100 ms of model time | search ranking, fraud at checkout, feed ranking |
| Streaming | a consumer scores events as they arrive on Kafka and emits results | seconds | content moderation queues, anomaly detection, near-real-time alerts |
| Edge / on-device | the model ships inside the app | no network | keyboard prediction, camera effects, offline use |
Batch prediction is underrated in interviews. If the inputs don't depend on the request, precompute. "Recommended for you" on a homepage can be computed nightly for 100M users and served from a key-value store, with a light online re-rank for freshness. It's cheaper, more robust (a model outage doesn't take down the page), and easy to inspect. The cost: predictions are only as fresh as the last run, and you score many users who never show up. Design an Offline Batch Inference Service covers running such jobs at scale.
Online prediction is needed when the input only exists at request time: the search query, the cart, the transaction being authorized. It brings a latency budget, autoscaling, and a hard dependency on feature freshness.
Packaging and Serving Frameworks
A model is packaged as an artifact plus a small amount of code: pre-processing, the model call and post-processing. Common choices:
- Classic models (GBDT, linear, small neural nets): export to ONNX or a native format and serve from a lightweight service, or embed the model in the application process to skip a network hop.
- Deep models on GPUs: NVIDIA Triton, TorchServe, KServe, Ray Serve or BentoML. They handle loading, versioning, dynamic batching (grouping concurrent requests into one GPU call) and metrics.
- LLMs: specialized engines like vLLM, SGLang or TensorRT-LLM, which add continuous batching and KV cache management (see LLM Serving Engines).
Rolling Out Safely
Treat a new model like risky code, because it is. A model can pass every offline check and still hurt the product. The standard ladder:
- Offline gate: beats production on the held-out set overall and on key slices; latency and memory within budget.
- Shadow: the new model scores live traffic in parallel, but its outputs are only logged. You compare prediction distributions, latency and errors with zero user impact. This catches skew bugs that offline evaluation can't.
- Canary: a small slice of traffic (1-5%) gets the new model's predictions, with automatic rollback if guardrail metrics (error rate, latency, a business metric) move the wrong way.
- A/B test: a properly sized experiment measures the business metric. Many models that win offline are neutral online, because the offline metric isn't the business metric.
- Full rollout, keeping the previous version warm for instant rollback.
A strong interview answer always includes rollback. Models in the registry are immutable, the serving layer points at a version, and rolling back is changing a pointer, not retraining. If rolling back takes a training run, it's not a rollback.
Real-Time Prediction at Scale
Let's put numbers on an online ranking service, because this is where interviews push. Say a feed or ads system handles 100,000 requests per second at peak, and each request ranks 500 candidates within a 100 ms end-to-end budget.
That's 100,000 × 500 = 50 million item scores per second.
The Latency Budget
A typical split of 100 ms:
| Stage | Budget |
|---|---|
| Request parsing, auth, network | 10 ms |
| Candidate retrieval (ANN index, rules) | 20 ms |
| Feature fetch | 15 ms |
| Model inference on 500 items | 30 ms |
| Re-ranking, business rules, logging | 10 ms |
| Headroom for tail latency | 15 ms |
Budget for p99, not the average. With fan-out to many shards or feature stores, the slowest call sets the request latency.
Feature Fetch Is Often the Bottleneck
Each request needs user features (one lookup) and item features (500 lookups). The user lookups are 100,000 per second, which a modest Redis cluster handles easily. The item lookups are 50 million per second. A Redis node does on the order of a few hundred thousand simple operations per second, more with pipelining, so serving those from Redis alone means a very large cluster and a lot of network.
The better design notices that item features change slowly and the item catalog is shared across all requests. If there are 10M items with 1 KB of features each, that's 10 GB, which fits in the memory of each ranking host. So we keep item features in an in-process cache refreshed every minute or two from the feature store, and fetch only user and context features remotely. The remote lookup rate drops from 50M per second to 100,000.
Model Cost
How much compute does scoring take? It depends on the model family:
- A GBDT with 500 trees of depth 8 visits 500 × 8 = 4,000 nodes per item. Optimized inference (compiled trees, batched over items) runs in a few microseconds per item per core. At 50M items per second and, say, 5 µs each, that's 50M × 5 µs = 250 cores, a few dozen machines. Very manageable on CPU.
- A deep ranking model (embeddings plus an MLP or attention over user history) might cost 20 MFLOPs per item. 50M × 20 MFLOPs = 10^15 FLOP/s = 1 PFLOP/s. A server CPU core sustains on the order of tens of GFLOP/s, so CPUs would need tens of thousands of cores. An inference GPU like an L4 (around 120 TFLOP/s of dense FP16) at a realistic 30% utilization gives about 36 TFLOP/s, so we need roughly 1,000 / 36 ≈ 28 GPUs, plus headroom. This is why deep rankers run on GPUs, and why each request's 500 candidates are scored as one batch.
Tricks That Matter at This Scale
- Cascade ranking: a cheap model trims 5,000 candidates to 500, and the expensive model only scores those. Cost scales with the expensive model's input count.
- Cache predictions where the inputs repeat: popular queries, logged-out traffic, the same user reloading within seconds.
- Precompute the expensive half: two-tower models compute item embeddings offline, so only the user tower and a dot product run online.
- Graceful degradation: if the model service times out, fall back to a cached or popularity-based ranking rather than an error page.
Monitoring
What to Watch
ML monitoring has four layers, from fastest to slowest signal:
- Service health: latency, errors, throughput, GPU utilization. Same as any service.
- Input data: feature null rates, value ranges, and distributions compared with the training data. A feature that is suddenly 40% null usually means an upstream pipeline broke.
- Predictions: the distribution of scores. If the average fraud score doubles overnight with no change in traffic, something is off, either in the model's inputs or in the world.
- Outcomes: real quality metrics (precision, AUC, calibration, business metrics) once labels arrive.
Layers 2 and 3 matter because of delayed labels. A fraud chargeback arrives 30-90 days after the transaction. A loan default shows up after months. You can't wait that long to find out the model is broken, so you watch inputs and outputs as early proxies.
Measuring Drift
Data drift (or covariate shift) means the input distribution changed. Concept drift means the relationship between inputs and labels changed: the same features now mean something different, like a new fraud pattern that looks like normal behavior. Data drift you can see without labels; concept drift usually shows up only in outcome metrics.
A common drift score for one feature is the Population Stability Index. Bucket the feature using the training distribution, then compare bucket shares:
import numpy as np
def psi(expected, actual, eps=1e-6):
"""expected/actual: fraction of rows in each bucket (each sums to 1)."""
e = np.clip(np.asarray(expected), eps, None)
a = np.clip(np.asarray(actual), eps, None)
return float(np.sum((a - e) * np.log(a / e)))
# Training: 25% in each quartile. This week: shifted toward the top bucket.
psi([0.25, 0.25, 0.25, 0.25], [0.15, 0.20, 0.25, 0.40]) # ≈ 0.13
The usual rule of thumb: below 0.1 is stable, 0.1-0.25 is worth a look, above 0.25 is a significant shift. For the example, the terms are (0.15−0.25)·ln(0.6) ≈ 0.051, (0.20−0.25)·ln(0.8) ≈ 0.011, 0, and (0.40−0.25)·ln(1.6) ≈ 0.071, for a total of about 0.13. Worth a look, not an emergency. Alert on drift in the features the model relies on most; drift in an unimportant feature is noise.
Feedback Loops
A deployed model changes the data it will be trained on next. A recommender only gets click labels for items it chose to show. A fraud model never learns whether the transactions it blocked were actually fraud. Over time, the model becomes confident about its own past choices and blind outside them.
The standard defenses:
- Exploration: show a small share of traffic (say 1-5%) items chosen with some randomness, and log the probability each was shown with, so training can correct for selection bias.
- Holdout traffic: a small random slice that bypasses the model (or uses a simple baseline) gives unbiased labels and a permanent measure of the model's lift.
- Log the decision context: which model version, which candidates, which score. Without this, you can't debias later.
"How would you know the model got worse?" is one of the most common follow-ups. A complete answer names all four layers, explains delayed labels and what you watch in the meantime, and mentions a holdout group so you can always measure the model against "no model."
LLMOps: What Changes With LLMs
LLM applications reuse most of the MLOps loop, but several parts change shape. Often you don't train anything: the "model" is a hosted LLM, plus a prompt, plus a retrieval index, plus some tools. Each of those is an artifact that changes behavior and needs versioning.
| Concern | Classic MLOps | LLMOps |
|---|---|---|
| What you ship | trained weights + feature code | model ID + prompt template + retrieval config + tool definitions (sometimes adapters) |
| Evaluation | metrics on a labeled test set (AUC, RMSE) | eval suites with code checks, LLM-as-judge and human review; outputs are open-ended text |
| Cost driver | compute per prediction, roughly fixed | tokens: input + output, varying 100× between models and with prompt length |
| Latency | single forward pass, milliseconds | time to first token plus generation time, often seconds |
| Failure modes | wrong score, drift | hallucination, prompt injection, unsafe output, format errors, silent provider model changes |
| Monitoring | feature and prediction drift | traces of every call and tool step, quality scores on sampled traffic, cost per request |
| Rollouts | model version behind an A/B test | prompt/model version behind a config flag and an A/B test, with safety guardrails |
A few practices are specific to LLM systems:
- Prompts are code. Store them in version control or a prompt registry, review changes, and tie every logged request to the prompt version that produced it. A one-word prompt edit can shift behavior as much as a new model.
- Evals are the test suite. Build a dataset of real inputs with expected properties (correct answer, required citation, valid JSON, refusal where appropriate) and run it on every prompt, model or retrieval change. Calibrate LLM judges against human labels. The details are in Design an LLM Evaluation and Observability System.
- Trace everything. An agent request might make six LLM calls and four tool calls. You need the full tree, with inputs, outputs, tokens and latency per step, to debug anything.
- Put a gateway in front of providers. One place for routing, fallbacks between providers, caching, budgets and logging; see Design an LLM Gateway.
- Pin model versions. Hosted models get updated. Use dated model identifiers where the provider offers them, and re-run your evals before moving to a new one.
- Experiment through config. Test a new prompt or model on 10% of traffic with automatic rollback on safety regressions, as in Design A/B Testing for LLM Features.
- Fine-tuning is a pipeline like any other. When you do fine-tune (LoRA, DPO), the training, eval gate and registry from classic MLOps apply directly; Design an LLM Fine-Tuning System covers it.
Train, Call an LLM, or Self-Host an Open-Source Model?
This question comes up constantly, in many forms: "Would you use GPT for this?", "Why not just fine-tune Llama?", "Could a simple classifier do it?" There are three broad options:
- Train a task-specific model: a GBDT, a logistic regression, a fine-tuned BERT-sized encoder, a two-tower recommender.
- Call a hosted LLM API with a prompt (maybe with retrieval or a few examples).
- Self-host an open-weights model (Llama, Mistral, Qwen, Gemma and others), possibly fine-tuned, on your own GPUs.
A Worked Cost Comparison
Say we need to tag 20 million product listings a day with one of 300 categories. A prompt with instructions and the category list plus the listing comes to about 500 input tokens, and the answer is about 10 output tokens.
Hosted LLM API. Per day that's 20M × 500 = 10 billion input tokens and 20M × 10 = 200 million output tokens. Using illustrative prices (check current ones; they change often):
- A small, cheap model at $0.15 per million input tokens and $0.60 per million output: 10,000 × $0.15 + 200 × $0.60 = $1,500 + $120 ≈ $1,600 a day, about $49,000 a month.
- A frontier model at $3 and $15 per million: 10,000 × $3 + 200 × $15 = $30,000 + $3,000 = $33,000 a day, about $1M a month.
Self-hosted open 8B model. Prefill dominates: 10B tokens a day is 10^10 / 86,400 ≈ 116,000 tokens per second. At 2 FLOPs per parameter per token, that's 116,000 × 16 GFLOPs ≈ 1.9 × 10^15 FLOP/s. An H100 does about 1,000 TFLOP/s of dense BF16; at 40% utilization, 400 TFLOP/s. So about 5 H100s, which at roughly $2.50 an hour is 5 × $2.50 × 730 hours ≈ $9,000 a month, plus the engineers to run it.
Fine-tuned small encoder. A BERT-base-sized classifier (110M parameters) doesn't need instructions or a category list in its input. The listing alone is about 128 tokens. That's 20M × 128 = 2.56B tokens a day, or about 30,000 tokens per second, at 2 × 110M = 0.22 GFLOPs per token: about 6.5 TFLOP/s. One inference GPU (an L4 at ~30% utilization gives ~36 TFLOP/s) handles it with room to spare, for under $1,000 a month. Training it needs labeled examples, and here's the trick: label 50,000 listings with the frontier LLM for about 50,000 × 510 tokens ≈ 25M tokens, roughly $100, spot-check them with humans, and train the small model on them. This is distillation, and it's how many teams move from "LLM prototype" to "cheap production model."
The spread is three orders of magnitude, from about $1M a month to under $1,000, for the same task. At small volumes the API is cheapest because you pay nothing when idle and no one has to run GPUs. At large, stable volumes, a small trained model wins by a huge margin.
How to Decide
| Factor | Train your own | Hosted LLM API | Self-hosted open model |
|---|---|---|---|
| Labeled data | needs thousands+ examples (or an LLM to make them) | zero-shot or a few examples | few examples, or a fine-tuning set |
| Task shape | fixed outputs: scores, classes, rankings, numbers | open-ended language, reasoning, many tasks | language tasks with stable requirements |
| Latency | sub-millisecond to milliseconds | hundreds of ms to seconds | tens of ms to seconds, under your control |
| Cost at high volume | lowest | highest, linear in tokens | middle; depends on GPU utilization |
| Time to first version | weeks | hours | days to weeks |
| Data privacy | data stays in-house | data goes to a provider (contracts and regional options help) | data stays in-house |
| Control | full | none over model updates or deprecations | full: pinned weights, custom fine-tunes |
Some practical rules:
- Ranking, recommendation, fraud, pricing and ETA are trained-model problems. They run at huge QPS, need milliseconds of latency, have abundant labels from logs, and output numbers. An LLM is the wrong tool for scoring 50M items per second. LLMs may still help around them: generating item descriptions, embeddings or labels offline.
- Open-ended language tasks start with an API. Summarization, chat, extraction from messy documents, agents. Validate the product with the best model before optimizing cost.
- Move down the ladder as volume grows and the task stabilizes. Frontier API → smaller API model → fine-tuned open model → distilled small model. Each step needs an eval set that proves quality held.
- Self-host for privacy, control or very high steady volume, and only if you can keep GPUs busy. A GPU sitting idle overnight costs the same as a busy one, so a spiky workload at 15% average utilization can be more expensive self-hosted than through an API.
When asked "would you use an LLM for this?", don't answer yes or no. Answer with the volume, the latency budget and the cost per call, then pick. "At 20M calls a day, a frontier API would cost on the order of $1M a month; I'd prototype with it, use it to label data, and distill into a small classifier that costs under $1,000 a month" is a senior answer.
MLOps in an Interview
Which Tool When
- Batch prediction whenever inputs don't depend on the request. Precompute and serve from a key-value store.
- Online prediction when the input only exists at request time, with a budget for feature fetch and model time.
- Streaming features only for signals that truly need seconds of freshness; batch features for everything else.
- A feature store when many models share features, streaming features are involved, or skew has bitten.
- Shadow, canary, then A/B for every model rollout, with instant rollback by version pointer.
- Scheduled retraining as the default, with drift-triggered retraining on top for fast-moving domains.
- An eval suite, a gateway and tracing as the minimum LLMOps setup for any LLM feature.
Common Follow-ups
- "How do you prevent training-serving skew?" One feature definition used by both paths, log serving features and train on them, and continuously compare logged values with recomputed ones.
- "Your model looks great offline but the A/B test is flat. Why?" Leakage, skew, a mismatch between the offline metric and the business metric, or novelty and position effects. Check them in that order.
- "How often would you retrain?" Measure decay by evaluating an old model on newer days, then pick a cadence that keeps the loss acceptable.
- "How do you monitor a model whose labels arrive in 60 days?" Input drift, prediction drift, early proxy labels (e.g. a customer dispute within 7 days as an early fraud signal), and a holdout group.
- "Would you fine-tune or use RAG?" Use RAG for knowledge that changes or must be cited, fine-tuning for style, format, or a narrow task at high volume. They combine well (see RAG Fundamentals).
Summary
MLOps exists because ML systems fail silently. Their behavior depends on data that changes, and their features are often computed twice, once for training and once for serving. The fixes are structural: define features once and keep training data point-in-time correct; make every model version reproducible from pinned data, code, config and environment; roll models out like risky code with shadow traffic, canaries, A/B tests and pointer-based rollback; and monitor inputs and predictions while waiting for delayed labels, with exploration and holdouts to keep feedback loops honest.
Real-time prediction at scale is mostly about arithmetic. Know your request rate times candidates per request, push the slow-changing data into local caches, cascade cheap models before expensive ones, and choose CPU or GPU from the FLOPs per item. LLMOps keeps the same loop but versions prompts, retrieval configs and model IDs, replaces test-set metrics with eval suites, and puts a gateway and tracing in front of everything. And when someone asks whether to train a model, call an LLM or self-host one, do the cost math. The answer often changes by three orders of magnitude with volume.