Score and compare¶
Evaluators score a run after it ends, from its log alone. Agents never see them, and they never see the agents.
Built-in checkers¶
evaluators:
- {use: outcome, config: {agent: x}} # passes if x won
- {use: outcome, config: {agent: x, expect: draw}} # win, draw, lose or finished
Results go to <log>.eval.json and are printed after the run:
finished: x wins in 5 steps, cost $0.0000 -> runs/tic-tac-toe-cli-3.jsonl
outcome: passed (score 1.0)
A judge model¶
Any agent adapter can grade a run against a rubric. The judge sees a transcript of the log
and answers {passed, score, reason}; its cost is reported separately from the run's.
evaluators:
- use: judge
config:
rubric: "Did x explain its moves clearly and stay polite in chat?"
agent: {use: ollama, config: {model: "llama3.2"}}
Agents write the transcript, so the judge is told to treat it as data and ignore any instructions inside it.
Your own checker¶
An evaluator is a class with evaluate(log). This one comes from the treasure-hunt example:
--8 < --"examples/treasure/treasure_checker.py"
Many runs¶
agentplaykit play examples/treasure/scenario.yaml --runs 20
treasure: 20 runs, seeds 1 to 20
reasons: finished 17, step_limit 3
outcomes: none 3, seeker 17
steps: mean 20.30, stdev 14.91, min 1, max 40
cost: mean $0.0000, max $0.0000, total $0.0000
treasure: pass rate 35% (7/20), mean score 16.8235
summary -> runs/treasure-summary.json
Run i uses seed base + i, so any single run can be reproduced on its own, and the same
inputs always give an identical summary file.
Comparing models fairly¶
Every model adapter sends the same prompt. Keep the scenario, seeds and limits the same,
change only the agent's use line, and compare the summaries. Language models are not fully
deterministic, so compare pass rates over many runs rather than single games.