Why this exists
Until now I have evaluated models by hand. A single task could take
hours: catching mistakes, including obvious typos, writing a solid
justification with examples, then a report, jumping between the
screen and my notes. A decent model catches much of that in a
second.
So I am building a harness to take over the repetitive part of that
work: a test suite written once, run against the model of your choice,
with every answer scored and a result you can compare with the
previous run. Grading open-ended answers is meant to move to an LLM
judge of your choice, which records its reasoning, not just its
verdict.
Status
The first of four planned stages is done; the second is
under way. The full loop works: a suite from a YAML file, a
call to the model, scoring, a results table and an exit code. Saving
run history to a database is in progress: the schema is ready, but
for now only the run header is saved, without the results.
Still to fix: the unit tests do not run yet, and the
--no-cache and --timeout flags are
accepted but do nothing yet.
How it is built
One pass, no concurrency. For each case in the suite, the harness
sends the prompt, gets one answer and runs every scorer attached to
that case against it.
-
Suites in YAML. A case is an identifier, a prompt and a list of scorers with their parameters. The suite lives in the repository next to the code, so every change to what you measure shows up in the diff.
-
One provider, one interface. For now an OpenAI-compatible client that records latency and token counts. Further providers are meant to plug into the same
complete(prompt) interface.
-
Scorers are plain functions. Each takes the answer and its configuration and returns a result with details. A new scorer is one function and one line in the registry, deliberately without a plugin system.
-
On-disk cache. Each answer is stored under a key made of the model name and the prompt text, so re-running an unchanged suite costs nothing and takes a moment.
-
Output for people and for CI. A table in the terminal and an exit code: 0 when everything passed, 1 when something did not.
-
Database (in progress). An SQLAlchemy schema for runs, cases, results, scores and failure labels, using SQLite by default.
What it measures today
The current version has four simple scorers. They compare text or
structure, not meaning: contains: "7" also passes on
“17”. The example suite has 6 general-knowledge cases,
such as the capital of Poland or the number of squares on a
chessboard. It demonstrates the loop rather than testing specific
requirements yet.
Scorers available in the current version.
| Scorer |
Passes when |
contains |
the answer contains the given text, ignoring case |
contains_any |
the answer contains at least one of the given texts |
max_words |
the answer has at most the given number of words |
valid_json |
the whole answer is valid JSON |
Roadmap
-
Stage 2. Run persistence in the database, a second model provider,
an LLM judge that stores its reasoning rather than just its verdict,
and a
harness compare A B command for comparing two
runs: it will show what went from PASS to FAIL and back.
-
Stage 3. Cases where the model writes code that is then run against
real pytest suites in a separate process, and a failure taxonomy
built from about 20 actually observed failures rather than guessed
up front.
-
Stage 4. A FastAPI wrapper, Docker Compose with Postgres, and
automated checks in GitHub Actions.