How do you integrate LLM eval into a CI/CD pipeline so regressions block merges?
Describe how to integrate LLM evaluation into a CI/CD pipeline as a quality gate. What components are needed, how is the regression threshold set, and what happens when the gate fails?
Trigger on prompt or model changes, score a frozen golden set against a stored baseline, and block the merge only when the drop beats both run to run noise and a significance test.
Think of a factory line that bottles soda. Before any recipe tweak ships, you pour a fixed set of 200 sample bottles and have the same taste-tester rate them. You keep last week's scores written down. If the new recipe scores clearly worse, the line stops and a person has to look before it restarts. The trick is the taste-tester is a little moody day to day, so you only stop the line if the new batch is worse by more than that normal moodiness, and worse on enough bottles that it is not just a fluke. You never swap the sample bottles between tests, otherwise you cannot tell whether the recipe got worse or the bottles just got harder. After the line restarts you also watch a few real customers quietly before serving everyone.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
6 min: trigger scope, frozen golden set, the statistical regression test, threshold versus trend, flaky-judge handling, on-failure behavior, golden-set maintenance, and the staging canary as the second gate.
Real products, models, and research that use this idea.
- Promptfoo runs as a GitHub Action that scores a checked-in eval set per PR and fails the check on a configured regression threshold.
- LangSmith and Braintrust both store baseline scores as artifacts and surface per-example regression diffs against the main branch run.
- OpenAI Evals lets teams register a frozen eval set and compare candidate prompt or model scores against a recorded baseline in CI.
- DeepEval ships pytest-style assertions so eval failures fail a CI job exactly like a unit test, with per-metric thresholds.
- Anthropic and OpenAI internally gate prompt and model changes on stratified golden sets plus staged canary rollout before full exposure.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow do you keep a flaky judge from blocking a clean PR or passing a real regression?
QWhy is trend tracking across merges needed if each PR already passes a threshold gate?
QHow do you maintain the golden set without invalidating historical comparisons?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Gating on a raw score drop with no significance test. Judge noise alone produces a few points of wobble, so a naive threshold either blocks clean PRs or waves through real regressions.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.