LLM Evaluation in Production: 3 Loops That Actually Work
LLM evaluation in production needs a golden dataset, CI gates, and live trace scoring, not a one-time launch test. Here's how to build it in 2026.
By Babul Jack
LLM evaluation in production means scoring your model or agent's behavior continuously — on every pull request and on live traffic — instead of running one test suite before launch and hoping nothing drifts. A working setup combines a versioned "golden" dataset built from real traces, automated scorers, a CI gate that blocks regressions, and sampled scoring of production traffic that feeds new failures back into the dataset.
I've wired this into client projects where a support copilot, a text-to-SQL agent, or a document-extraction pipeline looked fine in a demo and then quietly degraded after a prompt tweak or a model swap nobody flagged as risky. The fix is never a bigger benchmark. It's a loop.
Why LLM evaluation is not like traditional ML testing
Classic supervised ML had one convenient property: a frozen test set and a single number — accuracy, F1, AUC — summarized model quality. LLM applications break that on every axis. Outputs are open-ended, sampling is stochastic, and the same prompt can produce different answers across runs.
The "test set" keeps moving too, because prompts and upstream models change, not just the underlying data. A provider ships a new model version, someone edits a system prompt, or a tool definition changes shape — and your application's behavior shifts without a single line of your code actually failing.
Public benchmarks like MMLU-Pro, GSM8K, or SWE-bench Verified tell you which model is generally smarter. They don't tell you whether your support agent stops fabricating refund policies or your invoice-extraction pipeline keeps hitting its accuracy target. Those are application-level questions that only your own evaluation suite can answer, as both MLflow's evaluation harness guide and independent practitioner write-ups on LLM evaluation frameworks point out.
Researchers are formalizing the same shift. A CSIRO-led paper on evaluation-driven development and operations of LLM agents argues that evaluation should be a continuous, governing function across build and run, not a terminal gate before shipping — a framing that matches what I see holding up in real deployments and what fails when teams treat eval as a one-time checkbox.
What should you actually measure?
Pick metrics that map to the failure modes that would actually hurt you, not the ones that are easiest to compute. Three families cover most production systems:
Deterministic / task metrics — exact match, structured-output validity (does the JSON parse and match the schema), tool-call correctness for agents. Cheap, fast, and unambiguous.
RAG and retrieval metrics — Ragas has standardized a useful taxonomy here: faithfulness (is the answer grounded in retrieved context), answer relevancy, context precision, and context recall. All four are computable without ground-truth labels using an LLM judge, per Ragas' own documentation.
Safety and policy checks — toxicity, PII leakage, jailbreak resistance, prompt-injection robustness — usually classifier-based and run on every output regardless of task.
Human-calibrated metrics — preference, helpfulness, tone — are expensive to collect but anchor the automated layers. Without them, an LLM judge can drift from what a real user would actually accept.
How do you build an LLM evaluation pipeline?
1. Instrument every run so it leaves a trace
You can't score what you can't replay. A trace captures the prompt, retrieved documents, tool calls, intermediate reasoning, latency, and token counts for a single run. MLflow enables this with an autolog call or a simple decorator around your own function, per its continuous LLM evaluation guide:
2. Build a golden dataset from real behavior, not invented cases
Three rules decide whether a dataset earns its keep:
Sample from production traffic, not from what the test author assumes users will ask.
Weight it toward failures — most of the signal comes from the hardest 10% of inputs, not the happy path.
Version and timestamp it like you would a prompt, so you know when a score change came from the dataset shifting rather than the application.
Start with 50-100 examples per route and grow weekly by promoting failing production traces into the set.
3. Pick scorers and run them
import mlflow
from mlflow.genai.scorers import Correctness, Guidelines
results = mlflow.genai.evaluate(
data=golden_dataset,
predict_fn=answer,
scorers=[
Correctness(),
Guidelines(name="tone", guidelines="Be polite and never promise refunds."),
],
)
print(results.metrics)
4. Put evaluation in CI/CD
Run the offline suite on every pull request that touches prompts, agent code, tool definitions, or retrieval config, and fail the build when a scorer drops below its threshold. Compare against the main branch's stored scores per scorer, not just the average — an average can hide a collapse in one intent while the overall number looks fine.
Score a slice of live traffic with the same scorers you use offline, route low-scoring traces to a review queue, and promote reviewed failures back into the golden dataset. This is the step most teams skip, and it's the one that keeps the suite honest as real usage diverges from launch-day assumptions.
A practical 30-day rollout I've used on client engagements: week 1 instrument tracing, week 2 build the first 50-100 case dataset including known bad examples, week 3 calibrate judges against human labels and wire a smoke-test CI gate, week 4 start sampling production traces and feeding failures back in.
Which LLM evaluation framework should you use in 2026?
The tool is downstream of the architecture above, but you still have to pick one (or several):
Framework
Best for
Notes
MLflow GenAI evaluation
Teams already on Databricks or using MLflow for tracking
Open source, tracing + judges + prompt registry in one platform
Ragas
RAG-native evaluation
Cleanest taxonomy for faithfulness/relevancy/precision/recall
DeepEval / Promptfoo
Fast unit-test-style checks in CI
Lightweight, developer-friendly
LangSmith / Langfuse / Opik / Braintrust
Tracing + eval + production monitoring in one SaaS
Good when you want a hosted observability layer
If you're already running MLflow for model tracking, its GenAI evaluation tooling is usually the path of least resistance since tracing, judges, and prompt versioning already live in one place. If your bottleneck is purely RAG quality, start with Ragas' four metrics before reaching for a broader platform.
Why do LLM evaluation scores keep drifting?
Three causes show up repeatedly in client audits. First, the dataset goes stale — new user intents appear and the golden set never grows to cover them. Second, the judge model itself gets swapped or updated upstream without anyone recalibrating it against human labels. Third, contamination creeps in from your own historical outputs: if a model's past responses to your eval set end up in a future training corpus, the task stops measuring generalization and starts measuring memorization, a risk the MLflow evaluation harness guide calls out explicitly. Rotating in fresh examples on a schedule is the defense.
Where this matters most: agents, not single-turn chat
Single-turn chat evaluation is comparatively easy. Agents are where evaluation earns its keep, because a wrong tool call, a bad SQL query, or a skipped validation step compounds downstream. I covered why text-to-SQL agents get data wrong in a related post — the same evaluation discipline described here (golden datasets of real queries, scorers on generated SQL, CI gates on schema and tool-call correctness) is what catches those failures before a dashboard silently shows the wrong number.
It also matters for pipeline reliability more broadly. If you're already applying data contracts to catch pipeline breakage early, continuous LLM evaluation is the equivalent discipline for the AI layer sitting on top of that data. And if your agents span multiple frameworks or vendors, the AI agent framework comparison is worth reading before you standardize your tracing and scoring setup across them.
When a client needs this built end to end — tracing, golden datasets, CI gates, and production monitoring wired into an existing agent or data stack — that's exactly the kind of work I take on through AI agent development: instrumenting the agent, defining the right scorers for its actual failure modes, and setting thresholds that catch regressions without blocking every merge over noise.
Frequently asked questions
How is continuous LLM evaluation different from running a benchmark?
A benchmark measures a model on generic public tasks at one point in time. Continuous evaluation measures your own application — your prompts, tools, and data — on every change and on live traffic, built from your own traces and failures, so it catches the regressions your users would actually notice.
How many examples do I need in a golden dataset to start?
Start with 50-100 examples per route or intent, including known bad cases, and grow the set weekly by promoting failing production traces. Beyond a few hundred examples, LLM-judge cost becomes the dominant constraint, so sampling more production traffic usually beats adding more static examples.
Can I evaluate RAG quality without ground-truth answers?
Yes. Ragas' four core metrics — faithfulness, answer relevancy, context precision, and context recall — are all computable with an LLM judge instead of human-labeled reference answers, which is why they've become a common starting taxonomy for retrieval-augmented systems.
Should I build my own evaluation harness or use a platform?
Building a dataset loader, runner, provider adapters, and scorer from scratch is a real engineering project. Unless you need something a platform genuinely can't do, starting with an existing GenAI evaluation platform and customizing scorers is faster and keeps your reproducibility habits intact from week one, when they're easiest to set and easiest to skip.
How often should I update my evaluation dataset?
Treat it like a living artifact, not a one-time deliverable. Review additions in pull requests, freeze a version for any active CI gate, and rotate in fresh production-derived examples regularly so the suite doesn't go stale as user behavior and your own prompts evolve through 2026 and beyond.
Key takeaways
LLM evaluation in production is a continuous loop — pre-merge, post-deploy, and a feedback loop that promotes failures into the dataset — not a one-time launch test.
Pick metrics that map to real failure modes: deterministic checks for structure and tool calls, Ragas-style metrics for RAG grounding, and classifier-based checks for safety.
Instrument tracing first; you can't score or replay a run you never captured.
Build a golden dataset from real production traces, weighted toward failures, and version it like code.
Wire evaluation into CI so regressions block merges, and cache model calls to keep the gate fast and deterministic.
Sample production traffic continuously and feed new failures back into the dataset — this closed loop is what keeps eval scores honest over time.
Agents need this more than single-turn chat, since a wrong tool call or bad generated query compounds into every downstream result.