how-to

LLM Regression Testing in 2026 - How to Catch Quality Drops Before They Ship

LLM outputs are non-deterministic, so classic regression testing does not work out of the box. Here is how to build a regression suite that catches quality drops before they ship - a fixed test set, the right scorers, and a CI gate - with the three tools I use.

Published:

Software regression testing is a solved problem. You run the same tests on every change, and if one goes from pass to fail, the build breaks. Simple - because code is deterministic. Same input, same output, every time.

LLMs are not deterministic. Send the same prompt twice and you can get two different answers, so assertEquals falls apart immediately. That is why teams either skip regression testing for their LLM app entirely - and ship silent quality drops - or try to bolt on classic assertions and drown in false failures. Neither works. LLM regression testing needs a different shape: score behavior instead of matching strings, and compare distributions instead of single runs.

Here is how to build a regression suite that actually catches quality drops before they reach users.

Build a fixed test set

Regression testing lives or dies on the test set. You need a fixed, representative set of cases that does not change between runs - that stability is the whole point, because you are comparing the same inputs over time.

Pull 30 to 100 real examples from production logs, weighted toward the cases that matter and the edge cases that have burned you before. For each, record the input and what “good” looks like - the expected answer, a required field, a rule it must not break. This set becomes your baseline, so invest in it. A good LLM eval pipeline guide goes deeper on assembling one.

Choose the right scorer per case

Not every case needs an LLM judge. Match the scorer to the check:

  • Deterministic assertions where you can - is the output valid JSON, does it contain the required field, does it avoid a banned phrase. These are cheap, fast, and never flaky. Use them wherever the check is objective.
  • LLM-as-judge for fuzzy qualities - relevancy, faithfulness, tone, correctness against a reference. Powerful, but slower and it costs a model call per case.

Lean on deterministic checks as much as possible. They are the reliable backbone; judges are for what genuinely needs judgment.

Establish a baseline

Run the suite against your current production version and save the scores. This is the line every future change is measured against. Without a baseline, “did quality drop” has no answer.

Run on every change and gate the merge

Now the payoff. Wire the suite into CI so it runs on every pull request that touches a prompt, model, or the code around them. Then gate the merge: if scores regress past your threshold, the build fails. This is what stops a bad change from shipping instead of just logging that it happened.

Two things to get right:

  1. Account for non-determinism. Because a single run varies, look for a statistically significant drop against the baseline, not a one-run difference. Running each case a few times and comparing distributions smooths out the noise so you fail on real regressions, not luck.

  2. Set explicit timeouts. LLM-as-judge scoring takes minutes, not seconds. Without timeouts your CI job hangs.

The tools I use

Three tools cover regression testing, each with a different center of gravity. DeepEval vs Promptfoo vs Braintrust compares all three in depth.

Braintrust is the most turnkey. Its autoevals library ships working scorers - exact match, embedding similarity, LLM-as-judge factuality - and its CI/CD quality gates block a merge on a statistically significant regression out of the box. That is exactly the hard part above, handled for you: the significance test and the gate are native, not something you assemble. The gotcha is billing - it meters processed data by the byte with no hard spending cap, and the $0 Starter jumps straight to $249/mo. Set billing alerts on day one.

DeepEval fits Python teams. It is the closest thing to pytest for LLM apps - you write test cases, assert on 50+ research-backed metrics like G-Eval, and run deepeval test run in CI. The OSS framework is Apache-2.0 and free. The trade-off is cost and speed - nearly all metrics are LLM-as-judge, so a big suite runs up API bills and takes minutes, which is why the timeout advice above matters most here. And if you move to the Confident AI cloud, mind the pricing cliff from $200/mo to $2,000/mo.

Promptfoo fits teams that want tests in version control. Your evals are declarative YAML that lives next to your prompts, it does side-by-side prompt and model comparison, and it gates CI cleanly. It is MIT-licensed and free, and it doubles as the strongest red-teaming tool in the category, so security regressions get caught too. One note for 2026: OpenAI acquired Promptfoo on 9 March 2026 - both sides say it stays open source under MIT, but long-term OSS governance under a single owner is a fair thing to weigh. The free red-teaming is capped at 10k probes per month.

So which one?

  • You want CI gates that block regressions out of the box - Braintrust, with billing alerts on.
  • Your team writes Python and wants regression tests in pytest - DeepEval, with timeouts and cost modelled up front.
  • You want declarative YAML tests in git, free, plus red-teaming - Promptfoo.

The framework matters less than the discipline: a fixed test set, a baseline, and a gate that fails the build on a significant regression. That is what turns “we hope this change is fine” into “we know it is.” For the wider field, see the best LLM eval frameworks roundup.

Frequently Asked Questions

What is LLM regression testing?

It is the practice of re-running a fixed set of test cases against your LLM app on every change - a new prompt, a new model, a code edit - and comparing the scores to a known baseline, so a change that makes quality worse gets caught before it ships. It is the LLM version of software regression testing, adapted for the fact that outputs are non-deterministic and graded by score rather than exact match.

How do you regression test something that is non-deterministic?

You stop expecting identical output and start scoring behavior. Use deterministic assertions where you can (does the answer contain the required field, is it valid JSON), and score fuzzy qualities (relevancy, faithfulness) with metrics rather than string equality. Because a single run can vary, you compare distributions and look for a statistically significant drop against the baseline, not a single-run difference. Running each case a few times smooths out the noise.

How do I add LLM tests to my CI pipeline?

Store your test cases in version control, run the suite on every pull request, and fail the build if scores regress past a threshold. DeepEval runs as deepeval test run in a pytest pipeline, Promptfoo runs from declarative YAML in CI, and Braintrust exposes CI quality gates that block a merge on a statistically significant regression. Set explicit timeouts, because LLM-as-judge scoring takes minutes, not seconds.

Which tool is best for LLM regression testing?

Braintrust is the most turnkey - its CI gates block a merge on a statistically significant regression out of the box, with autoevals scorers included. DeepEval fits Python teams that want regression tests in a pytest suite. Promptfoo fits teams that want declarative YAML tests in version control plus red-teaming, and it is free under MIT. All three gate CI - pick on whether you prefer a managed platform, a Python framework, or config files.

Explore More

Free Newsletter

Get the LLM Evals Newsletter

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

Related Articles