🚀 SaaS & AI — book a free roadmap call →
✦ AI & RAG apps that understand your business data →
⇄ Multi-marketplace order & inventory automation →
📅 Taking a limited number of new builds this quarter →
← All posts
AI / Engineering

How to know your LLM is right: a practical guide to AI evals

Every AI feature has two versions. There is the one in the demo, where the founder types the perfect question and the model gives a beautiful answer. And there is the one in production, where thousands of real users type things you never imagined, a prompt tweak silently breaks a case that used to work, and nobody notices until a customer complains. The thing that stands between those two versions is not a better model. It is evals — the test suite for AI.

In from prototype to production we listed evals as one of the four pillars of a trustworthy AI feature. This post zooms all the way in on that pillar: what an eval actually is, how to build your first eval set, how to score answers that have no single right form, and how to wire it all into the workflow so a regression can never ship unseen.

Why "it looks better" is not good enough

Traditional software is deterministic: the same input gives the same output, so a green test suite means the behaviour you care about still holds. AI breaks that assumption. Change a word in a prompt, swap a model version, adjust your retrieval, and the output shifts in ways you cannot fully predict. A change that fixes one case often quietly breaks three others — and because the output is fluent prose, the breakage reads fine at a glance.

Without evals you are flying on vibes: you eyeball a few answers, decide the change "feels better," and ship. Evals replace that feeling with a number. They turn "I think this prompt is better" into "this prompt scores 91% versus 84%, and here are the three cases it regressed." That is the entire game.

What an eval actually is

Strip away the tooling and an eval is three plain things:

That is it. An eval set is to an AI feature what a unit-test suite is to a normal codebase: a fixed collection of cases you run on every change, so you find out immediately when something you cared about stops working.

Where the cases come from

The single biggest mistake teams make is inventing eval cases at their desk. Cases you imagine are the easy ones — the happy path the demo already handles. The cases that matter come from the real world:

You do not need thousands to start. Fifty carefully chosen cases that cover your real distribution — the common paths, the tricky ones, and the "should refuse" ones — will catch more regressions than a vague sense that things seem okay. Start there and grow the set every time production surprises you.

Scoring: the genuinely hard part

Deciding whether an answer is "good" is where evals get interesting, because most AI outputs have no single correct string. There is a ladder of scoring methods, and you climb it only as far as the task forces you to:

Using a model to grade a model, safely

LLM-as-judge is powerful and treacherous in equal measure. A vague instruction like "rate this answer 1–10" produces noise — the same answer scores 6 one run and 8 the next. The fixes that make it reliable:

What it looks like in code

The mechanics are humble on purpose — a loop over cases, a scorer, an aggregate, a threshold:

# an eval run, in spirit
cases = load_cases("evals/support.jsonl")   # {input, expected, checks}
results = []
for case in cases:
    output = feature(case["input"])        # the thing under test
    score  = judge(case, output)             # exact / rules / LLM-as-judge
    results.append(score)

passed = sum(results) / len(results)
print(f"score: {passed:.0%} on {len(cases)} cases")
if passed < THRESHOLD:                      # the gate that stops a regression
    fail("below bar — do not ship")

Notice what the last two lines do: they turn the eval from a report you might read into a gate that blocks a bad change automatically. That is the difference between having evals and being protected by them.

Run them where they'll actually stop a regression

An eval set that lives on someone's laptop and gets run "when we remember" protects nobody. The payoff comes from making evals routine and unavoidable:

Common ways evals go wrong

Evals are the least glamorous part of building with AI and the one that most separates a feature people trust from a demo they abandon. They are also what make everything else safe to move fast on — you can swap models, rewrite prompts and refactor retrieval with confidence, because the suite tells you the instant you break something. It is the same discipline behind the knowledge assistant that knows when to stay quiet and the model choices we make per task.

Building an AI feature and not sure how you'll know it stays correct once it's live? That question — how do we measure this, and how do we keep it honest in production — is exactly where we like to start.

Talk to us about your AI project

Graph engineering explained simply: the tutorial for anyone who already knows RAG →