~/writing/2026/llm-evals
Shipping an LLM feature with evals
We shipped an LLM-powered summary feature to every customer in six weeks. The model was the easy part. What made it shippable was treating evals as the spec: a golden set we argued over, graders we trusted, and a CI gate that blocks regressions the way unit tests do.
Start from the failure modes
The first demo looked great, which is the problem with first demos. Before we wrote a prompt, we wrote down how the feature could hurt someone: inventing a number that wasn’t in the source, dropping the one sentence that mattered, or confidently summarizing the wrong document.1
Each failure mode became a category in the golden set. That list did more to align product, legal, and engineering than any meeting we held.
Evals are the spec
A golden case is an input, the facts a good answer must contain, and the things it must never say. Grading mixes deterministic checks with a model-graded rubric, and every case is read by a person before it counts.
@golden("billing-dispute-017")
def test_keeps_the_amount(case, summarize):
out = summarize(case.document)
assert case.facts["amount"] in out.text # must-have fact
assert not out.mentions(case.other_accounts) # never leak
assert rubric.grade(out, case) >= 4 # 1–5, model-gradedWe kept the suite small on purpose. Two hundred and forty cases that people had actually read beat five thousand synthetic ones nobody trusted.
If you can’t say what a good answer looks like, you aren’t ready to ship the feature. You’re ready to research it.
One code path, two callers
The harness calls the same service production calls: same prompt template, same retrieval, same model gateway. Anything else and you’re evaluating a feature you don’t ship.
That constraint cost us a week of refactoring and saved us every week after. Prompt changes now arrive as pull requests with an eval diff attached, and reviewers read the diff before the prose.2
What production taught us
Offline scores were necessary and not sufficient. We sampled one percent of real summaries into a review queue and promoted the interesting failures into the golden set every Friday. The suite grew to 410 cases, and regressions caught in CI went from surprises to routine.3
The lesson I’d carry to the next feature: write the evals before the prompt, and give them an owner. A suite nobody maintains decays into a suite nobody believes. More on the team side of this in How my team changed the way we work with AI.
notes
-
The third failure was the scariest and the hardest to catch with string checks: a summary that was fluent, accurate, and about the wrong account. ↩
-
We render the eval diff as a table in the PR description: cases that flipped, grouped by failure category. ↩
-
The Friday triage takes thirty minutes and rotates across the team. It’s also the best onboarding we have for the feature. ↩
Thanks for reading. If this was useful, email me or follow new essays by RSS.