Real Studios

LLM evals: an engineering playbook for testing AI systems

Decorative title card illustration

LLM evals are structured tests that score a model or AI application's outputs against defined expectations, then feed the failures back into development as regression checks. The single most important action for any team starting out: pull a representative set of real production traces, run manual error analysis on them, and build a golden dataset before you write a single automated judge. This is not optional groundwork. According to a practical evaluation framework for LLM-reliant systems, evaluation only works as a continuous loop when it's grounded in representative data and metrics tied to operational goals, not generic capability scores.

Skip the error analysis and you'll automate the wrong thing.

What this means in practice, right now:

  • Export recent traces from your production logs or staging environment.
  • Read every single one and tag failure types by hand before building anything automated.
  • Use that taxonomy to build a golden set of labelled examples, not a benchmark borrowed from a leaderboard.

Tools like OpenAI Evals and the Evidently LLM evaluation guide both assume this groundwork exists. Skipping it is the single most common reason eval programmes stall after the first sprint.

Key Takeaways

Effective LLM evals depend on error analysis before automation, a calibrated golden dataset of 50 to 200 examples, and judges verified against human labels before they ever gate a release.

PointDetails
Start with traces, not toolsRun manual error analysis on 50 to 100 real traces before building any automated judge.
Build a lean golden setAim for a labelled set of examples with binary pass/fail labels for clean regression signal.
Validate your data structureUse JSON Schema and JSONL to enforce consistent, version-controlled evaluation records.
Calibrate judges rigorouslyTarget Cohen's kappa above 0.6 to 0.8, and above 0.85 for safety-critical rubrics.
Layer your checksCombine inline deterministic checks, sampled LLM judges, and human review rather than relying on one method.

Table of Contents

What makes LLM evals different from public benchmarks?

Public benchmarks measure raw model capability. LLM evals measure whether your system does what your users need. That distinction sounds academic until you've watched a team ship a model that tops MMLU and still fails at summarising customer tickets correctly.

Benchmarks answer questions like "can this model reason about physics problems?" or "how does it perform on coding tasks compared to competitors?" Evals answer questions like "does our support agent correctly resolve refund requests without hallucinating policy details?" One is about the model in isolation. The other is about the model wired into your prompts, your retrieval layer, your tools, and your users' actual phrasing.

This distinction matters because of where each belongs in the Agent Development Lifecycle. Benchmarks help you choose a base model during initial selection, before you've written a line of application code. Evals run continuously, from the first prototype through every release afterwards. A new model version might improve a public benchmark score by 3 points and still regress your specific task, because your prompts, retrieval sources, and edge cases were never part of that benchmark's design.

Practical questions each format actually answers:

  • Benchmarks: Which base model has the strongest general reasoning for the price? Is this model competitive on coding or maths tasks?
  • Evals: Does our RAG pipeline retrieve the right document 90% of the time? Does our voice agent handle interruptions without losing context? Did the last prompt change break anything that used to work?

Release cadence reinforces the split further. You benchmark once, maybe twice a year, when evaluating a model swap. You eval on every commit, every pull request, and continuously in production, because your product surface changes far more often than the underlying model does.

Building your first golden dataset from real traces

Everything downstream, your judge prompts, your CI gates, your production alerts, depends on the quality of your golden dataset. Get this step wrong and every automated check built on top of it inherits the same blind spots.

Start by capturing enough context per trace to actually understand what happened:

  1. Input and full prompt sent to the model, including system instructions and any injected context.
  2. Output the model returned, verbatim, with no post-processing applied.
  3. Tool calls made during the interaction, their arguments, and their return values.
  4. Retrieved context if you're running RAG, including which documents or chunks were pulled.
  5. Timing and cost data, since a technically correct answer that takes 40 seconds is still a failure in most products.

Once you have 50 to 100 traces captured, run what practitioners call open coding: read every trace without a preconceived taxonomy and write a short note on what went wrong, if anything. Don't force traces into categories you invented before reading them. Let the failure modes emerge from the data. You'll typically find your failures cluster into several categories, things like incomplete tool calls, hallucinated facts not present in retrieved context, tone mismatches, or incorrect refusals, and that taxonomy becomes the backbone of your eval criteria.

From there, build your golden set. Most mature teams land on a labelled set with enough examples to cover their failure taxonomy thoroughly: enough to cover your failure taxonomy with a handful of examples per category, small enough that a human can still review the whole set in an afternoon when recalibrating. Balance matters more than volume.

Hands labeling AI dataset on tablet

Label each example with a binary pass or fail rather than a five-point Likert scale. Binary labels produce cleaner regression signal than fine-grained scores, because a 3-out-of-5 rating is ambiguous when you're deciding whether to block a deployment. Pass or fail forces a decision, and decisions are what CI gates actually need.

Pro Tip: Keep a "hard negatives" folder inside your golden set, traces where the model almost got it right but failed on a subtle detail. These are far more valuable for catching regressions than obvious failures, because subtle drift is what slips through casual review.

Structuring your dataset: schema, format and version control

A golden set without a schema is a liability waiting to happen. The moment two team members label examples slightly differently, or a new field gets added inconsistently, your dataset quietly degrades and nobody notices until a CI job starts passing things it shouldn't.

Store trace-level examples as JSONL, one JSON object per line. JSONL is the de facto format for this kind of data because it's streamable, diffable in version control, and trivially easy to append to without rewriting an entire file. A typical record looks like this:

{"id": "trace_0042", "prompt": "...", "context": ["doc_1", "doc_3"], "response": "...", "tool_calls": [], "label": "pass", "annotator": "j.smith", "timestamp": "2026-01-14T10:32:00Z"}

Required fields worth standardising across your team:

  • prompt and context: exactly what the model saw, with no summarisation or truncation.
  • response: the raw output, unedited.
  • tool_calls: structured record of any function or retrieval calls made.
  • label: binary pass or fail, plus an optional short reason code.
  • annotator and timestamp: who labelled it and when, for provenance and recalibration tracking.

Validate every record against a formal schema using JSON Schema rather than trusting ad hoc checks. Wire schema validation into CI so a malformed record can't sneak into your golden set through a rushed pull request. This single guardrail catches a surprising share of dataset corruption before it costs you a debugging session three weeks later.

Treat your golden set like source code. Store it in the same version control system as your application, tag releases alongside model or prompt changes, and never edit an example in place without a commit that explains why. Provenance matters here: if a label changes six months from now, you want to know who changed it, when, and against which model version it was originally calibrated.

How do you choose the right eval metrics?

Pick metrics that map directly to what breaks in production, not metrics that sound impressive in a deck. A team building a customer support agent and a team building a code generation tool need almost entirely different measurement stacks, even if both are "LLM applications."

Common metric categories worth knowing:

  • Groundedness or faithfulness: does the response stick to what's actually present in retrieved context, or does it invent details? Critical for RAG systems.
  • Task completion rate: did the agent actually accomplish what the user asked, end to end, including any required tool calls?
  • Hallucination rate: how often does the model state something false or unsupported as fact?
  • Latency and cost per interaction: a correct answer that costs 20x the target budget or takes too long to be useful still fails the product test.

The mistake most teams make early on is picking a single headline metric and optimising it in isolation. A support bot chasing a high task-completion score can quietly get pushier and less helpful in tone, because tone was never measured. Run multiple metrics in parallel and report them with confidence intervals rather than a single point estimate, particularly when your sample sizes are still small.

Set regression thresholds based on your current baseline, not an arbitrary industry target. Thresholds should tighten over time as your dataset and judges mature, not stay fixed forever.

Building an LLM judge you can actually trust

LLM-as-judge is powerful and easy to get wrong in ways that aren't obvious until you've shipped a broken one. The core risk is self-preference: a judge from the same model family as your generator tends to rate that family's outputs more favourably, which quietly poisons your regression signal.

Follow this build sequence:

  1. Choose a judge from a different model family than your generator. If your production model is from one provider, don't judge it with a model from that same provider's family.
  2. Write the judge prompt around your failure taxonomy, not a generic "rate this response 1 to 5" instruction. Reference the specific failure modes you found during error analysis.
  3. Use critique-shadowing to calibrate. Have a domain expert write detailed critiques of 20 to 30 example outputs, explaining their reasoning in full, then convert those critiques into few-shot examples for the judge prompt. This is what a practitioner's eval engineering guide calls the single highest-leverage step in judge design.
  4. Measure agreement against your golden set using Cohen's kappa, not raw accuracy, since accuracy alone hides cases where the judge and human agree by chance.
  5. Iterate the prompt until agreement stabilises above 0.6 to 0.8 for general rubrics, and above 0.85 for anything safety-critical or compliance-relevant.

Watch for four well-documented judge biases: length bias (favouring longer responses regardless of quality), position bias (favouring whichever response appears first in a comparison), format bias (favouring outputs that look more structured, even when substance is equal), and family bias (favouring outputs from the judge's own model family). Mitigate these by randomising response order, stripping formatting before judging where possible, and periodically auditing judge decisions against fresh human labels.

Pro Tip: Recalibrate monthly, not once and forget. Agreement metrics drift as your product and traffic patterns change, and a judge calibrated against last quarter's failure modes can miss entirely new ones.

Deterministic checks vs probabilistic judges: choosing the right tool

Not every failure needs an LLM to catch it, and using one where you don't need it wastes latency and money. The skill is matching the check to the failure mode rather than routing everything through a judge by default.

Deterministic, synchronous checks belong inline, before a response ever reaches a user:

  • Schema validation on structured outputs (does the JSON parse and match expected fields?).
  • Regex or pattern matching for banned phrases, PII leakage, or required disclaimers.
  • Length limits, profanity filters, and format enforcement.

These run in milliseconds, cost almost nothing, and catch a meaningful share of production incidents before they ever ship. Treat them as your first line of defence, not an afterthought bolted on later.

Probabilistic LLM judges belong where the property being measured is genuinely subjective: tone, helpfulness, whether an explanation was actually clear, whether a refusal was appropriate given context. These run asynchronously, sampled from a percentage of production traffic, because running a judge on every single request at scale gets expensive fast.

None of the three layers replaces the others.

Which tools should you use to run evals at scale?

Open-source frameworks and hosted platforms solve different problems, and most mature teams end up using both rather than picking one dogmatically.

Open-source tooling wins on flexibility and cost when your team has the engineering capacity to integrate it directly into existing pipelines. OpenAI Evals gives you a framework for defining eval specs in code and running them against any compatible model, which suits teams that want full control over judge logic and don't want to depend on a third-party UI. The LangChain LLM evals resources cover the feedback loop between evaluation and agent development directly, which is useful if you're already building on that framework.

Hosted platforms earn their cost when you need calibration tooling, dashboards, and collaboration features out of the box, particularly for teams without dedicated ML infrastructure engineers. You trade some flexibility for faster time to a working dashboard your whole team can read.

Three tooling categories worth distinguishing when you're evaluating options: eval frameworks that define and run test specs, judge runners that execute LLM-as-judge calls at scale with retry and caching logic, and trace capture systems that log inputs, outputs, and metadata from production. Integrate whichever you choose directly into your CI pipeline and your existing monitoring stack, such as tracking LLM-related traffic in GA4, so eval results sit alongside the operational metrics your team already watches daily.

Diagram of LLM eval tooling categories and integration

Running evals in CI/CD and production monitoring

Different eval tiers belong at different points in your pipeline, and conflating them is how teams end up either too slow to ship or too blind to catch regressions.

  1. Per-commit evals: run a small, fast subset (10 to 20 golden examples covering your most critical failure modes) on every commit. Keep this under a couple of minutes so it doesn't block developer flow.
  2. Pre-release evals: run your full golden set, all 50 to 200 examples, plus your calibrated LLM judge, on every pull request headed for production and on every release candidate.
  3. Production sampling: continuously sample 5% to 20% of live traffic for judge review, weighted towards flagged errors, outliers, and low-confidence responses rather than a pure random sample.

Set alerting rules around meaningful drops, not noise. A single failed example in a sample of 200 isn't a regression; a groundedness score dropping five points across a rolling week almost certainly is.

Every production failure your monitoring catches should feed back into your golden set as a new labelled example. This is what actually closes the loop: a bug found in production today becomes a regression test that prevents the same bug from reshipping in three months. Teams that treat their golden set as a living document, growing with every incident, build eval coverage that compounds. Teams that treat it as a one-off exercise watch their coverage quietly go stale.

Avoiding the most common eval mistakes

The most expensive mistake is skipping error analysis and jumping straight to automation. Teams build an LLM judge, wire it into CI, and only then discover the judge was calibrated against a golden set that never captured their real failure modes. Fixing that after the fact costs far more than doing the traces first would have.

Watch for these patterns:

  • "Vibes" evals: someone eyeballs ten outputs, declares the system "looks good," and skips structured labelling entirely.
  • Premature automation: building an LLM judge before you have a golden set to calibrate it against.
  • Uncontrolled judge cost: running a full-size judge model on every single production request instead of sampling and distilling.
  • Static thresholds: setting a pass bar once and never revisiting it as your product and traffic evolve.

Cost control matters more than most teams budget for upfront. Set a per-run cost cap for your CI eval jobs, use a smaller distilled judge model for high-volume sampling, and reserve your most expensive, most capable judge for pre-release gates where accuracy matters most.

A practical three-phase maturity path: Phase one is manual, traces and spreadsheets, producing a documented failure taxonomy. Phase two is a calibrated golden set with an LLM judge wired into CI for pull requests. Phase three is continuous production sampling with automated alerting and a golden set that grows from real incidents.

Pro Tip: Resist the urge to skip straight to phase three. Every team that tries ends up rebuilding phase one's taxonomy work anyway, just later and under more pressure.

How Real-studios builds eval-driven AI systems for clients

When Real-studios delivers a custom AI agent, whether a RAG-based support tool, a voice agent, or an email automation, the eval stack isn't an add-on tacked on before launch. It's built alongside the system from day one.

A typical engagement runs through discovery and trace collection first, capturing how the client's real customer interactions actually look before any model gets selected. From there: building the golden set with the client's domain experts, calibrating an LLM judge against that set, wiring gating checks into the CI pipeline, and standing up production monitoring dashboards before go-live.

An eval pipeline that isn't calibrated against real traces from day one is a liability disguised as a shortcut. The teams that skip this step spend more time debugging silent regressions later than they saved by rushing to launch.

Deliverables typically include:

  • A documented failure taxonomy and JSONL schema tailored to the client's use case.
  • A calibrated golden dataset with provenance tracking.
  • CI gating jobs and a production monitoring dashboard.

Your next two to eight weeks: a practical starter plan

Start narrow, prove the workflow works, then widen scope. Trying to build a comprehensive eval suite before you've validated the basic loop wastes far more time than it saves.

  1. Weeks 1 to 2: pull 50 to 100 real traces, run open coding manually, and document your failure taxonomy.
  2. Weeks 2 to 4: build a golden set of 50 to 200 labelled examples in JSONL, validated against a JSON Schema definition, stored in version control.
  3. Weeks 4 to 6: draft your LLM judge prompt, calibrate with critique-shadowing, and target a satisfactory level of agreement measured by Cohen's kappa for your rubric.
  4. Weeks 6 to 8: wire fast checks into per-commit CI, full evals into pre-release gates, and start production sampling at 5% to 10% of traffic.

Consult the OpenAI Evals repository for framework patterns, the Evidently guide for applied tutorials, and LangChain's evals resources for feedback-loop design. If your team lacks the bandwidth to run this in parallel with feature work, Real-studios' automation services build the full stack, schema through dashboard, so you launch with monitoring already live rather than bolted on afterwards.

Writing evaluation prompts that mirror real usage

A judge prompt written against tidy, well-formed test cases will pass everything and catch nothing. Real users type incomplete sentences, switch languages mid-conversation, and ask for things your system was never designed to handle. Your evaluation scenarios need to reflect that mess, not a sanitised version of it.

Pull scenario ideas directly from your trace data rather than inventing them from a whiteboard. If your open coding surfaced a pattern of users asking follow-up questions that reference something three turns earlier, write eval scenarios that test exactly that. If a chunk of traffic comes through with typos, incomplete queries, or mixed English and another language, your golden set needs examples covering that, not just clean single-sentence prompts.

Build scenarios around adversarial intent too, not just accidental confusion. Include prompts designed to test whether your system leaks system instructions, follows injected commands from retrieved documents, or gives medical or legal advice it shouldn't. These are rarely common in raw traffic but disproportionately damaging when they slip through, so deliberately over-sample them relative to their natural frequency.

Vary difficulty deliberately across your scenario set: some straightforward happy-path cases to catch basic regressions fast, and some genuinely hard edge cases that stress the system's actual limits.

Automating the full evaluation cycle

Manual evals don't scale past a handful of releases before someone starts skipping steps under deadline pressure. Automation isn't about removing human judgement from evals; it's about removing the repetitive parts so human attention goes toward the failures that actually need it.

A mature automated cycle typically runs as an orchestrated pipeline: a trigger (commit, pull request, or scheduled production sample) kicks off trace collection, feeds those traces through your deterministic checks first, routes anything that needs subjective judgement to your calibrated LLM judge, and aggregates results into a single pass/fail summary with per-category breakdowns.

Result aggregation matters more than teams expect. A raw list of 150 pass/fail rows tells a reviewer almost nothing on its own. Aggregate by failure category, by prompt version, and by time window so a reviewer can spot "groundedness failures spiked after Tuesday's prompt change" in seconds rather than scrolling through raw output.

Orchestration tools handling this well tend to share three traits: they retry transient judge failures rather than treating an API timeout as a test failure, they cache judge outputs for identical inputs to control cost, and they surface aggregated dashboards rather than raw logs as the default view. Build these three behaviours in from the start. Retrofitting caching and retry logic after your judge bill triples is a painful, avoidable fix.

Evaluating multi-turn conversations, not just single responses

Single-turn evals miss most of what actually breaks in production conversational systems. A model can answer turn one perfectly and lose track of what the user said by turn four, and a single-turn eval will never catch that.

Capture full conversation traces, not isolated exchanges, when building your golden set for dialogue systems. Each labelled example should include the entire conversation history up to the point being evaluated, not just the final prompt and response pair. This matters because context handling failures, forgetting an earlier constraint, contradicting an earlier statement, losing track of a multi-step task, only show up when the judge can see the full thread.

Design specific failure categories for multi-turn behaviour: does the system correctly reference something the user said three turns ago? Does it handle a topic switch without awkwardly forcing the conversation back? Does it maintain a consistent persona and set of constraints across the full exchange rather than drifting?

Test conversation length distribution deliberately. Most golden sets skew toward short exchanges because they're easier to collect and label, but many real failures emerge specifically in longer conversations, six, eight, ten turns in, where context windows fill up and earlier instructions start competing with newer ones for the model's attention. Include enough long conversations in your golden set to catch this class of failure, even though labelling them takes longer per example.

Managing prompt versions inside your eval pipeline

Every prompt change is a new system, in evaluation terms, even when the underlying model stays identical. Treat prompt versioning with the same discipline as code versioning, because an untracked prompt edit is one of the most common sources of silent regressions.

Tag every golden set example and every judge run with the exact prompt version used to generate it. When a prompt changes, rerun the full golden set against the new version before it ships, and compare results side by side against the previous version's scores rather than in isolation. A prompt that improves one failure category while quietly regressing another is common, and you'll only catch it with that comparison.

Store prompts in version control alongside your application code and golden datasets, not in a separate document or a team member's notes. Treat a prompt change with the same pull request discipline as a code change: it should trigger the same per-commit eval subset before merge.

Watch particularly for regressions introduced by well-intentioned prompt "improvements," extra instructions added to fix one edge case that inadvertently change behaviour on cases that used to pass. This is one of the most common causes of the failures your CI gating should be catching before release, not after a user reports them.

Testing for fairness, robustness and safety beyond accuracy

Accuracy metrics tell you almost nothing about whether your system behaves safely under pressure or treats different users consistently. These properties need their own deliberate evaluation design, not an assumption that a system scoring well on task completion is automatically safe.

For fairness, build eval scenarios that vary demographic or contextual details while holding the underlying request constant, then check whether responses differ in quality, tone, or willingness to help. Differences here often surface subtly, a slightly shorter or more cautious response for one phrasing of an identical request, rather than as an obvious refusal.

For robustness, deliberately test with malformed input, contradictory instructions, and prompt injection attempts embedded in retrieved documents or user messages. A genuinely robust system degrades gracefully rather than failing unpredictably when it encounters something outside its training distribution.

For safety specifically, build a dedicated golden set covering your organisation's actual risk areas, harmful content generation, inappropriate advice in regulated domains, or data leakage, rather than relying on generic safety benchmarks that weren't designed around your product's specific exposure. Document how these evaluation decisions align with your organisation's risk posture, particularly as regulatory frameworks for AI continue to develop across different markets.

Run these checks with the same rigour as your functional evals, calibrated judges, tracked agreement scores, and CI gating, rather than as a one-off audit performed before launch and never revisited.

What the industry gets wrong about LLM evals

Most eval advice online skips straight to tooling. Which platform, which judge model, which dashboard, as though the hard part is a purchasing decision. It isn't. The hard part is the unglamorous week of reading fifty transcripts by hand and writing down what actually went wrong, and most teams try to skip it.

That's backwards, and the evidence throughout this playbook supports why: a judge calibrated against a golden set that never captured your real failure modes will pass things it shouldn't and flag things that don't matter. No amount of platform sophistication fixes a dataset problem.

The conventional advice also underrates recalibration. Teams build a judge once, hit a kappa score they're happy with, and never revisit it. Traffic patterns shift, prompts get edited, new failure modes emerge, and the judge quietly drifts out of sync with what a human would actually say. Monthly recalibration isn't bureaucratic overhead. It's the difference between a judge you can trust and one you're hoping still works.

If you take one thing from this: build the taxonomy before you build anything else. Everything downstream depends on it.

— Oded

Sources

Recommended

All guides