How to Evaluate LLM Applications Before They Ship

The short answer

Evaluating an LLM application means building a fixed set of real test cases, scoring outputs with a mix of deterministic checks and LLM-as-judge, and re-running that suite on every prompt or model change. Treat it like a test suite, not a one-time demo. Tools like Ragas, DeepEval, and promptfoo make this repeatable instead of ad hoc.

If you have shipped an LLM feature and then watched it quietly get worse after a prompt tweak or a model swap, you already know why evaluation matters. This is for engineering leads and founders who need a repeatable way to know whether their AI feature actually works, not just whether it worked in the demo they ran last Tuesday.

Why can't you just test an LLM app like regular software?

Because the output is non-deterministic and the correctness bar is often fuzzy, not binary. A regular unit test checks that add(2, 2) equals 4, every time. An LLM summarizer might produce five different, all-reasonable summaries of the same document. You cannot assert exact string equality, so you need evaluation methods built for probabilistic output: graded scoring, semantic similarity, and judgment calls that are themselves consistent enough to trust.

This is also why so many AI features that look great in a demo fall apart in production — the demo was one lucky run through one easy input, not a representative sample of the thousand weird things real users will type.

What is an eval set and how big should it be?

An eval set is a fixed, versioned collection of real (or realistic) inputs with either a known-good answer or clear grading criteria, that you run every time something changes. It's the single most important artifact in this process, more important than any specific metric or tool.

A few rules we follow building eval sets for clients:

  • Start from real logs, not invented examples. Pull 50-200 actual user queries, documents, or conversations once you have any usage, or write realistic ones from support tickets and sales calls before launch.
  • Over-represent edge cases: ambiguous questions, adversarial inputs, empty or malformed data, non-English text if you serve global users, and the "I don't know" cases where the right answer is for the model to say so.
  • Keep it versioned in your repo like code. Every prompt change gets run against the same eval set so you can compare apples to apples.
  • Grow it over time. Every production bug you find becomes a new eval case, so you never regress on something you already fixed.

A workable starting size is 50-100 cases for a narrow feature, growing toward 200-500 for something with many distinct user intents. More cases beat a bigger model almost every time we've measured it.

What metrics actually matter for LLM evaluation?

The right metrics depend on the task, but most production LLM apps need some mix of these:

  • Faithfulness / groundedness — does the answer only state things supported by the provided context or source documents? Critical for RAG and document Q&A.
  • Answer relevancy — does the response actually address what was asked, not a tangential but plausible-sounding answer?
  • Context precision/recall — for RAG systems, did retrieval pull the right documents, and did it pull enough of them?
  • Task success rate — for agents, did the sequence of tool calls achieve the actual goal, not just produce a nice-looking transcript?
  • Latency and cost per request — a 95th-percentile response time and a per-request token cost, because a feature that's 2% more accurate but 4x the cost often isn't worth shipping.
  • Refusal / safety rate — how often the model correctly declines unsafe or out-of-scope requests, and how often it wrongly declines safe ones (over-refusal is its own failure mode).

We typically track 3-5 metrics per feature, not fifteen. A dashboard nobody reads is worse than no dashboard.

What is LLM-as-judge and can you trust it?

LLM-as-judge means using a second LLM call to grade the output of your primary model against defined criteria, instead of (or alongside) a human reviewer. Used carefully, it works: judge models now agree with human reviewers roughly as often as two human reviewers agree with each other, according to Confident AI's 2026 guide.

The technique that makes this reliable is called G-Eval: instead of asking the judge model for a blunt 1-5 score, you have it generate explicit evaluation steps from your grading criteria first, then score against those steps, and average token-level confidence across possible scores rather than collapsing to a single integer. This produces more stable, reproducible scores across repeated runs.

A few things to get right if you use LLM-as-judge:

  • Use a stronger or differently-trained model as judge than the one being evaluated, to avoid a model rating its own answers favorably.
  • Give the judge explicit, written grading criteria — not "is this good?" but "does this answer cite a specific clause from the source document, and does it avoid stating anything not present in the source?"
  • Sample rather than grade everything in production. A common pattern is grading 5-20% of live traffic plus 100% of flagged errors, keeping judge cost under roughly 10-15% of total inference spend, per FutureAGI's 2026 best-practices writeup.
  • Spot-check the judge against human review periodically. If the judge drifts, your whole eval suite is quietly lying to you.

What tools should you actually use?

You do not need to build an eval framework from scratch. Three open-source tools cover most needs, and it's common to use more than one together:

ToolBest forNotes
RagasRAG-specific scoring: faithfulness, context precision/recall, answer relevancyPurpose-built for retrieval-augmented pipelines; the default choice if your app is a document or knowledge-base assistant
DeepEvalGeneral-purpose LLM app and agent testingpytest-style API, 50+ built-in metrics including G-Eval, integrates cleanly into CI/CD
promptfooModel/prompt comparison and red-teamingDeclarative YAML config, strong for comparing providers (GPT vs Claude vs Gemini) and running adversarial test suites

Source: DeepEval's 2026 framework comparison. A typical setup: Ragas metrics for retrieval quality, wrapped inside a DeepEval regression suite that runs in CI on every pull request, with promptfoo used separately when comparing model providers or running security red-team probes.

How do you build regression testing into your release process?

Regression testing for LLM apps means: every time you change a prompt, swap a model, or update your retrieval pipeline, you re-run the full eval set and compare scores against the last known-good baseline before you ship. Concretely:

  1. Store your eval set and baseline scores in version control alongside the prompt/code that produced them.
  2. Run the eval suite automatically on every pull request that touches prompts, retrieval logic, or model configuration — not just on a schedule.
  3. Set a minimum score threshold per metric that blocks merge if the change regresses below it.
  4. Keep a small "golden set" of your worst historical failures as permanent regression cases, so a fix never silently breaks again.
  5. Re-run the full suite whenever the underlying model provider ships a new version, since behavior can shift even when your code hasn't changed.

This is the same discipline as software regression testing, applied to a system where the unit test has to tolerate reasonable variation instead of demanding an exact match.

How often should you re-evaluate in production?

Continuously, at a sampled rate, plus immediately after any prompt, model, or retrieval change. Set up logging that captures every production input/output pair with enough context to replay it, then route a sample through your judge pipeline daily or weekly. Alert on metric drift, not just on outright errors — a faithfulness score that slides from 95% to 85% over a month is a real signal, even if nothing "crashed."

What does an eval run actually look like in practice?

Take a document Q&A feature built on RAG, the kind we built for i2Ao's public-tender analysis tool. A single eval case looks like: input (a real tender document plus a question such as "what is the minimum insurance coverage required?"), expected behavior (an answer citing the specific clause in the CCAP, or an explicit "not specified in this document" if it genuinely isn't there), and a scoring rubric for the judge (faithfulness: does the cited clause actually say this; relevancy: does the answer address insurance specifically, not a nearby unrelated clause).

Running the suite produces a scorecard, not a single number: say 94% faithfulness, 88% answer relevancy, 71% context recall, with a list of the specific failing cases attached. That failure list is the actionable output — maybe retrieval is missing a document type, or the prompt needs a clearer instruction about which clause to prioritize when a document has overlapping sections. Each fix gets verified by re-running the same suite, and each fixed failure stays in the suite permanently as a regression guard.

What mistakes do teams commonly make when they start evaluating LLM apps?

  • Testing only the happy path. An eval set built entirely from clean, well-formed example questions will pass easily and tell you almost nothing, because production traffic is messier than any team expects until they look at real logs.
  • Treating one demo run as proof. A single successful pass through a feature, shown to a stakeholder, says nothing about the other 95% of inputs it will see. Eval sets exist precisely because demos are not evidence.
  • Grading with a single blunt pass/fail. Binary grading hides useful signal — a response that is 90% correct but misses one number looks identical to a complete failure unless your rubric captures degrees of correctness.
  • Never updating the eval set after launch. Production reveals failure modes nobody anticipated at design time. An eval set frozen at launch stops being representative within weeks.
  • Ignoring cost and latency as evaluation dimensions. A model swap that improves accuracy by 2% but triples response time or API spend is not automatically a win; it needs the same before/after comparison as any accuracy metric.
  • Skipping human review of the judge itself. Teams that set up LLM-as-judge once and never check it against human grading again tend to discover, months later, that the judge has been systematically over- or under-scoring a whole category of responses.

How we approach this at Venzpire

Every AI feature we ship gets an eval set before it gets a demo, built from real examples wherever they exist. We wire LLM-as-judge and deterministic checks into the same CI pipeline as the rest of the codebase, so a prompt change that regresses accuracy fails the build the same way a broken test would. If you're building an AI MVP or adding AI to an existing product and want evaluation baked in from day one rather than bolted on after the first embarrassing output, our LLM integration engagements include this as standard. Tell us about your project and we'll walk through what an eval set for your use case would look like.

Building something like this?

I read every application myself and reply within one business day, even when we’re not the right fit.

Frequently asked questions

How many test cases do I need in an LLM eval set?

Start with 50-100 real or realistic cases for a narrow feature, growing to 200-500 as you cover more user intents and edge cases. Quality and diversity of cases matters more than raw count — a small set of well-chosen adversarial and edge-case examples catches more real bugs than a large set of easy, similar inputs.

Can I use the same LLM as both the model and the judge?

You can, but it is risky: a model tends to rate its own style of answers more favorably, inflating scores. Where possible, use a stronger or differently-trained model as the judge, and periodically spot-check judge scores against human review to confirm they still track reality.

Do I need a dedicated eval tool, or can I just write my own scripts?

For a very small feature, custom scripts work fine initially. Once you have more than a handful of metrics or need CI integration, tools like Ragas or DeepEval save significant time: they handle metric calculation, judge prompting, and reporting so you are not reinventing well-tested logic.

How do I evaluate an AI agent, not just a single LLM call?

Agent evaluation adds task-success scoring: did the full sequence of tool calls and reasoning steps achieve the actual goal, not just produce a plausible-looking transcript. You typically need end-to-end test scenarios that check final state (was the ticket actually closed, was the email actually sent correctly) rather than just grading the final text response.

What is a good faithfulness score for a RAG system?

There is no universal number since it depends on your domain and risk tolerance, but most production RAG systems we have seen target 90%+ faithfulness (answers fully supported by retrieved context) before launch, with continuous monitoring afterward. A legal or medical use case should set the bar meaningfully higher than a casual internal tool.

How much does LLM evaluation add to my development cost?

Building a solid eval set and CI integration typically adds 10-20% to the development timeline of an AI feature, which is far cheaper than the cost of a production incident from an unvalidated change. Ongoing judge-model costs for sampled production monitoring are usually a small fraction of total inference spend.

Have an AI product worth building properly?

Tell us what you are building. Venktesh reads every application himself and replies within one business day.

Apply for a strategy call