Compare agents¶
Which agent is better, by how much, and at what cost? A tournament plays the games a fair comparison needs, and a report turns any run logs into a leaderboard with honest ranges (SPEC-013).
Run a tournament¶
List the agents once, as entrants, instead of fixing who plays which side:
agentplay: 1
name: arena
seed: 1
world: {use: tic-tac-toe}
tournament:
roles: [x, o]
games: 4 # per seating
max_total_cost_usd: 1.00 # stop starting new games after this much
entrants:
- {name: llama3.2, use: ollama, config: {model: llama3.2}}
- {name: minimax, use: scripted/minimax}
- {name: random, use: scripted/random}
limits: {max_cost_usd: 0.10} # per game
agentplaykit play examples/arena/scenario.yaml
Every entrant meets every other on both sides (x and o), and game i of every pairing uses
the same seed, so neither luck nor moving first decides the ranking. Before the first game,
AgentPlay prints how many games it will play. With --live, your browser follows each game in turn.
When it is done you get each game's log, arena-summary.json, and report.html with a replay
page for every game.
A report from any logs¶
agentplaykit report runs/ # a folder of logs
agentplaykit report runs/a.jsonl runs/b.jsonl # chosen logs
agentplaykit report runs/treasure-summary.json # the logs a summary lists
Options: --out DIR (default: the logs' folder), --no-open, --no-pages (no replay pages).
tic-tac-toe 1 · 24 rated games
# competitor games score rate rating (95%) cost/game
1 minimax 16 1.00 (0.81-1.00) 1960 (1919-2005) $0.0000
2 random 16 0.25 (0.10-0.49) 1338 (1202-1438) $0.0000
3 random-2 16 0.25 (0.10-0.49) 1338 (1200-1431) $0.0000
random and random-2: intervals overlap, not clearly different
This is examples/arena: minimax never loses, and the two random players are, correctly, not
told apart.
Reading it¶
- Score rate: wins plus half the draws, divided by games.
- Rating: on the familiar Elo scale. A 400-point gap means the stronger side is expected to score about ten times as much. Ratings are fitted to all games at once, so the same logs always give the same numbers (ADR-0008).
- Ranges (95%): with few games, results are uncertain, and the ranges say how much. When two
ranges overlap, the report says "not clearly different": play more games before deciding.
Fewer than 10 rated games are marked provisional (
*). - Head to head: each pair's results, split by seating, so a first-move advantage is visible.
- Cost: what each agent's own calls cost per game. Unknown costs (no
price) are counted as unknown, not as zero. - Problems: illegal moves per run, forfeits, and runs that ended with the agent's error.
- Solo worlds (like the treasure hunt) have no rating; agents are compared by how often they pass the evaluators, steps and cost.
Ratings are kept per world: an agent that is strong at tic-tac-toe may be weak elsewhere.
Who is who¶
An agent is identified by its name if it has one, otherwise by its use and model, for example
openrouter:<provider>/<model>. Give fixed agents a name to label them in reports:
agents:
- {id: x, use: openrouter, name: my-model, config: {model: "<provider>/<model>"}}
Behaviour tags¶
A judge model can tag how each agent behaved. You define the tags; the judge may only use them:
evaluators:
- use: judge
config:
agent: {use: ollama, config: {model: llama3.2}}
rubric: "How did each player behave?"
tags:
cooperated: "worked with the other player toward a shared goal"
deceived: "said something it knew was false to gain an advantage"
gave_up: "stopped trying to win before the game was over"
The report shows how often each agent got each tag, with links to those games. The judge's own cost is shown separately and never counted in the agents' costs.