# Submitting a system to BudgetBench ## 1. Write a system file A system is one ES module in `systems/`. It exports: ```js export const name = "my-system"; export const variants = ["default"]; export const processPerHousehold = false; // true if your system keeps global state (one process per household) export async function describe(variant) { // printed in every report and stored in inputs.json return {system: "My Assistant", variant, version: "1.2.0", model: "..."}; } export async function open(householdDir, setup, variant) { // Load the household. Read ONLY householdDir/source/ (the files a person imports) or householdDir/view/ // (the parsed rows) plus setup.json's today, accounts and currencies. Never read householdDir/truth/. return { loaded: 123, // rows loaded, for the log model: "served-model-id", // the model that answered, from the response when you can async ask(history, message) { // history: the conversation so far, in YOUR format, as you returned it last time ([] at the start) return { text: "the answer the person sees, with any table as Markdown", choice: null, // or {labels: ["option 1", "option 2"]} when you ask which one history: [...history /* plus this exchange */], meta: {} // anything you want kept in the transcript (latency, tool calls) }; } }; } ``` Rules: - `ask` must be pure in `history`: the runner answers every offered option on a COPY of the conversation, so it calls `ask` several times with the same `history`. - If you offer options, return them in `choice.labels`. The runner sends the chosen label back as the next message. The tap picks the option that the answer key marks right, the same way for every system (`METHODOLOGY.md` §3). - Use the answer's own currency marks. The grader reads "$1,234.56", "1.234,56 €", "£8.90", "SEK 5" and more. - Temperature 0 or a fixed seed. A run must be reproducible. A model with tools needs no new file: use `systems/openai-compat.mjs` with an OpenAI-compatible endpoint. It gives every model the same prompt and the same reference tools: - `BB_BASE`: the endpoint, for example `https://api.example.com/v1`; - `BB_MODEL`: the model id the endpoint expects; - `BB_KEY`: the NAME of the environment variable that holds YOUR key (default `OPENAI_API_KEY`). The runner reads the key from the process environment only. It never writes the key to a file, a log or a transcript. Bring your own key. BudgetBench runs no paid hosted model of its own and publishes no such row; the leaderboard's hosted-model rows, if any, come from submitters. Estimate the cost first: `node budgetbench/stats/cost-estimate.mjs --price-in <$ per million input tokens> --price-out <$ per million output tokens>` (a scripted estimate, about 5.7 million input tokens for the public split). ## 2. Run it ```bash # from the folder that holds budgetbench/ node budgetbench/check.mjs # must print BUDGETBENCH CHECK PASSED node budgetbench/runner/run.mjs --system my-system --variant default --split public --run-id 2026-11-01 node budgetbench/stats/report.mjs budgetbench/results/my-system-default/public/2026-11-01 ``` The run writes `results.jsonl` (one row per case with the full transcript and its label), `errors.jsonl` (harness failures, never scored) and `inputs.json` (the hashes of every frozen file, the runner, your system file, the git commit, the date). ## 3. Send a row Open a pull request (or send the folder) with: - `results/-/public//` complete: `results.jsonl`, `errors.jsonl`, `inputs.json`, `summary.json`; - your system file, or a link to a public package and the exact version; - the declaration of `CONTAMINATION.md` §4 (did the system ever use the public split, and how); - hardware, wall time, and for paid models the measured cost. ## 4. What we verify 1. `check.mjs` passes on the commit in `inputs.json`, and the hashes in `inputs.json` match `FROZEN.sha256`. 2. We regrade every row from its transcript with the frozen grader (`report.mjs --regrade`). The regraded labels are the ones published. 3. We read a sample of transcripts by hand, at least every "wrong shown", "wrong offered" and "needs review" row and 20 random right rows. A "needs review" row is adjudicated and the ruling is published beside the row. 4. For an open system we rerun a random 10% of the cases. Differences beyond the system's stated nondeterminism void the row. 5. A row on the sealed split is run only by the maintainers, once, on their own machine, at a time agreed with the submitter. A system that needs a third-party API (a hosted model) gets no sealed row: sealed cases are never sent to a third-party service (`CONTAMINATION.md` §2). The leaderboard prints, for every row: system, version, the six labels with 95% intervals, the date and the commit of the run, "tuned on public" yes or no, and any exposure.