< all projects26 steps · medium · Rebuild
Build an eval harness
You will have built an eval harness for an LLM feature, one function at a time, and run it on a real model: 3 functions that load and pick the golden set, 6 scorers for every shape of expected value, 4 that put a rubric to a model as judge and read the verdicts back, 6 that compare two versions and say better, worse or just different, 3 that score what an agent did from its trace, and 4 that print the report and decide whether CI passes. Each step is a few lines with its own tests, and the earlier functions are provided to the later ones. The golden set, two system prompts and the recorded answers of three versions are handed to you, and so is `model`, with one method, `chat(messages, tools, system, max_tokens)`. It is real: the steps that call it check properties (the right answer earned the point, this year's prompt beat last year's) and spend a little of your credits. The question every interview loop asks about evals is how you know a change made it better and not just different. This harness answers it with a margin, a per-tag breakdown, a flakiness check and a gate on the cases that must not regress. When every step has passed, the six files assemble into one harness, and the live run evaluates this year's prompt against last year's on the real model and prints both reports and the gate.
Part 01 · 3 steps
The golden set
Cases you trust, checked before anything runs on them.
Part 02 · 6 steps
Scorers
An answer in, a number out, for every shape of expected value.
Part 03 · 4 steps
A model as judge
A rubric of yes/no points, asked of a real model, and read back as booleans.
Part 04 · 6 steps
Two versions, one verdict
Better, worse, or just different: a margin decides.
Part 05 · 3 steps
Traces
Score what an agent did: did it finish, did it loop, did it start right.
Part 06 · 4 steps
The report and the gate
What a CI job prints, what makes it fail, and the run on a real model.