Satchel Hamilton
← Work
Solo design & build · 2026

Gatecheck: an eval harness that fails CI when an LLM change makes things worse

It turns "does the new prompt feel better?" into a number you can diff, gate a pull request on, and track over time, with cost and latency per model.

Source ↗PyPI ↗

Gatecheck is a small eval harness for LLM apps. You write task suites in YAML. It grades the outputs with plain code checks, an LLM judge, or both, and it fails your CI build when a prompt or model change makes things worse. It also tracks cost and latency per model.

This essay explains the design, including where the comparison to hardware verification stops working.

The problem

Prompting a few examples and reading the output doesn't scale, and it can't block a bad change. A team needs test cases grouped by what they measure, checks that give the same result on every commit, and a way to fail the build when a prompt edit or a model swap makes quality drop.

How it works

  • Suites are plain YAML. Adding a test takes no code.
  • Three kinds of grader. Deterministic checks: exact, contains, regex, json_schema, and command, which runs a command on the output to see, for example, whether generated code compiles. A forecast grader that scores a probability against the outcome. And an LLM judge, one model or several, that scores 1 to 5 against a rubric for things string matching can't see, such as faithfulness and tone.
  • A baseline and a gate. Snapshot today's pass rates. Later, exit non-zero when a suite drops below the baseline, with an optional tolerance or an absolute floor.
  • Five providers behind one interface. Ollama (local, free, no key), OpenAI, Anthropic, Google Gemini and Amazon Bedrock. Each is a plain HTTP adapter. The Bedrock one signs its own requests, and the signer is checked against test vectors.
  • Your own code can be the target. python:module:function points a suite at your application, so retrieval, model calls and what you do with the answers are tested together.
  • Record once, gate offline. --record saves every model call a run makes. --replay answers them from that file, so the gate runs on a pull request with no keys and no cost.

Which results can fail a build

Deterministic graders gate CI. The LLM judge does not. A judge measures real quality, but it doesn't give the same answer every time, so it runs locally or on a schedule and informs without blocking.

The bundled suites showed why. Grading the same faithfulness outputs with a stronger judge changed which model looked worst. The weaker judge also failed an answer that was demonstrably correct, one the deterministic grader passed.

Two smaller rules keep the numbers straight. A task passes only if every deciding grader passes, and the pass rate counts only tasks that produced a verdict. Pass rates come with 95% confidence intervals, and local or unlisted models are priced at $0 instead of a guess.

A real run

I ran every bundled suite against two local models and one hosted model. All three failed the same structured-output task in the same way: each returned valid JSON with a made-up container key.

When three models fail identically, the task is the problem. This one asked for JSON that fit a schema without saying what the shape was. I fixed the suite to name the expected keys, and all three passed. The report, the dashboard and the transcripts from that run are committed in the repo, failures included.

Where it's used

Countercheck uses Gatecheck twice: as its model layer, and to gate its own grader. Every answer a person has decided becomes a task, and a change to the grader has to pass the gate.

Why it's small

promptfoo, Inspect AI and Braintrust are good tools, and heavier than many projects need. Gatecheck has three runtime dependencies, no account, no telemetry and no Node toolchain. You can read it in an afternoon, and everything it writes is a plain file you can diff and commit. If you need distributed eval infrastructure, use the bigger tools.

What it can't do

  • Recording sees httpx calls only, and the calls have to happen in the same order on every run.
  • Without a recording, Gatecheck can't see what the calls inside your own function cost.
  • A changed prompt is a different request, so a replay fails until the run is recorded again.