how-to

How to Evaluate LLM Applications in 2026 - A Practical Guide

A working playbook for evaluating LLM apps - build a dataset, pick metrics that match the failure mode, run evals in CI, and watch production. With the tools that fit each step, and the traps that make eval scores lie.

Published:

Most LLM apps ship without real evaluation. The demo works, someone eyeballs a few outputs, and it goes to production - then quality quietly drifts and nobody notices until a user complains. Evaluation is the test suite that stops that. Here is how to actually build one, step by step, with the tools that fit each stage and the traps that make eval scores lie.

The core idea in one line: evaluation is not a benchmark you run once, it is a test suite you run on every change and on live traffic forever. Everything below serves that.

Step 1: Define the failure mode before the metric

Do not start with “what metrics exist.” Start with “how does my app fail.” A RAG support bot fails by hallucinating facts not in the retrieved docs. A summarizer fails by dropping key points or inventing them. An agent fails by taking a wrong action or looping. Each of those is a different metric.

Write down your top three failure modes in plain language first. Then map each to something measurable. Hallucination maps to faithfulness (does the output stay grounded in the source). A support bot maps to answer relevancy. An agent maps to task success. This mapping is the single most important step - a generic “accuracy” score that ignores your real failure mode will look fine while your app is broken.

Step 2: Build a dataset that looks like production

An eval is only as good as the inputs you test on. You need a dataset of representative cases: real or realistic inputs, and for each, either an expected output or a description of correct behavior.

Three sources, in order of value:

  1. Real production logs. The best dataset is the traffic you already serve. Pull real user inputs, especially the ones that failed, and label them.
  2. Hand-written edge cases. Add the inputs you are afraid of - adversarial prompts, empty inputs, out-of-scope questions.
  3. Synthetic generation. Fill gaps with model-generated cases, but treat these as filler, not the core.

Start small. Fifty well-chosen cases beat five hundred random ones. You can grow the set as production surfaces new failures. Dataset management is a first-class feature in the tools below - Braintrust, Langfuse and DeepEval all give you a place to version datasets so your test set is not a stale CSV on someone’s laptop.

Step 3: Pick metrics that match, and know their cost

Now attach metrics to the failure modes from step 1. The common ones:

  • Answer relevancy - does the output address the input.
  • Faithfulness / groundedness - does it stay true to the source context.
  • Hallucination - does it invent facts.
  • Task success - for agents, did it complete the job.
  • Exact match / embedding similarity - deterministic checks where a known-correct answer exists.

Most of these are LLM-as-judge: another model scores the output. That is powerful and flexible, but it has a cost you must plan for. DeepEval ships 50+ research-backed metrics including the widely-cited G-Eval, and nearly all of them are LLM-as-judge - so every test case fires another LLM inference. A big suite compounds into real API bills and runs take minutes, not seconds. Where a deterministic check works - exact match, embedding similarity - use it instead. Braintrust’s autoevals library gives you both: working LLM-judge scorers and cheaper deterministic ones out of the box.

Step 4: Run evals in CI on every change

This is where evaluation earns its keep. An eval you run manually is a demo. An eval that runs on every pull request is a safety net.

DeepEval is the most natural fit here for Python teams - it is pytest-style. You write test cases with assert_test, mark them with @pytest.mark, and run deepeval test run in your existing CI pipeline. It drops in like it belongs. The OSS framework is free under Apache-2.0, so you can do all of this without paying for the Confident AI cloud. One practical note: because the metrics are LLM-as-judge and slow, set explicit timeouts in CI or the job hangs.

If you want CI to actually block the merge on a regression rather than just report a number, Braintrust is the more turnkey choice. Its CI/CD quality gates block a merge when a change causes a statistically significant regression - not just log that quality dropped, but stop the bad code from shipping. That distinction matters: a warning everyone ignores is not a gate. The trade-off is billing - Braintrust meters “processed data” in GB counting every byte, with no hard spending cap, so set alerts on day one.

Step 5: Evaluate in production too

CI evals test a fixed dataset. Real users find inputs your dataset never imagined. So the last step is continuous evaluation on live traffic.

Langfuse is built for this. It traces production calls and runs LLM-as-judge scorers on live outputs, so you catch quality drift on real inputs, not just your test set. It is framework-agnostic, self-hosts free under MIT with only three features gated, and runs as an OpenTelemetry backend so you can send traces from any stack. Opik and Braintrust do online evaluation too, but if you want a free self-hosted place to watch production quality, Langfuse is the default. The catch is operational - the v3 self-host needs Postgres plus ClickHouse, Redis and S3-compatible storage - so budget the ops time or use the $29/mo managed Core tier.

Wire the same metrics into production as you ran in CI. When a production score drops, you have the trace to debug it and a candidate case to add back into your CI dataset. That loop - production surfaces a failure, it becomes a test case, CI catches it forever after - is the whole game.

The trap: trusting scores you did not calibrate

One honest warning that applies to every step. LLM-as-judge is the backbone of modern eval, and it has a reliability question reviewers raise consistently: you are using one AI to grade another. Judge scores drift with the judge model, judge prompts are sensitive to wording, and small datasets produce noisy numbers.

Four defenses:

  • Calibrate the judge against human labels on a sample before you trust it at scale.
  • Pin the judge model and the judge prompt so scores are comparable over time.
  • Use a dataset large enough for the statistical-significance checks the CI gates rely on.
  • Combine LLM-judge metrics with deterministic checks wherever a known-correct answer exists.

Putting it together

  • Python team that thinks in tests - DeepEval for CI, free under Apache-2.0.
  • You want CI to block bad merges automatically - Braintrust, with billing alerts on for the uncapped GB meter.
  • You need to watch quality on live production traffic - Langfuse, self-hosted free or $29/mo managed.

Build the dataset, match metrics to real failures, gate CI, watch production, and calibrate your judge. Do those five things and you have a real evaluation system instead of a demo that happened to work once. Every tool and price here is from each vendor’s public materials - this category ships breaking changes monthly, so we re-verify every 30 days.

Frequently Asked Questions

How do you evaluate an LLM application?

Build a dataset of representative inputs with expected behavior, pick metrics that match your actual failure mode (relevancy, faithfulness, hallucination, task success), run those metrics against the dataset in CI on every change, and monitor the same metrics in production on live traffic. The key is grounding metrics in real failures rather than a generic accuracy score, and treating eval as a continuous test suite, not a one-time benchmark.

What tools do you use to evaluate LLM apps?

DeepEval is the pytest-style framework for writing test cases and running them in CI - it ships 50+ research-backed metrics including G-Eval and is free under Apache-2.0. Braintrust is the most turnkey for regression testing, with CI/CD gates that block a merge on a statistically significant regression. Langfuse handles production-side evaluation and tracing, running LLM-as-judge scorers on live traffic, and self-hosts free under MIT.

Should LLM evals run in CI or in production?

Both, and they answer different questions. CI evals run a fixed dataset on every code change to catch regressions before they ship - DeepEval and Braintrust are built for this. Production evals score live traffic to catch failures your dataset never covered, since real users find inputs you did not imagine. Langfuse is designed for that online evaluation. Skipping either leaves a blind spot.

Why are my LLM eval scores unreliable?

Usually because the metrics are LLM-as-judge and the judge itself is imperfect - you are using one AI to grade another, which reviewers flag as a fair caveat. Scores drift with the judge model, judge prompts are sensitive to wording, and small datasets produce noisy results. The fixes are concrete - calibrate the judge against human labels, pin the judge model and prompt, use a large enough dataset for statistical significance, and combine LLM-judge metrics with deterministic checks where you can.

Explore More

Free Newsletter

Get the LLM Evals Newsletter

Platform comparisons, pricing changes and eval technique deep-dives. No spam.

Related Articles