akitaonrails/llm-coding-benchmark
Simple benchmark to test the most popular open source and commercial LLMs with automated OpenCode
LLM Coding Benchmark
What it is
- A research‑grade benchmark that measures how well large language models (LLMs) can autonomously write, build, and validate a small Ruby on Rails application.
- The suite runs each model through two phases using the
opencodetool: (1) generate the Rails code, (2) boot the app locally (Docker build +docker compose up). - Results are stored per‑model under
results/…and summarised in Markdown reports.
Key components
- Configuration –
config/models.jsonlists every model (provider, slug, optional context overrides). The benchmark creates a temporaryopencodeconfig (config/opencode.benchmark.json) so your global settings stay untouched. - Prompts –
prompts/benchmark_prompt.txt(phase‑1) andprompts/benchmark_followup_prompt.txt(phase‑2) are the same for every run, ensuring a consistent task description. - Scripts
scripts/warmup_ollama_models.pychecks that locally‑hosted Ollama models load and reports the largest usable context window.scripts/run_benchmark.pydrives the whole experiment: prepares the config, invokesopencode run --agent build --format jsonfor each model, saves raw logs, normalises them toresult.json, and regenerates the Markdown reports.scripts/analyze_results_runtime.py(withscripts/browser_probe.mjs) tries to start the generated Rails project, run Docker, and even open a headless browser to verify the app works.
- Documentation – a large set of hand‑written analyses (
docs/*.md) explains the scoring rubric (0‑100 across eight dimensions), per‑model findings, multi‑agent experiments, and cost‑quality trade‑offs.
How it works
- Warm‑up – run the Python warm‑up script to discover each Ollama model’s max context size.
- Generate benchmark config –
run_benchmark.pybuilds a minimalopencodeconfig that only includes the models you want to test. - Execute – the script launches
opencode runfor each model. The tool’s built‑in system prompts differ by model family (Claude, GPT/Codex, Gemini, Kimi, etc.), a fact the repo documents as a known confound. - Two‑phase run
- Phase 1: the model writes the Rails code.
- Phase 2: the same session continues and validates the app by booting it locally and with Docker.
- Post‑processing – logs are normalised, runtime validation is attempted, and the consolidated tables (
docs/report.md,docs/report.nvidia.md) are regenerated.
What you get
- Per‑model artifacts – source code, raw
opencodelogs, and aresult.jsonsummarising success/failure, runtime, and cost. - Aggregated reports – Markdown tables ranking models by overall score, cost per run, and wall‑clock time.
- Deep code reviews – the
docs/success_report*.mdfiles contain a rubric‑driven audit of each model’s output, highlighting API hallucinations, test quality, architecture decisions, and production‑readiness. - Insights on multi‑agent setups – experiments where a planner model delegates work to a cheaper executor, with forced‑delegation variants and analysis of when orchestration helps or hurts.
Who might use it
- Researchers comparing the coding abilities of emerging LLMs (Claude Opus, DeepSeek, Kimi, Gemini, etc.).
- Teams evaluating cost‑effective options for autonomous code generation in Ruby/Rails projects.
- Anyone interested in reproducible LLM benchmarking pipelines that include real‑world build and Docker validation steps.
Limitations noted by the authors
- System prompts are injected by
opencodeper model family, so cross‑family scores mix model quality with harness tuning. - Some runs depend on external services (OpenRouter, deepclaude shim) and on the availability of an Anthropic subscription for certain variants.
- The benchmark focuses on a single, relatively small Rails task; results may not generalise to larger codebases.
All details are taken directly from the repository’s README; no additional features have been inferred.
Related
- Project
- Project
- Project
- Project
- Project