Lesson 05 · Applied LLM Engineering
Evals That Prove It Works
A demo shows the system worked once. An eval proves it keeps working — and building that proof is the deliverable customers actually pay for.
Here's the moment this lesson is built for: your demo landed, the customer is excited, and someone asks, "how do we know it'll still work next month?" A demo shows the system worked once, on inputs you picked, on a good day. An eval proves it keeps working — on inputs you didn't pick, after every prompt tweak, model upgrade, and data change. The market is explicit about this: Anthropic's FDE posting requires production LLM experience including "evaluation frameworks"4, and Databricks demands "expertise in deploying production-grade GenAI applications, including evaluation and optimizations."5 Evals aren't a QA afterthought. They're a named hiring bar.
The deliverable nobody asks for — until it's missing
Hamel Husain's field observation, from consulting across dozens of AI teams: unsuccessful AI products almost always share one root cause — a failure to create robust evaluation systems.1 The demo-to-production gap you met in Lesson 01 is, mechanically, an eval gap. Without evals, every change to the system is a gamble: you improve one case and silently break three others, and nobody notices until the customer does. For an FDE this has a sharper edge — the eval harness is often the artifact that survives you. You leave the site in six weeks; the harness is how the customer's own team keeps trusting, and safely changing, what you built.
Evals start before code, with success criteria. Anthropic's guidance: make criteria specific, measurable, and tied to the use case — not "the summaries should be good" but "the summarizer achieves an F1 score of at least 0.85 on the held-out set, and never includes patient-identifying information."3 The FDE move is to extract these numbers from the customer in discovery: what would make you trust this? What failure would make you switch it off? Those two answers become your first eval criteria.
The three-level framework
Hamel Husain's framework organises evaluation into three levels, distinguished by who or what does the judging and how often it runs.1 You don't graduate from one level to the next — a healthy system runs all three at different frequencies:
| Level | What it is | Judge | Runs |
|---|---|---|---|
| 1 · Unit tests | Fast assertions on outputs — format checks, forbidden strings, must-contain facts | Code | Every change (cheap, seconds) |
| 2 · Human & model eval | Grading real traces — humans review logs; an LLM judge scales the reviewing | Humans + LLM judge | Regular cadence (hours) |
| 3 · A/B tests | Measuring real user outcomes in production | Users | Late stage, high traffic |
Choosing a grader
Every eval case is a pairing of an input with a grader. Anthropic's test-development guide names the main grader families, and the skill is matching the grader to the claim you're trying to prove3 — exact match for claims with one right answer, similarity scoring for claims about meaning, and an LLM judge for claims about quality that resist mechanical definition:
| Grader | Use when | Watch out for |
|---|---|---|
| Exact match / code assertion | One right answer: a classification label, valid JSON, a required field, a forbidden string | Brittle on phrasing; useless for open-ended text |
| Embedding / similarity (cosine, ROUGE) | Output should mean the same as a reference answer, wording free | High similarity can mask a wrong critical detail |
| LLM-as-judge | Quality is real but fuzzy: faithfulness, tone, completeness against a rubric | The judge is a model too — persuasive when wrong, and it drifts. Must be validated |
Never ship an unvalidated judge
The LLM judge is the most powerful grader and the most dangerous, because an unvalidated judge just automates your blind spots — you've replaced "the model seems fine" with "the judge says the model is fine", and proven nothing. Hamel's fix is critique shadowing: a domain expert writes pass/fail judgments with critiques on real examples, you iterate the judge's prompt until its judgments agree with the expert's, and you keep measuring that agreement over time.2 The judge earns trust the same way a new team member does — by being checked against someone who knows. And critically, the expert must be the domain expert (the nurse, the claims assessor), not you.
Where do eval cases come from? The best ones are harvested from real failures. Every bug report, every "the AI got this wrong" complaint, every weird trace you notice in the logs becomes a permanent test case — this is how your eval set grows teeth over time. Hamel calls the habit "looking at your data": most teams skip it, and it's the single highest-leverage eval activity there is.1 Until real users arrive, seed the set with synthetic cases — enumerate the dimensions of your inputs (note type, specialty, messiness) and generate combinations with an LLM.1
🧪 Practical steps: an eval harness for your summarizer (~120 min)
In Lesson 02 you built a clinical-note summarizer and checked it by hand
against five criteria. Time to industrialise those hand checks into a harness that catches
regressions automatically — the single most quoted artifact type in FDE job postings. Full
instructions live in labs/0005-eval-harness.md; you can hand-roll it in Python
(shown, recommended first time) or use promptfoo7 —
the lab supports both.
- Curate an eval set — take your Lesson 02 test notes and grow the set to 10–12 cases (synthetic generation is fine), each saved as JSON with the input note and the facts that must and must not appear. This file is the portable asset.
- Turn your 5 hand checks into Level-1 assertions — plain Python functions: output parses, required fields present, no invented medications, no patient identifiers, length within bounds.
- Add an LLM judge with a written rubric — a second API call that grades each summary pass/fail on faithfulness and completeness, returning structured JSON with a critique.
- Validate the judge — hand-grade 5 outputs yourself before looking at the judge's opinion, then measure agreement. Below 4/5, fix the rubric and rerun — that's critique shadowing in miniature.
- Plant a regression — deliberately degrade the summarizer prompt (delete the grounding instructions from Lesson 04, or the "say only what's in the note" rule) and rerun.
- Produce the before/after report — a markdown table of scores per case for the good and degraded prompts. The harness must visibly catch the plant.
- Save everything to
D:\Projects\FDE-Portfolio\l05-eval-harness\— eval set, harness code, judge rubric, validation notes, and the report.
Feedback loop: bring your before/after report and your judge-validation notes back to me in chat, and I'll review them like a customer's tech lead would — do the assertions test real failure modes or just formatting, was the judge validated against human judgment honestly, and does the report prove the harness catches regressions? This artifact feeds the Lesson 11 capstone engagement and is tracked in the course's artifact tracker.
No chat here — this box replaces it. Copy the prompt into any AI assistant (Claude, ChatGPT, Gemini…), then paste your harness code, judge rubric, validation notes and before/after report after it.
You are a senior Forward Deployed Engineer reviewing my work: an eval harness for a clinical-note summarizer. It contains an eval set of ~10 cases, coded assertions, an LLM judge with a written rubric, notes validating the judge against 5 of my own human judgments, and a before/after report showing the harness catching a deliberately planted prompt regression. Grade each criterion as Strong / Adequate / Missing, with one sentence of evidence: - Assertion quality: the coded assertions test real clinical failure modes (invented medications, leaked identifiers, missing critical facts), not just output formatting. - Judge-validation rigor: I graded outputs myself BEFORE seeing the judge's opinion, measured agreement explicitly, and iterated the rubric when agreement was low — not just "the judge looks right". - Regression-catch demonstration: the planted degradation is realistic, and the before/after report shows the harness flagging it clearly, with scores per case rather than a single vague number. Be skeptical — probe whether my judge could be agreeing with me for the wrong reasons, and whether any assertion would pass on garbage output. Then ask me 2–3 questions a customer's tech lead would ask before wiring this harness into their CI. Finish with the single highest-leverage improvement. My eval harness materials follow below.
- Write 3 eval cases for one AI feature your company uses. Pick any AI feature at work, and write three input → expected-behaviour pairs, each with the grader you'd use. Twenty minutes, and you now think in evals.
- Turn one complaint into a test case. Find one recent "the AI got it wrong" complaint at work and reconstruct it as a reproducible case: exact input, what came out, what should have. That's failure-harvesting, live.
- Ask the trust question. Ask a colleague who owns an AI feature: "what would make you trust this enough to stop spot-checking it?" Their answer is a success criterion — write it down.
Check yourself — think like an FDE
Scenarios, not recall. Diagnose from the mental model — don't scroll up. Wrong picks stay live.
Scenario A
A health-insurer customer says: "the claims classifier must always output one of our 14 approved category codes, and its explanations must be professional in tone." You're designing the eval. Which grader pairing fits this requirement?
Scenario B
A teammate proudly demos their eval pipeline: an LLM judge grades every summarizer output against a rubric, and the dashboard shows 96% pass. Nobody has ever compared the judge's grades to a human's. The customer asks if they can rely on that number. What's the honest answer?
Scenario C
Mid-engagement, a customer ops manager says: "honestly, the triage assistant just feels off lately — the answers seem worse than last month." The logs show nothing obviously broken. What's the FDE move that turns this into something actionable?
Recommended learning
Hand-picked follow-ups. None are required — the primary source above comes first.
- Article Define success criteria & develop tests — Anthropic docs The current vendor reference for grader types (exact match, similarity, LLM-graded) and writing measurable success criteria — the lab leans on it.
- Article Using LLM-as-a-Judge to Drive Business Results — Hamel Husain The full seven-step critique-shadowing method — read after the lab to see the industrial-strength version of what you just built in miniature.
- Article promptfoo documentation — promptfoo The open-source eval runner used across the industry — the optional lab path, and a tool worth naming in interviews.
- YouTube Why AI evals are the hottest new skill for product builders — Hamel Husain & Shreya Shankar — Lenny's Podcast The framework's author walking through error analysis and eval practice live — the best long-form companion to this lesson.
- YouTube Start with PromptFoo in under 10 min A quick hands-on install-and-first-eval walkthrough if you take the promptfoo path in the lab.
References
- Hamel Husain, "Your AI Product Needs Evals" (2024) — the three-level framework; failed products share a missing evaluation system; looking at your data; synthetic case generation.
- Hamel Husain, "Using LLM-as-a-Judge to Drive Business Results" (2024) — the Critique Shadowing method for validating an LLM judge against domain-expert judgments.
- Anthropic, "Define success criteria and develop tests" (current) — measurable success criteria; grader types: exact match, similarity/ROUGE, LLM-graded.
- Anthropic, Forward Deployed Engineer, Applied AI — job posting (2026) — "Production experience with LLMs including advanced prompt engineering, agent development, evaluation frameworks".
- Databricks, AI Engineer, FDE — job posting (2026) — "Expertise in deploying production-grade GenAI applications, including evaluation and optimizations".
- OpenAI, Evals platform guide (2026) — platform deprecated: read-only Oct 31, 2026; shutdown Nov 30, 2026. Cited as a portability case study.
- promptfoo, documentation (current) — open-source eval and red-team CLI; the lab's optional tooling path.