Skip to content

< 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.

Start: Check one caseSign in to run steps and keep your progress.
  1. Part 01 · 3 steps

    The golden set

    Cases you trust, checked before anything runs on them.

    1. 01Check one casenext
    2. 02Load the set
    3. 03Pick the cases to run
  2. Part 02 · 6 steps

    Scorers

    An answer in, a number out, for every shape of expected value.

    1. 04Normalise an answer
    2. 05The answer holds the fact
    3. 06Several facts, partial credit
    4. 07Fields out of JSON
    5. 08A number, within tolerance
    6. 09Two more scorers, and the registry
  3. Part 03 · 4 steps

    A model as judge

    A rubric of yes/no points, asked of a real model, and read back as booleans.

    1. 10Write the rubric prompt
    2. 11Read the verdicts back
    3. 12Ask the judge
    4. 13Ask three times, keep the majority
  4. Part 04 · 6 steps

    Two versions, one verdict

    Better, worse, or just different: a margin decides.

    1. 14Score a whole run
    2. 15Wins, losses and ties
    3. 16The mean per tag
    4. 17Better, worse, or just different
    5. 18Find the flaky cases
    6. 19Get a version's answers from the real model
  5. Part 05 · 3 steps

    Traces

    Score what an agent did: did it finish, did it loop, did it start right.

    1. 20Spot a loop
    2. 21Score one trace
    3. 22Aggregate the traces
  6. 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.

    1. 23What got worse
    2. 24The report
    3. 25The gate
    4. 26Run it on the real model