Agent-as-a-Router provides reproducible implementations for routing coding tasks across models, with runtime integrations and CodeRouterBench data. It includes quick start steps and multiple demos, all based on TypeScript.
Collecting history — the radar snapshots this repo daily. The trend line appears after 3 days of data (1 so far).
What it is
Agent-as-a-Router implements Agentic Model Routing for Coding Tasks, providing reproducible code, CodeRouterBench data, reference outputs, and demos for integrating a router into workflows.
How it works
ACRouter routes coding tasks to different backend models under a performance-cost tradeoff. It ships with ready-to-adapt runtime integrations for Claude Code/Codex routing tools and includes demos for API-based solvers and CLI routers. The repository contains data and scripts to reproduce main results and benchmarks.
Getting started
cd open-source-acrouter
conda create -n acrouter python=3.11 -y
conda activate acrouter
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txt
python -m pip install -e .
python -m unittest discover -s tests
Recent releases
- none
Traction
683 stars, 15 forks, 0 open issues
Data and licensing
Language: TypeScript | License: MIT | Created: 2026-06-20 | Last push: 2026-06-29
Reproduce the main results
# In-distribution ID test replay.
python scripts/run_id.py --output-dir outputs/tmp/id
# ACRouter on OOD176.
python scripts/run_acrouter_ood176.py --output-dir outputs/tmp/acrouter_ood176
# OOD176 baselines and paper-style table.
python scripts/run_baselines_ood176.py --output-dir outputs/tmp/baselines_ood176
Hugging Face assets and demos
python scripts/download_hf_assets.py --minimal --dataset-dir .hf/CodeRouterBench
python demos/api_coding_solver/solve.py \
--config demos/api_coding_solver/models.example.json \
--problem-file demos/api_coding_solver/problems/two_sum.txt \
--dry-run
Project layout
configs/, demos/, examples/, src/.
