# llm-bench A local LLM benchmark suite: coding, reasoning, retrieval and troubleshooting. Point it at any OpenAI-compatible endpoint, pick an instrument, and run. Pure stdlib Python — no packages needed. ## Quick start ```bash export LANE=example-lmstudio # a lane = endpoint + model + sampler + thinking + provenance (lanes/*.json) python3 bench.py conformance # preflight: rule out non-model problems (also runs before every `run`) python3 bench.py agentic-fix validate # prove tasks are well-formed (no model needed) python3 bench.py agentic-fix run --tier easy --samples 2 python3 bench.py sleuth run --samples 3 python3 bench.py report --out report.md # capability profile across lanes ``` Every run writes `bench/results////{run.json, items.jsonl, summary.json}` (append-only, never overwritten; `run.json` carries the lane record, a server snapshot and the harness git sha). Work dirs live in `work//…`. Both are gitignored. How instruments must use the core is in [CONTRACT.md](CONTRACT.md). ## Instruments ``` python bench.py [args...] ``` | Instrument | Command(s) | What it measures | |---|---|---| | `agentic-fix` | `validate` / `run [--tier easy\|hard\|all] [item ...]` | Bug fixes. easy: single-turn fixes run against hidden tests with the real toolchain (Go, Rust, TS, Python, shell, SQL; Swift on macOS only). hard: cross-file bugs in small projects, read-only tools + one submit_fix | | `agentic-multitask` | `validate` / `run [--tier easy\|hard\|all] [task ...]` / `cohort ...` | Build real small apps through tools. easy: Go+HTMX, Next.js+Prisma; hard: Rust CLI | | `sleuth` | `validate [case]` / `run [case]` | Troubleshoot a broken Linux host through a root shell in a container: right culprit, right fix, evidence actually seen, and how many checks it took vs an expert path | | `router` | `validate` / `run [--families route,orch,judge,rerank]` / `report` | Small helper models: dispatch (26 route + 8 orch, privacy axis), judging technical work (24 verdict + 8 pairwise, both orders), reranking (16 queries; top-1, MRR, NDCG@5) | | `needle` | `validate` / `run [--depths 1000,16000 --positions 0.5 --variants plain,decoy --seeds N]` / `report` | Needle-in-a-haystack retrieval (plain / decoy / multikey) + prefill speed per depth | | `loop-battery` | `run` / `report` | CoT runaway probes (5 prompts × N samples, repetition scoring) | | `reasoning` | `fetch` / `validate` / `run` | Computing knowledge: 60 MMLU-Pro computer-science questions, graded on content | | `conformance` | (none) `[--checks ...]` | Per-lane preflight: sampler vs model card, think-tag parsing, tool-call and JSON probes, provider swallowing output. FAIL = non-model problem (exit 1); WARN = the model's miss. Runs automatically before every `run` (cached 24 h per lane settings; `BENCH_PREFLIGHT=0` skips) | | `report` | (none) `[--ref LANE --out PATH.md]` | Capability profile across lanes from stored runs (CIs, paired deltas, status, cost/speed) | | `oracle` | (none) `--order cheapest,...,priciest [--simulate]` | Per-item cheapest-passing-lane labels + routing-policy simulation | Every `run` takes `--samples K`, `--concurrency N`, `--items id1,id2` and `--resume RUN_DIR` (a resumed run keeps the settings recorded in its run.json and retries only infra failures). ### Examples ```bash # Bug fixes: the easy tier only, then one hard item python3 bench.py agentic-fix run --tier easy python3 bench.py agentic-fix run --tier hard rust-allowlist # App builds: both tiers (easy then hard), 3 samples each python3 bench.py agentic-multitask run --samples 3 # Small-model helpers: judge and rerank only python3 bench.py router run --families judge,rerank # Needle retrieval at specific depths python3 bench.py needle run --depths 1000,16000,64000 # The Claude reference on sleuth (subscription, no API key) LANE=claude-opus python3 bench.py sleuth run --samples 3 ``` ## Bench details What each instrument asks, how it grades, and what is in it. Grading is mechanical everywhere (hidden tests, gates, regexes, gold labels); no model judges another. Item content is frozen: a run records its item set as `@`, so editing an item starts a new item set, and a report never pools two versions of one. The `max_tokens` / temperature / turn numbers below are instrument defaults; a lane's own settings win. Which file holds what: see Project layout below. ### agentic-fix — bug fixes The model fixes a bug, and the fix runs against tests it never sees. Two tiers, run separately (`--tier easy|hard|all`, default all). **easy** — 28 items, four per language. Item set `fix-easy@…`, category `easy/`. One message holds the symptom and the whole buggy file (SQL: the schema and one query); the model answers with the corrected file in a single fenced block. No tools, one turn, `max_tokens` 8000. The runner builds it and runs the hidden test with the real toolchain; SQL runs the query on a fixture DB in sqlite3 and compares the CSV output. Swift needs Xcode: elsewhere its rows are `skipped` (infra), never a fail. | Item | The bug | |---|---| | `go-average` | integer division before the float conversion truncates the mean | | `go-nilmap` | writes into a nil map (panic) | | `go-json-tags` | missing `json:"name"` tag, unexported `age` field | | `go-generics` | `make([]U, len)` then `append` leaves leading zero values | | `rust-sumeven` | filters odd numbers instead of even | | `rust-safediv` | divides by zero instead of returning `None` | | `rust-sumall` | unconstrained generic `T` can't be summed (doesn't compile) | | `rust-dedup` | removes from the vector while indexing it (out of bounds) | | `ts-sort` | default `sort()` compares numbers as strings | | `ts-reduce` | `reduce` without an initial value throws on `[]` | | `ts-matrix-alias` | `fill(new Array(...))` makes every row the same array | | `ts-closure-var` | `var` loop variable shared by every closure | | `swift-parseage` | force-unwraps a failed `Int()` parse | | `swift-median` | takes the middle element without sorting | | `swift-generic-max` | unconstrained generic `T` can't be compared (doesn't compile) | | `swift-mutating` | struct method mutates without `mutating`; caller holds a `let` | | `python-mutable-default` | mutable default argument keeps results between calls | | `python-strip-domain` | `rstrip(domain)` strips characters, not a suffix | | `python-df-columns` | `split(" ")` breaks on the runs of spaces in `df` output | | `python-prune-in-place` | removes from a list while iterating it, skipping items | | `sh-rotate-spaces` | unquoted paths break on spaces | | `sh-disk-threshold` | `[[ $used > $limit ]]` compares as strings | | `sh-failed-summary` | counter set inside a pipeline subshell is lost | | `sh-comment-out` | `read` without `-r` drops backslashes | | `sql-null-compare` | `= NULL` instead of `IS NULL` | | `sql-failure-rate` | integer division rounds every rate to 0 | | `sql-open-alerts` | a `WHERE` on the left-joined table drops hosts with no alerts | | `sql-public-disk` | a join fans out on hosts with two public addresses, double-counting disk | **hard** — 7 items, one small project per language (6-8 files, tests included). Item set `fix-hard@…`, category `hard/`. The model sees the failing test output, explores with read-only tools (`list_files`, `read_file`, `search`), then calls `submit_fix` once with the complete new contents of one file. The gate merges that file, restores the tests as written (so rewriting a test can't pass), and runs the project's test command: it must exit 0 with every named test passing. Explaining the bug takes reading at least two files, and no comment or name points at it. Each item ships plausible wrong fixes (usually the obvious patch at the symptom site, which breaks another test) that `validate` proves the gate rejects. 24 turns, `max_tokens` 4000. | Item | Project | Root cause | Tests | Wrong fixes | |---|---|---|---|---| | `go-kvstore-ttl` | in-memory TTL cache | `Set()` stores `expireAt = now` instead of `now + ttl`, so a `Get()` right after `Set()` misses | 3 | 1 | | `python-logrotate` | logrotate-style rotation planner | the config parser hands `maxage N` to a duration parser that reads a bare number as seconds, not days, so every rotated copy is deleted | 12 | 3 | | `rust-allowlist` | IPv4 allowlist merged into half-open spans | `Cidr::to_range` returns the block's last address as the exclusive end: each CIDR loses its last address and a /32 is empty | 9 | 3 | | `ts-cidr-allowlist` | CIDR allowlist, most specific / latest rule wins | a range's half-open end is passed on as an inclusive last address, so each range also allows the next address and a pinned deny flips to allow | 12 | 3 | | `sh-backup-retention` | backup retention pruner (keep daily / weekly / monthly / within) | `[ "$(is_leap "$y")" ]` is true for "0" too, so every year gets a Feb 29 and a keep-within window across a common-year February drops a 7-day-old archive | 13 | 3 | | `sql-backup-rpo` | backup-monitoring views (RPO verdicts, maintenance windows) | the maintenance view yields a NULL `host_id` for site windows, so the alert's `NOT IN` returns nothing | 6 | 3 | | `swift-engine-pin` | engine-pin OTA updater | `SemVer` declares `Comparable` without its own `==`; the synthesized one compares build metadata, so the updater reinstalls forever | 9 | 4 | ### agentic-multitask — app builds The model builds a small, real app from a written plan, starting from a scaffold. Tools: `list_files`, `read_file`, `write_file`, `edit_file`, `search`, `run_build`, `run_test`, `run_shell`. It says `DONE` when finished; the harness then kills whatever it left running and runs the gates itself. Item sets `multitask-easy@…` / `multitask-hard@…`, category `/`. correct = every gate passed; score = the fraction that passed. Rows record why the loop stopped (`done`, `max_turns`, `gave_up`, an error label) and a per-turn log. 40 turns, `max_tokens` 16000. | Task | Tier | What it builds | Gates | |---|---|---|---| | `go_htmx` | easy | Go web app: html/template + HTMX partials, embedded SQLite with a multi-table schema and a recursive-CTE location tree, assets via `go:embed` | build; test (≥1 passing Go test); serves (GET / has the tree and htmx); persists (a POSTed location shows in the fragment, a later GET / and the SQLite file) | | `ts_next` | easy | Next.js App Router + Prisma (SQLite), a Zod-validated API route, a server-rendered page | install; typecheck (`tsc --noEmit`); test (≥1 vitest test); serves (GET / 200, valid POST 201, invalid POST 400, GET lists the new item) | | `rust_cli` | hard | Rust CLI (tokio + reqwest + quick-xml) that fetches an XML device list behind HTTP Digest auth and prints `id\|name\|ip` | build; test (≥1 passing cargo test); fetches (prints the expected lines and the harness's mock served the XML to an authorized request) | `ts_next` resolves npm packages as of a fixed date (`npm_config_before`), so every run installs the same versions. The `rust_cli` mock checks Digest (MD5, MD5-sess, SHA-256, with or without qop) and also accepts Basic, which the plan mentions; the row records which scheme worked. ### sleuth — troubleshooting The model gets the owner's complaint and a root shell on a broken machine: a throwaway Docker container with no network. Tools: `run(command)` (60 s per command) and `submit_findings(culprit, root_cause, fix)`, which ends the attempt. 40 turns, `max_tokens` 8000. - **live** case: a really broken install (flattened image, no break script left behind). The model must fix it; afterwards the case's hidden check must pass. - **snapshot** case: a captured host (its files plus canned output for commands that need its kernel) entered with chroot. Diagnose only; the fix is graded by pattern. correct = three gates. **culprit**: every culprit pattern matches the culprit + root cause, and no reject pattern matches the culprit (so a shotgun list of suspects fails). **fix**: live, the check passes; snapshot, a fix pattern matches. **seen**: the key evidence was in output the model was actually shown before it submitted. Rows also measure how directly it got there: `checks` (commands run), `first_key_check` (the command that first showed the evidence), `expert_checks` (an expert's shortest path) and `investigate_s`. | Case | Kind | Complaint | What's actually wrong | |---|---|---|---| | `cpufreq-driver` (`sleuth/kernel`) | snapshot | Gentoo desktop sluggish after a hand-trimmed kernel rebuild | `CONFIG_X86_INTEL_PSTATE` went out with the trimmed options; acpi-cpufreq plus the powersave governor (chosen for intel_pstate) pins every core at 800 MHz | | `ingest-disk` (`sleuth/live`) | live | ingest stopped queueing batches, restarting it didn't help | /srv is full while `du` finds little: rotation deleted metricsd's log while metricsd still holds it open. Fixed by restarting metricsd | | `ramsleuth-channel` (`sleuth/code`) | snapshot | RamSleuth 2.4.14 reports a dual-channel kit as single-channel | `collect_from` reads `/sys/firmware/dmi/entries/17-N`, a directory, and `Err(_) => continue` swallows the EISDIR, so the SMBIOS dual-channel override never fires | | `ramsleuth-mts` (`sleuth/code`) | snapshot | RamSleuth says DDR4-3600 runs at 7200 MT/s | `decode_mclk` takes Alder Lake's MC_BIOS_REQ ratio × refclk, already the data rate, as the memory clock; the reports double it | The snapshot cases model a real Gentoo desktop (i5-12600KF, RX 9060 XT). The RamSleuth cases run the real source at a pinned commit (v2.4.14), with ground truth from the upstream 2.4.15 fixes. Needs a running Docker daemon; each case's image is built once and cached. ### router — small helper models Four families, each its own item set (`router-@…`), picked with `--families` (default all). Every answer is a JSON object or array. - **route** (26 items, `route/`): pick one worker for a request from a menu: `local_small` (~4B), `local_large` (~27-35B), `cloud_ollama`, `cloud_claude`, or `clarify` (ask first). Reply `{"target", "reason", "confidence"}`. correct = target in the item's acceptable set with no privacy violation (a local-only request sent to a cloud worker). Rows also record exact match, format fidelity and escalation error (> 0 over-escalated, < 0 under). Categories: trivial 4, simple 4, code 4, reason 2, hard 3, longdoc 2, overflow 1, privacy 3, clarify 3. - **orch** (8 items, `orch`): split a compound request ("summarize this error log, write a parser for it, draft a Slack message about the root cause") into steps, each with a kind (chat, extract, classify, summarize, math, code, debug, reason, longdoc, draft_message, web_search), a worker and dependencies. correct = every required kind present, every step on a capable worker, every required ordering reachable, no privacy violation. - **judge** (32 items): a small model grading computing work. 24 **verdict** items (`judge/`): does this candidate meet the task, pass or fail? 12 pass / 12 fail; the fails are near-misses (an off-by-one negative slice, `find -mtime -7`, `grep -c` under `set -e`, `COUNT(bool)`, a join missing its key, an invented log event, `proxy_pass` without a URI, cron's day-of-month OR day-of-week rule), the passes include terse or unusual correct answers. Reports false-pass and false-fail rates. 8 **pairwise** items (`pairwise/`): which of two candidates is better, asked in both orders (`/ab`, `/ba`) for position bias. Categories: code (Python, Go, Rust) 9, shell 7, sql 4, logs 4, config 4, answer 4. Code, shell and SQL gold labels were verified by running them. - **rerank** (16 items, `rerank/`): order 7-8 candidates by relevance to a query, `{"ranking": [ids]}`. correct = the one top-grade candidate ranked first; rows add MRR and NDCG@5 over graded relevance (0-3). Each item has hard negatives that share the query's keywords and a relevant candidate with little keyword overlap. Categories: code 4, logs 3, docs 3, commands 3, errors 3. ### needle — long-context retrieval A haystack of neutral office-log filler hides an access code; the model must return it. An item is (depth, position, seed, variant), category `needle//` (e.g. `needle/16k/decoy`). - **plain**: one code for one place. - **decoy**: an old, rotated-out code for the same place plus the current one; asks for the current. - **multikey**: five places with codes at five positions; asks for one. correct = the gold code is in the answer content and no decoy or other-key code is. Default run: depths 1k, 4k, 16k, 32k, 64k tokens × positions 0.1 / 0.5 / 0.9 × 3 variants × 1 seed = 45 items. Depth is built at an estimated 4.4 chars per token (`--cpt`); the server's `prompt_tokens` is recorded next to it, so a different tokenizer shows. Prefill speed per depth is averaged over uncached rows (llama-server lanes turn the prompt cache off). ### loop-battery — runaway reasoning Five prompts built to provoke over-thinking, 8 samples each by default (category `loop/`; temperature 0.6, `max_tokens` 16000). Rows record whether the answer ran to the token cap, the highest repeat count of any 10-word run (a hard loop scores high), and counts of re-derivation markers ("wait", "hmm", "let me reconsider", …) in the reasoning. correct = under the cap and the answer passes a deliberately loose acceptance rule (a floor for "didn't just comply", not a grader). | Probe | The trap | Accepted | |---|---|---| | `self-ref-wordcount` | state your answer's own word count | the stated number matches the word count | | `underdetermined-ages` | product-36 ages puzzle, sum never given | ages 2, 2, 9, or says information is missing | | `prove-false` | "prove every odd integer > 2 is prime" | says it's false or gives a counterexample | | `conflicting-opt` | the one language optimal on every axis | says there isn't one / trade-offs | | `ambiguous-pronoun-math` | fruit prices the last sentence contradicts | flags the contradiction, or answers 1.40 | ### reasoning — computing knowledge 60 MMLU-Pro computer-science questions (TIGER-Lab/MMLU-Pro test split, MIT), ten options A-J, category `cs`, item ids `mmlu-pro-cs/`. Run `fetch` once first: it downloads the set, picks the items deterministically (first 60 by `sha256("mmlu-pro-cs:")`) and caches them (gitignored); a committed manifest pins a hash per item, and `run` refuses a drifted cache. Graded on the last `ANSWER: ` in the content, never the reasoning. Details: [bench/data/reasoning/README.md](bench/data/reasoning/README.md). ### conformance — preflight (not a bench) Rules out non-model problems before a run. FAIL = the lane's settings are wrong or the pipeline lost or mangled the answer (blocks the run, exit 1); WARN = the model got a probe wrong but the answer arrived intact (recorded only; `report` lists each lane's latest WARNs). Runs automatically before every `run`, cached 24 h per lane settings in `bench/results/_preflight/`; `--resume` never re-checks, `BENCH_PREFLIGHT=0` skips. `--checks` picks groups by short name (`--list` shows them). | Check (`--checks` group) | What it verifies | |---|---| | `sampler_card` (sampler) | no request: the sampler the lane sends matches its model card in `lanes/cards.json`, unless `sampler_overrides` records the value and why | | `basic_reply` (basic) | a trivial question gets non-empty content | | `max_tokens` (maxtok) | `max_tokens=64` is honoured | | `reasoning_field` / `no_reasoning` (thinking) | thinking on: which field carries the reasoning (FAIL if none); thinking off: none leaks | | `system_messages` (system) | two system messages + a user message succeed | | `tool_roundtrip` (tools) | calls a tool with valid JSON arguments, then answers after the result | | `tc-*` (toolcalls) | 8 probes: a native call, a plain-text `` with no tools declared, bare JSON output, a question that needs no tool, two parallel calls, picking one of three tools, nested JSON, an argument derived from wording ("two and a half minutes"). FAIL when a call came back as text or the provider ate the output; WARN when a well-formed answer is wrong | | `think_tags` (think_tags) | no `` tags left in the content, none unclosed, the answer not stuck in the reasoning | | `provider_pin` (provider) | OpenRouter lanes: every response came from the pinned provider | | `determinism` (determinism) | INFO, not in the preflight: two temperature-0 runs identical? | | `server_snapshot` (server) | INFO, not in the preflight: n_ctx, slots, model ids | ### report and oracle — reading results **report** builds a capability profile from stored runs: rows are (instrument, category), columns are lanes. A cell is the mean over items of each item's mean score (or pass rate), with a 95% CI over items (Wilson when every item is pass/fail, else bootstrap). Sections: the profile; paired deltas against `--ref LANE` on shared items (with McNemar; default `claude-opus`, so deltas appear only where Opus has runs: the agentic instruments); preflight (each lane's latest conformance run, with its WARN and FAIL checks named; conformance never enters the profile); status per lane (truncation and infra rates); cost and speed; provenance. Only complete runs count unless `--include-incomplete`. Runs of one item set pool; two versions of one item set never do (they become separate columns, with a warning). `--out` writes markdown, `--json` / `--csv` the numbers. **oracle** labels each item with the lanes that pass it (pass rate ≥ `--theta`, default 0.67) and the cheapest passing lane in `--order` (or, with `--lambda-usd`, by measured time plus cost); `--simulate` replays routing policies over those labels. ## Configuration **Lanes.** `LANE=` loads `lanes/.json`, which owns the endpoint, model id, the full sampler, `max_tokens`, thinking on/off and the no-think mechanism, OpenRouter provider pinning, auth (`keychain_service` or `env`, never a literal key), the spend cap, and provenance (quant, runtime, ctx, KV). The client merges the lane into every request, strips reasoning from history and repairs non-JSON tool arguments before sending, retries 429/5xx-transient with backoff, and labels failures (`http_`, `timeout`, `oom`, `ctx_overflow`, `budget_stop`, …) so infra problems are never scored as wrong answers. Paid lanes go through `bench/results/_ledger/.jsonl` with a spend cap; it is a soft cap (concurrent calls can each pass the check and overshoot it). `LANE` is required for anything that calls a model; see `bench/core/lane.py` for every key. Each lane names its model card (`card`, a key of `lanes/cards.json`, which pins the card revision and its recommended sampler per thinking mode); `conformance` FAILs a lane whose sampler differs unless `sampler_overrides` records the sent value and a reason. A changed sampler is a new lane id: reports group by lane id. **Claude reference.** `LANE=claude-opus` (`"runner": "claude-cli"`) runs the agentic instruments (sleuth, agentic-*) on headless `claude -p` on the subscription: the instrument's own tools are served to Claude over MCP (`bench/core/claude_cli.py` + `claude_mcp.py`) and run in the bench process, so gates and rows are the same as for an HTTP lane. No built-in tools, settings, skills or CLAUDE.md; Claude Code sets its own sampler. Other instruments refuse a runner lane. **Environment** (copy `.env.example` to `.env`; env vars win over `.env`): | Var | Default | What | |---|---|---| | `LANE` | (none) | lane id (`lanes/.json`) or path to a lane file | | `MAX_TURNS` | per instrument (40; agentic-fix hard 24) | default of the agentic `--max-turns` | | `BENCH_PREFLIGHT` | `1` | `0` skips the automatic preflight before a run | | `BUILD_TIMEOUT` / `TEST_TIMEOUT` / `SHELL_TIMEOUT` | per language (Go 180/180/60, Rust 600/600/60, TS 120/120/300) | agentic tool + gate timeouts (s) | | `LEDGER_CAP_USD` | lane `cost.cap_usd` | override the spend cap | | `BENCH_RESULTS_DIR` / `BENCH_WORK_DIR` | `bench/results` / `work` | where runs and work dirs go | ### Compatible endpoints Anything that speaks OpenAI `/v1/chat/completions`: - **LM Studio** — `http://127.0.0.1:1234/v1/chat/completions` - **Ollama** (local) — `http://127.0.0.1:11434/v1/chat/completions` - **vLLM** / **llama-server** — `http://127.0.0.1:8000/v1/chat/completions` - **Ollama Cloud** — `https://api.ollama-cloud.com/v1/chat/completions` - **OpenAI** — `https://api.openai.com/v1/chat/completions` The preflight's tool-call probes use the OpenAI `tools` param; its XML/JSON probes use freeform text, so they work even on backends without native function-calling. ## Requirements - Python 3.9+ - Language toolchains for the tasks you want to run: | Toolchain | Needed for | |---|---| | Go 1.22+ | go fixes, go_htmx | | Rust 1.70+ (cargo) | rust fixes, rust_cli | | bun 1.0+ | ts fixes | | Node.js 18+ + npm | ts_next | | python3, bash, sqlite3 | python / shell / sql fixes (shell items stay bash-3.2-safe) | | Swift / Xcode | swift fixes (macOS only; skipped gracefully elsewhere) | | Docker | sleuth (a running daemon; first build pulls the pinned base images) | No Python packages needed — everything uses the stdlib. ## Adding your own tasks **Bug fix, easy** — add a dict to `ITEMS` in `bench/tasks/fix_easy/.py` (fields in that package's `__init__.py`). `validate --tier easy` proves buggy fails + fix passes. **Bug fix, hard** — add a module to `bench/tasks/fix_hard/` (contract in its `__init__.py`): a small project, the hidden tests, a one-file FIX and plausible WRONG fixes; `validate --tier hard` proves the gate accepts the fix and rejects the bug, a test rewrite and every WRONG. Any edit forks that tier's item set. **Multitask gauntlet** — drop a `.py` file in `bench/tasks/multitask/` exposing what `bench/tasks/multitask/__init__.py` lists (`TASK_NAME`, `CATEGORY`, `PLAN`, `STARTER`, `REFERENCE`, `TOOLSET`, `GATES`, `gates(ws, port)`, ...). Auto-discovered. See `go_htmx.py`. **Sleuth case** — add a `.py` file in `bench/tasks/sleuth_cases/` exposing `CASES` (fields in that package's `__init__.py`). A live case is a Dockerfile for a really broken box plus a hidden `check`; a snapshot case is files + canned command output via `sleuth.snapshot()`. Never put the cause in the complaint or leave the break script in the image. `validate` proves the expert path shows the evidence, the reference passes and every wrong answer fails. **New instrument** — add a module under `bench/tasks/` with a `main()` function, register it in `INSTRUMENTS` in `bench.py`, and follow [CONTRACT.md](CONTRACT.md) (`bench.core` `lane`, `client`, `results`). ## Project layout File by file; tests are named after the module they cover (`tests/test_.py`). ``` llm-bench/ ├── bench.py # CLI entry point ├── CONTRACT.md # rules every instrument follows ├── LICENSE.md # the Slop License ├── .env.example # LANE + optional knobs ├── lanes/ # lane profiles (*.json) + cards.json (model-card samplers) ├── tests/ # offline tests (MockServer) — python3 -m unittest discover -s tests ├── bench/ │ ├── core/ # lane, client, results, ledger, stats, mockserver, runners, tools │ ├── data/reasoning/ # mmlu-pro-cs manifest (cache/ is fetched, gitignored) │ ├── results/ # generated (gitignored) │ └── tasks/ # instruments (one per file) │ ├── conformance.py # per-lane preflight (+ toolcall_probes.py) │ ├── reasoning.py # MMLU-Pro computer science │ ├── report.py # capability profile across lanes │ ├── oracle.py # per-item oracle lane labels + policy simulation │ ├── agentic_fix.py # bug fixes, both tiers │ ├── fix_easy/ # easy-tier items, one file per language │ ├── fix_hard/ # hard-tier items, one project per file │ ├── agentic_multitask.py # app builds + the agentic harness │ ├── multitask/ # app-build tasks (auto-discovered): go_htmx, ts_next, rust_cli │ ├── sleuth.py # troubleshooting in throwaway containers │ ├── sleuth_cases/ # sleuth cases (auto-discovered; _* files are shared helpers) │ ├── router.py # route / orch items + scoring │ ├── router_sets.py # judge / rerank items │ ├── needle.py │ └── loop_battery.py └── work/ # generated (gitignored) ``` ## License Released under the Slop License — see [LICENSE.md](LICENSE.md). MIT.