“It seems better” is how most prompt changes ship. That works until a small tweak silently breaks a case nobody re-checked. Evals are the fix: tests for LLM behaviour, run the same way every time.
Start with 30 real examples
You don’t need a benchmark. You need a file of real inputs with what “good” looks like:
{"id": "refund-01", "input": "Can I get a refund after 40 days?", "must_include": ["30 days"], "must_not_include": ["yes, of course"]}
{"id": "tone-02", "input": "your app is garbage", "rubric": "Stays calm, apologises once, offers one concrete next step."}
Pull them from support tickets, logs and the bugs you’ve already fixed. Every production failure becomes a new test case.
Three kinds of checks
- Deterministic checks: valid JSON, required fields present, length limits, forbidden phrases, correct tool called. Cheap, fast, unambiguous: use them wherever you can.
- Reference comparisons: does the answer contain the key fact? Does the extracted value match the expected one?
- Model-graded rubrics: another model scores the answer against a written rubric. Useful for tone, helpfulness and reasoning, but calibrate it against human judgement on a sample first.
Make the grader explain its score before giving it. You’ll catch bad rubrics quickly.
Run evals like tests
- In CI on every prompt, model or retrieval change.
- Track the pass rate per category, not just overall: a 2% drop overall can hide a 30% drop in one area.
- Pin model versions in eval runs so results are comparable.
- Keep the eval set in git next to the prompts it tests.
Evaluate retrieval separately
For RAG systems, test retrieval on its own: for each question, is the right document in the top results? When an answer is wrong, this tells you whether to fix retrieval or generation. (See RAG with Postgres and pgvector for the retrieval side.)
Online signals
Offline evals catch regressions before release; production tells you what you missed. Watch thumbs-down rates, retries, abandoned conversations and escalations to humans, and feed interesting failures back into the eval set.
Where evals fit in the job
Evals are the one genuinely new discipline in AI engineering; most other skills map to things software and SRE teams already do. That’s why they show up so often in AI engineer job postings in Toronto, and why they belong in any portfolio project.
FAQ
How many eval cases do I need?
Start with 20–50 real ones. Coverage of important behaviours matters more than volume.
Can I trust an LLM to grade another LLM?
Partly. Model-graded evals are useful when the rubric is specific and you’ve checked agreement with human ratings on a sample.
How often should evals run?
On every change to prompts, models, tools or retrieval, and on a schedule, to catch provider-side model changes.