Benchmark models on your own tasks for accuracy, speed, cost and output format
Public benchmarks tell you roughly where a model sits; they do not tell you whether it does your work, at your latency, in your format, for your budget. Leaderboard scores are sensitive to small changes in how questions are posed, and training-data contamination inflates absolute scores, although one 2026 study found it rarely changed the ranking. Use them to shortlist, then measure.
1. Shortlist
Section titled “1. Shortlist”- SHOULD shortlist three to five candidates per role from provider guidance, public leaderboards and models you already run, including at least one cheaper tier than you expect to need. Exclude any model or provider not approved for the data (BP-0046).
2. Build the task set
Section titled “2. Build the task set”- MUST build a private benchmark set from your own work: typically 50–200 representative tasks per role, including edge cases and every past failure you have a record of. Keep it off the public web so it cannot leak into training data (BP-0006).
- MUST give every task an automated check where possible (tests, schema validation, exact or set match), and a written rubric with a pinned judge model where not.
3. Run fairly
Section titled “3. Run fairly”- MUST give each model a fair setup: the same tools and task, prompts adapted to each provider’s guidance, each model’s recommended settings, and an effort or thinking sweep rather than one level (BP-0049).
- MUST run each task several times per model (at least 3, and 5 or more when the result is close), interleaving models so time-of-day load and caching affect them equally. Run through the same gateway, region and network you will use in production.
- MUST count errors, timeouts, refusals and truncations as failures, and confirm the work actually happened (the tool ran, the file was written) before scoring it (BP-0059).
4. Measure four things
Section titled “4. Measure four things”-
MUST measure:
Dimension Metrics Accuracy Task pass rate; rubric score; the rate of the dangerous error (for example a missed escalation), separately Speed Time to first token; output tokens per second; end-to-end task time including tool calls and retries; p50 and p95 Cost Cost per successful task, including retries, thinking tokens and cache effects Output format Schema-valid rate; required fields present; enum and casing correct; length and structure rules for prose -
SHOULD measure format both with and without the provider’s structured-output feature where one exists. Constrained decoding can guarantee schema-valid JSON, but still validate: refusals and output-length truncation can return output that does not match the schema, unsupported schema constraints may be dropped, enum casing can change, and the first use of a new schema adds latency.
5. Decide and record
Section titled “5. Decide and record”- MUST decide with hard gates first (minimum pass rate, maximum dangerous-error rate, minimum format validity, p95 time limit, data approval), then choose the cheapest or fastest model that passes all gates. Do not trade a gate for a lower price.
- MUST treat a difference smaller than the run-to-run spread as no difference, and report medians with ranges, not single numbers.
- MUST record the decision with the date, model versions, settings, results and the task set version, update the role table, and re-run the benchmark on new model releases, price changes and drift alerts (BP-0050).
When to apply
Section titled “When to apply”Choosing a model for a role, switching providers, adopting a new model release, or when cost, latency or quality complaints appear.
Examples
Section titled “Examples”Scorecard for an extraction role (illustrative):
| Model | Pass | Missed escalations | Schema-valid | TTFT p50 | Task p95 | Cost / pass | Gates |
|---|---|---|---|---|---|---|---|
| Large | 0.94 | 1% | 1.00 (structured) | 0.9 s | 7.8 s | $0.021 | pass |
| Mid | 0.91 | 2% | 1.00 (structured) | 0.4 s | 3.1 s | $0.006 | pass → chosen |
| Small | 0.79 | 9% | 0.97 | 0.2 s | 1.4 s | $0.002 | fails accuracy gates |
Gates: pass ≥ 0.90, missed escalations ≤ 3%, schema-valid ≥ 0.99, p95 ≤ 5 s.
Run summariser (Bun). Reads one JSON line per run and prints the four dimensions per model; errors count as failures:
// author: Stephen Eaton// score.ts — summarise benchmark runs per model: accuracy, format validity, speed, cost.// usage: bun score.ts runs.jsonl (one JSON object per run, schema below)type Run = { model: string; case: string; pass: boolean; schemaValid: boolean; ttftMs: number; totalMs: number; outTokens: number; costUsd: number; error?: string };
const pct = (xs: number[], p: number) => { const s = [...xs].sort((a, b) => a - b); return s[Math.min(s.length - 1, Math.ceil((p / 100) * s.length) - 1)];};
export function summarise(runs: Run[]) { const byModel = Map.groupBy(runs, (r) => r.model); return [...byModel].map(([model, rs]) => { const ok = rs.filter((r) => !r.error); const passes = ok.filter((r) => r.pass).length; return { model, runs: rs.length, errors: rs.length - ok.length, passRate: +(passes / rs.length).toFixed(3), // errors count as failures schemaValidRate: +(ok.filter((r) => r.schemaValid).length / rs.length).toFixed(3), ttftP50: Math.round(pct(ok.map((r) => r.ttftMs), 50)), totalP50: Math.round(pct(ok.map((r) => r.totalMs), 50)), totalP95: Math.round(pct(ok.map((r) => r.totalMs), 95)), tokPerSec: Math.round(pct(ok.map((r) => r.outTokens / ((r.totalMs - r.ttftMs) / 1000)), 50)), costPerPass: passes ? +(rs.reduce((a, r) => a + r.costUsd, 0) / passes).toFixed(4) : null, }; });}
if (import.meta.main) { const text = await Bun.file(Bun.argv[2]).text(); console.table(summarise(text.trim().split('\n').map((l) => JSON.parse(l))));}Anti-patterns
Section titled “Anti-patterns”- Choosing from a leaderboard alone.
- One run per task, so noise decides.
- Comparing a model at its best settings with another at defaults.
- Average latency only, ignoring p95 and time to first token.
- Cost per call instead of cost per successful task.
- Trusting structured output without validating it.
- Never re-running the benchmark after the decision.
Checklist
Section titled “Checklist”- Shortlist from public data; only approved models
- Private, representative task set with automated checks or pinned rubric judge
- Fair settings, effort sweep, several interleaved runs per task, production path
- Accuracy, dangerous-error rate, speed (TTFT, tokens/s, p50/p95), cost per success, format validity
- Hard gates first, then cheapest or fastest; noise treated as no difference
- Decision recorded; role table updated; re-run on releases and drift