Skip to content

Latest commit

 

History

History
325 lines (231 loc) · 28.6 KB

README.md

File metadata and controls

325 lines (231 loc) · 28.6 KB

Writer prompt optimization with DSPy

This folder implements the DSPy-based optimization of DEFAULT_CHAT_SYSTEM_PROMPT for WriterAgent (see plan in repo). String harness: live ToolRegistry.get_schemas + get_chat_system_prompt_for_document plus eval note — docs/eval/string-harness-upgrade.md. eval_worlds.py is frozen; the rule is in its module docstring. Phase F =PY() dest rows are in the dataset.

Benchmarks from repo root

git clone …/writeragent && cd writeragent
uv sync
make eval-deps                    # uv pip install dspy-ai (run_optimize only)
export OPENROUTER_API_KEY=sk-…   # or OPENAI_API_KEY / WRITERAGENT_API_KEY
make run_eval-smoke               # one model, one example
make run_eval EVAL_ARGS="--models openai/gpt-oss-120b:nitro -n 2 -j 1"
make eval-ab SUITE=calc           # A/B compare origin/master vs working tree (calc, writer, draw, all, string, lo)

Prompt A/B (make eval-ab)

make eval-ab SUITE=calc compares origin/master (Side A, in a reused detached worktree /tmp/wa-eval-ab-master) against your working tree (Side B) using scripts/prompt_optimization/eval_ab.py:

  • Defaults: SUITE=all, MODELS=openai/gpt-oss-20b:nitro,openai/gpt-oss-120b:nitro, REPEATS=3, OUT_DIR=/tmp/wa-eval-ab, optional TASKS=task1,task2.
  • Runs scripts/generate_manifest.py first, then executes one run_eval_multi.py at a time in the foreground (-j 1 --lo-workers 2 --backend auto).
  • Writes resumable results to /tmp/wa-eval-ab/<suite>/<side>-<source>-<config>-rN.json (skipping completed repeats) and prints a per-task pass-rate / quality table (header shows the Side A ref and both source ids) plus a B better / B worse / B same summary line. Any change to the Side A commit, the Side B HEAD commit or uncommitted plugin/ or scripts/ changes, the model list, or the task list starts fresh files and ignores older ones. Old results are not removed; delete <OUT_DIR>/<suite> to clear them.

Local OpenAI-compatible (Ollama, vLLM, etc.):

export OPENAI_API_BASE=http://127.0.0.1:11434/v1
make run_eval EVAL_ARGS="--model llama3.2 --allow-unknown-model -n 1 -j 1"
# Judge defaults to the same model on non-OpenRouter endpoints.

Wrapper: scripts/benchmark.py. Credentials: eval_auth.py (CLI/env → LlmClient config; judge uses same HTTP stack as chat).

Setup (this directory)

uv pip install -r requirements.txt   # or: make eval-deps from repo root

Defaults: OpenRouter with openai/gpt-oss-120b:nitro (see DEFAULT_EVAL_STUDENT_MODEL in model_configs.py; :nitro is OpenRouter routing, same prices as openai/gpt-oss-120b). API key (first match wins):

  • --api-key / -k, then WRITERAGENT_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY

Endpoint:

  • --api-base / WRITERAGENT_API_BASE, OPENAI_API_BASE — default https://openrouter.ai/api/v1

EVAL_ANTHROPIC_API_KEY (or ANTHROPIC_API_KEY) routes Claude-shaped ids on an OpenRouter base to https://api.anthropic.com/v1. EVAL_GEMINI_API_KEY (or GEMINI_API_KEY) routes Gemini-shaped ids on an OpenRouter base to https://generativelanguage.googleapis.com/v1beta/openai. The default judge stays on OpenRouter. Non-OpenRouter --api-base is not rewritten. An id without a model_configs.py row is accepted without --allow-unknown-model only when it is routed to its native provider.

Judge model (run_eval_multi.py):

  • --judge / WRITERAGENT_JUDGE_MODEL, then openai/gpt-oss-120b:nitro on OpenRouter, else first --models id on other endpoints
  • --no-judge — substring checks only

Override model for optimize:

  • python run_optimize.py --model google/gemini-3.5-flash-lite / --api-base ... / --api-key ...

Optimize student: run_optimize.py wraps the same llm_chat_eval tool loop as run_eval.py.

Run

Eval only (see per-example success without optimizing):

export OPENROUTER_API_KEY="your-key"
python run_eval.py                          # all examples (needs a key; default --student llm)
python run_eval.py -e table_from_mess       # one task_id
python run_eval.py -n 2                     # first 2 examples
python run_eval.py -v                       # verbose: print every tool call as it runs
python run_eval.py --no-bust-cache   # disable cache-busting (default: on)
python run_eval.py --backend string --student scripted -v   # no API key; full pack
python run_eval.py --backend lo --student scripted --no-bust-cache -v   # headless LO, no key
# or from repo root: make run_eval-lo-scripted

Shows for each example: task_id, expected/reject/oracle pass or miss, correctness, tokens, score, and a short doc snippet. Pytest covers the string pack (tests/scripts/test_scripted_eval_pack.py); PR CI runs the scripted LO eval pack on Linux in the scripts integration step, and elsewhere it is skipped unless soffice, python-uno, and the manifest are present. Do not set WRITERAGENT_TESTING=1 for LO eval. Do not use tests/eval_runner.py. Use -v/--verbose to print each tool call. Use make eval-ab to compare prompts. Cache-busting is enabled by default (unique suffix per example) to avoid OpenRouter prompt cache; use --no-bust-cache to disable.

Full optimization (MIPROv2, live student):

Default --student llm proposes replacements for a named slice (not the whole ambient system prompt) and scores each candidate by running run_eval / llm_chat_eval (production tool schemas + sidebar-like tool loop). Instruction-only: max_bootstrapped_demos=0, max_labeled_demos=0. A length penalty prefers winners under ~2× the current slice. Output is optimized_slice.json plus optimized_slice_slice.json (plain instruction text). Do not auto-merge into plugin/framework/prompts.py or plugin/calc/cells.py — copy by hand after a ranking re-run.

export OPENROUTER_API_KEY="your-key"
python run_optimize.py --auto light -j 1 \
  -e data_sorting,tax_column --slice calc_core

That is the cheap Calc-slice smoke: light MIPRO, one worker, the two Calc ranking tasks, CALC_CORE_DIRECTIVES only.

Writer apply/HTML-diff smoke (WRITER_APPLY_DOCUMENT_HTML_RULES — not the whole Writer ambient prompt):

python run_optimize.py --auto light -j 1 \
  -e table_from_mess,table_engineering --slice apply_html

Other slices: writer_core, apply_html, sort_range, write_range, write_range.values, full_prompt (opaque whole-prompt fallback).

Pick a different model:

python run_optimize.py --model google/gemini-3.5-flash-lite
python run_optimize.py -m openai/gpt-oss-120b:nitro -k sk-...
  • --slice NAME: fragment MIPROv2 rewrites (calc_core default; Writer HTML contract is apply_html).
  • -e / --example: comma-separated task_id filter (same idea as run_eval.py).
  • --judge / -J: Judge model for grading (default openai/gpt-oss-120b:nitro). Same dataset and gold_standards.json as run_eval_multi. Golds are hand-written from the rubrics; --generate-golds is an optional teacher merge, not a ranking prerequisite.
  • -j N / --jobs N: parallel evals (default 4). Use 1 for a smoke.
  • --auto light|medium|heavy: exploration level (default light). Use medium or heavy for more tries when your prompt is complicated.
  • -t N / --trials N: explicit number of Bayesian optimization trials (overrides --auto; uses more exploration).
  • --no-length-penalty: disable the ~2× slice-length penalty.

Metric

Optimization and multi-model eval use result oracles for structural tasks (oracles.py on the exported final document). LLM-as-a-Judge (default openai/gpt-oss-120b:nitro) is for quality after the hard gate.

  • Dual-Mode Scoring: Hard gate first (substring + result oracles + process oracles). A quality judge runs after that gate for resume, rewriting, summarization, and the two Writer table tasks:
    • Creative (resume, rewriting, summarization): 50% accuracy, 20% formatting, 30% naturalness.
    • Tables (table_from_mess, table_engineering): 20% accuracy, 80% formatting.
    • Other structural tasks stay oracle-only (no judge).
  • Chain-of-Thought: Judges output a thought_process before assigning 1-5 sub-scores for each dimension.
  • Internal Normalization: Sub-scores are normalized and weighted into a final 0.0–1.0 score.
  • Token penalty: score -= 0.01 * (total_tokens / 1000) so fewer tokens improve the score.

Dataset

dataset.py ALL_EXAMPLES is 24 tasks: 15 Writer-kind (the original 8 plus style_consistency, smart_summarization, section_refactor, comment_management, the two backend=lo TOC rows toc_list_entries / toc_renumber_insert, and python_shapes_flag with backend=lo), 3 Draw (flowchart_gen / org_chart_gen / solar_sld_gen, where org chart and solar SLD are backend=lo), and 6 Calc (data_sorting, tax_column, paste_table, formula_table, plus the two Phase F =PY dest rows py_refuse_overlap and py_no_bulk_read). Each has fixed document_content and user_question so runs are comparable. Kind is keyed by task_id (task_kind()), not question keywords. Rows omit backend to stay on the string world. The flag cannot be faked there.

Hard pass is the exported final document plus process oracles (oracles.py / process_oracles.py). python_shapes_flag is the exception: hard pass is the harness trace plus exported Writer geometry (flag_eval.py). Under-counted stars are soft and do not fail. A quality LLM judge runs after that gate for resume, rewriting, summarization, and the two Writer table tasks (table_from_mess, table_engineering); the two Calc table tasks (paste_table, formula_table) have no LLM judge. Eval does not set sampling temperature. gold_standards.json is hand-written from the rubrics (no live teacher API unless --generate-golds). Specialized Draw/Calc tools are reached through an inner LlmClient loop (domain="shapes" / "ranges"), not SmolAgents.

Tool subset

Eval-1 is not string-only. --backend string (default) is an in-memory simulator (string_eval_tools.py). It skips rows that declare backend=lo (python_shapes_flag, org_chart_gen, solar_sld_gen, toc_list_entries, toc_renumber_insert), so a pure-string board stays 19 tasks. --backend lo forces native headless UNO for every selected row: tools_lo.py starts soffice --headless, serializes all UNO onto _lo_thread via LOBackend.call, and executes production tools with bypass_thread_guard=True. The headless-LO Calc export reads from A1 and includes formulas, like the string snapshot. --backend auto honors each row's backend and is the mixed 24-task pack (dual-lane; flag + org chart + solar SLD + TOC rows on LO). LO Draw/Writer rows need native; headed eval-2 is a separate suite — do not treat native LO as eval-2-only. Do not use tests/eval_runner.py or make lo-start for this path. Do not set WRITERAGENT_TESTING=1 (that swaps in QueueExecutor on the wrong thread).

--student scripted replays scripted_student.SCRIPTS (no LlmClient, no API key, result oracles + honest substring checks). The flag has no script. --student llm (default) uses a live model and still needs a key. --no-judge skips the quality judge.

Mixed backends (dual lane)

--backend used to be run-global. Each example may now set backend to string or lo (omitted means string). auto uses that field. string and lo still force one backend for the invocation.

From t=0 the scheduler does not finish the string pack and then start LibreOffice:

  • A string pool (run_eval.py -j N, default 1) runs string rows concurrently.
  • An LO agent pool (--lo-workers, default 4, clamped to 1..5; threads eval-lo-lane-N) runs that many lo example bodies at once, in front of the existing _lo_thread / one soffice. LLM waits overlap. UNO stays serial: tools enter only through LOBackend.call. workers=1 is the old full-example FIFO.
  • LO work is queued before the string pool waits, so it is in flight while string tasks are still running. Wall clock for native LO rows approaches the overlap of those LLM waits plus serial UNO, not a full-example FIFO.
  • A string row never blocks on the LO queue. Only a row whose own backend is lo waits for a free pool worker.

run_eval_multi.py -j N is still models (default 20). Inside one model, string tasks stay serial. Models share one LO pool (--lo-workers), so flag rows from several models occupy those agent threads while those models' string tasks overlap. Do not ProcessPoolExecutor against one soffice, and do not start a second soffice. Flag-path get_ctx() / Desktop current component / the warm-child pipe lock are still a separate pin. Per-task banners include model=; an LO row also prints backend=lo.

python_delegate_domains on the string world returns unsupported_in_eval. There is no fake python_run_script. On LO, the harness runs that hop as an inner LlmClient loop (not SmolAgents) so python_run_script is on the harness trace, then executes it through production tools with python_tool_domain=shapes,core. Shape mutators stay off the inner LLM list. Headed eval-2 still scores writeragent_debug.log; this row does not.

# Original 17, no soffice. Comparable with the 2026-09-11 boards.
python scripts/prompt_optimization/run_eval.py --backend string --student scripted --no-bust-cache

# Same 17: auto + scripted prints a skip note for the flag (no script).
python scripts/prompt_optimization/run_eval.py --backend auto --student scripted --no-bust-cache

# Live flag only. Needs OPENROUTER_API_KEY (or equivalent) and soffice.
python scripts/prompt_optimization/run_eval.py --backend auto -e python_shapes_flag

# Full mixed pack (17 string + flag). String pool overlaps the LO agent pool
# (default --lo-workers 4). UNO stays on one soffice thread.
python scripts/prompt_optimization/run_eval.py --backend auto -j 4

# Explicit string request for the flag is an error (cannot fake venv/shapes).
python scripts/prompt_optimization/run_eval.py --backend string -e python_shapes_flag

OpenRouter-only --backend string still cannot run the flag alone. CI without soffice cannot execute that live row; scheduler and oracle unit tests do not need it. Do not average a mixed 18-pack with the September 2026 17-task CSV.

-j N on run_eval.py is the string-pool width above. Scripted green runs use -j 1.

run_optimize.py uses eval_catalog.build_eval_tool_schemas (same as run_eval_multi) and accepts the same tool-count / schema-density knobs as run_eval.py (see below). MIPROv2 still cannot search those structural knobs — run a dropper sweep on the live harness instead.

Tool-count and schema-density sweeps (live --student llm)

Production sidebar registration is unchanged. These flags only reshape the advertised eval catalog.

--tools SPEC (default full): named preset or comma-separated production tool names. Unknown explicit names raise with the available catalog. Kind-specific presets apply only to that document kind (a mixed-kind run with --tools calc_minimal still gives Writer/Draw the full catalog). Specialized inner loops are not filtered — delegate_to_subagent still sees sort_range / ranges-domain schemas.

Preset Kind Outer tools (production names)
full any Today's unfiltered get_schemas catalog (Writer 14 / Calc 14 / Draw 19).
calc_minimal calc write_range, get_sheet_summary, delegate_to_subagent — smallest set that can still pass data_sorting + tax_column.
calc_core calc The 9 Calc-specific outer tools (drops shared chatbot extras: memory_upsert, manual_read, document_redo, document_undo). Not the MIPRO --slice calc_core prompt fragment.
writer_minimal writer apply_content, get_content — smallest set for apply-HTML Writer tasks (table_from_mess, bulk_cleanup, …).

--schema-density full|skinny (default full): skinny is a pure transform (after the name filter, before MIPRO apply_schema_patches). Tool names and param names/types stay; tool and param descriptions are blanked so you can measure whether fat prose confuses small models without removing tools.

Do not burn OpenRouter in CI. Scripted smokes (no key) prove plumbing; live droppers are manual.

# Plumbing smoke (no API key)
python run_eval.py --student scripted --no-judge -e data_sorting \
  --tools calc_minimal --schema-density skinny -v
python run_eval.py --student scripted --no-judge -e tax_column --tools calc_minimal
python run_eval.py --student scripted --no-judge -e table_from_mess --tools writer_minimal

# Cheap live dropper (one small model, two Calc tasks). Compare full vs minimal vs skinny.
# Requires OPENROUTER_API_KEY; do not put this in CI.
python run_eval_multi.py --models openai/gpt-oss-20b -e data_sorting -j 1 --no-judge \
  --tools full --out /tmp/dropper_full.json
python run_eval_multi.py --models openai/gpt-oss-20b -e data_sorting -j 1 --no-judge \
  --tools calc_minimal --out /tmp/dropper_minimal.json
python run_eval_multi.py --models openai/gpt-oss-20b -e data_sorting -j 1 --no-judge \
  --tools calc_minimal --schema-density skinny --out /tmp/dropper_skinny.json

# Same knobs on MIPRO's live student (instruction search; tools/density stay fixed)
python run_optimize.py --auto light -j 1 -e data_sorting,tax_column \
  --slice calc_core --tools calc_minimal --schema-density skinny

Repeat the live commands with -e tax_column and, if you want a mid-size point, --tools calc_core. Compare hard pass / tokens (and cost when priced) across the three --out files. That is the “how many tools is too many” / “do fat descriptions hurt” measurement.

Applying the result

After a live run, open optimized_slice_slice.json and copy only that slice into the matching production constant (CALC_CORE_DIRECTIVES, WRITER_CORE_DIRECTIVES, WRITER_APPLY_DOCUMENT_HTML_RULES, or the tool description in plugin/calc/cells.py). Then re-run run_eval.py / run_eval_multi.py on the same tasks, or compare with make eval-ab.

Multi-model evaluation (intelligence per dollar)

You can also run the same fixed dataset and current system prompt across multiple models and compare their performance and estimated cost.

Models and prices live in model_configs.py (one ModelConfig per model with context window and list prices in USD per 1M input/output tokens).

export OPENROUTER_API_KEY="your-key"

# Required: --models (or --yes-all-models for the full catalog)
python run_eval_multi.py --models openai/gpt-oss-120b,openai/gpt-4o-mini

# Fewer examples (faster, cheaper)
python run_eval_multi.py --models openai/gpt-oss-120b:nitro -n 2

# Selection runs: three repeats
python run_eval_multi.py --models openai/gpt-oss-120b:nitro --repeats 3

# 20 models in parallel (default); use -j 1 for sequential
python run_eval_multi.py --models openai/gpt-oss-120b,openai/gpt-4o-mini -j 20

For each model, run_eval_multi.py reports hard pass %, agent score, quality (among judged passes), then historical avg correctness / cost / C²/$. Rank is hard pass, then agent, then quality; C²/$ is secondary.

Use --out path.json or --out path.csv to write results (format by extension). Transcripts are always saved: every run_eval.py / run_eval_multi.py run writes scripts/prompt_optimization/transcripts/<run-timestamp>/<model>/<task_id>.json (gitignored) for every task, pass or fail — full message list (system, user, each assistant message with tool calls, each tool result), per-round response extras (reasoning, finish_reason when the provider returns them), the tool trace, usage, error and final_document. The path is printed at startup. Details files include missing/reject/oracle/process failures and judge_error. Results are written after each model completes so partial data is saved if the run is interrupted.

To merge a selective model run back into the master dataset without overwriting existing data (and retire older superseded generations, e.g. Mercury 2.5 Preview in favor of Mercury 3):

python merge_benchmark_results.py \
  --base benchmark_results.json \
  --update benchmark_results_selective.json \
  --drop "inception/mercury-2,meta/muse-spark-1.2-contributor" \
  --out benchmark_results.json \
  --markdown

Eval framework (summary)

  • Dataset (dataset.py): 20 fixed tasks (12 Writer + Draw flowchart/org-chart/solar-sld + 2 Calc + 2 =PY dest + python_shapes_flag on LO) with assigned category (structural or creative). --backend string runs the 17 non-backend=lo rows.
  • Result oracles (oracles.py): Structural correctness from the exported final doc (table Total, 8% tax, Revenue desc, heading order, …). Not tool-name traces. Oracles score only the first rendering of an LO Writer export.
  • Gold Standards (gold_standards.json): Hand-written references matching current rubrics. Used only as the quality-judge reference for resume / rewrite / summary / tables. --generate-golds can merge a teacher run with --gold-model (default openai/gpt-6-luna; not used during ranking). gold_standards.generated.json and gold_generation_details.json are raw --generate-golds records; nothing loads them, and a teacher gold can fail its oracle (the bulk_cleanup teacher kept "Quoted text"). Only gold_standards.json is loaded, and test_golds_pass_oracles gates it.
  • Program: program_llm.LiveEvalStudent injects a named slice then calls llm_chat_eval (same student as run_eval_multi).
  • Metric: Hard gate (document + process); quality judge after the gate for resume/rewrite/summary/tables; token penalty; slice-length penalty (~2× seed). Shared via eval_core / metric.py for run_optimize (MIPROv2) and run_eval_multi.
  • Multi-model: run_eval_multi.py ranks by hard pass / agent / quality; C²/$ is secondary. --models is required.

Benchmark results (string snapshot → 19-task dual-lane refresh)

Eval-1 backends: string = in-memory; lo = native headless UNO; auto = per-task dual-lane mix. Tasks 18–19 (python_shapes_flag, org_chart_gen) need native — not eval-2-only.

2026-09-28 board refresh (complete 26×19 dual-lane)

Org_chart_gen matrix splice on #941 tip (after 2026-09-27 complete 26×18 flag-18 board), then 2026-09-28 hand-scored gallery overrides (docs/eval/org-chart-hand-scores-2026-09-28.md). Catalog unchanged: GPT-6 Luna, Command A+, Ternary Bonsai 2 aboard; no 5.6 Luna / ds-v4-flash-0731; MiMos omitted. Org-chart hard PASS (visual): 5/26 — Muse Spark, Qwen 3.8 Flash, Qwen 3.8 27B, GLM 5.3 Flash, GPT-6 Luna. Soft/borderline and other former oracle PASSes flipped to 0; catalog FAILs (incl. Ternary Bonsai hang) unchanged.

Tasks 18–19 run on the native lane (--backend auto). Board is complete: 37/37 models have n_examples=19. Perfect hard pass (n=19): anthropic/claude-sonnet-5.5 (visual org HARD PASS), anthropic/claude-opus-5.5 (clean flag after the shape-text crash fix; visual org HARD PASS), and meta/muse-spark-1.3-contributor (openai/gpt-oss-120b catalog org fail → 0.947). Haiku 5.5 and Muse Ember are visual org PARTIAL (0.9 correctness, org hard=0); LFM 3 1.7B is a visual org HARD FAIL. Grades: 2026-11-11 hand scores. Board is now 37 models (Claude 5.5 Haiku/Sonnet/Opus, Muse Ember, LFM 3 1.7B added 2026-11-11; Gemini 4 Neon, Gemini 4 Hydrogen and Inkling 2 Mini added 2026-11-22, with Mercury 3 replacing Mercury 2.5 Preview in the JSON). The 2026-11-22 Neon and Hydrogen org-chart PASSes are code-oracle only (not hand-graded yet).

Pareto SVGs regenerated from this JSON: docs/eval/pareto-fronts-2026-11-22.svg, docs/eval/pareto-distance-2026-11-22.svg. File names carry the refresh date so cached copies are not reused; plot_pareto.py writes today's date by default (--date YYYY-MM-DD to override), so delete the old pair and update these links when you regenerate.

Calc fill-down base (data_sorting + tax_column) from 2026-09-11 after Tip A/B + harness expand_single_formula (#733). Artifacts: benchmark_results.json, benchmark_results_details.json. Cost–quality charts: docs/eval/pareto-fronts-2026-11-22.svg (successive fronts) and docs/eval/pareto-distance-2026-11-22.svg (distance to F1); regenerate with python scripts/prompt_optimization/plot_pareto.py.

Ranked by hard pass → agent score → metric. C²/$ = metric score squared ÷ avg $/task (intelligence_per_dollar_metric). Quality = LLM judge average among judged creative/table passes only (— if none judged). Models with n_err > 0 kept when errors are model-side (empty response, tool-loop limit), not infra/harness. n is 19 for every catalog model (flag + org chart spliced).

Rank Model Hard pass Agent Correctness Quality Tokens/task $/task C²/$ n_err
1 anthropic/claude-sonnet-5.5 1.000 1.000 0.994 0.98 47918 0.10723 2.6 0
2 anthropic/claude-opus-5.5 1.000 1.000 0.993 0.97 60171 0.28569 1.1 0
3 google/gemini-4-neon 1.000 1.000 0.987 0.95 53404 0.16092 1.9 0
4 google/gemini-4-hydrogen 1.000 1.000 0.985 0.94 45580 0.06967 4.3 0
5 meta/muse-spark-1.3-contributor 1.000 1.000 0.981 0.93 56766 0.00653 64.4 0
6 nvidia/nemotron-3.5-super-vl 0.947 0.947 0.932 0.94 54511 0.01104 34.1 0
7 deepseek/deepseek-v4.1-flash 0.947 0.947 0.921 0.93 139971 0.01025 36.4 0
8 openai/gpt-oss-120b 0.947 0.947 0.921 0.90 18554 0.00106 584.2 0
9 meta/muse-glimmer-30b 0.895 0.895 0.923 0.96 32858 0.01429 29.5 0
10 x-ai/grok-4.6 0.895 0.895 0.918 0.94 36460 0.09480 4.9 0
11 qwen/qwen3.8-27b 0.895 0.895 0.917 0.92 120710 0.08978 3.8 0
12 inception/mercury-3 0.895 0.895 0.906 0.89 43867 0.00603 52.4 0
13 meta/muse-ember 0.842 0.889 0.922 0.94 55207 0.00750 41.1 0
14 reflection/beam-1.0-501b-a23b 0.842 0.842 0.879 0.93 148577 0.05386 7.7 1
15 openai/gpt-6-luna 0.842 0.842 0.873 0.93 34348 0.00550 71.1 0
16 qwen/qwen3.8-flash 0.842 0.842 0.865 0.89 56566 0.01120 19.3 0
17 google/gemma-4-31b-it 0.842 0.842 0.861 0.90 17594 0.00224 236.2 0
18 bytedance-seed/seed-2.0-mini 0.842 0.842 0.861 0.90 28592 0.00415 93.3 0
19 z-ai/glm-5.3-flash 0.842 0.842 0.856 0.90 83249 0.00843 40.2 0
20 prism-ml/ternary-bonsai-2-27b 0.842 0.842 0.843 0.93 39831 0.00553 46.9 2
21 poolside/laguna-xs-2.1 0.842 0.842 0.838 0.81 28418 0.00196 183.0 0
22 nvidia/nemotron-3-ultra-550b-a55b 0.789 0.789 0.840 0.74 161718 0.16172 1.4 1
23 poolside/laguna-s-2.1 0.789 0.789 0.777 0.92 33308 0.00345 87.5 0
24 thinkingmachines/inkling-2-mini 0.789 0.789 0.774 0.94 301058 0.02539 5.8 1
25 minimax/minimax-m3 0.789 0.789 0.738 0.57 127380 0.05541 4.3 0
26 nvidia/nemotron-3-super-120b-a12b 0.737 0.789 0.861 0.91 119112 0.01575 15.4 1
27 anthropic/claude-haiku-5.5 0.737 0.784 0.807 0.92 48851 0.00588 31.7 0
28 openai/gpt-oss-20b 0.737 0.737 0.759 0.89 24456 0.00110 349.7 0
29 ibm-granite/granite-4.2-8b 0.737 0.737 0.757 0.93 69218 0.00744 20.4 0
30 upstage/solar-pro4 0.737 0.737 0.716 0.90 33501 0.00146 178.0 0
31 google/gemma-4-26b-a4b-it 0.684 0.684 0.701 0.89 20530 0.00227 125.9 0
32 google/gemini-3.5-flash-lite 0.632 0.632 0.708 0.93 16160 0.01018 34.4 0
33 cohere/command-a-plus 0.632 0.632 0.694 0.94 59928 0.02877 6.3 4
34 liquid/lfm-2.5-24b-a2b 0.579 0.579 0.589 0.89 33805 0.00499 30.0 0
35 mistralai/mistral-small-2603 0.579 0.579 0.583 0.85 24553 0.00534 39.2 2
36 nvidia/nemotron-3.5-lightning 0.368 0.421 0.395 0.68 34466 0.00338 17.0 0
37 liquid/lfm-3-1.7b 0.316 0.316 0.401 — 180041 0.01805 1.4 6

Re-run: make run_eval EVAL_ARGS="--models … -j 20" or edit model_configs.py. User-facing summary: docs/eval/benchmarks.md.