Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
The official implementations of Agent-as-a-Router: Agentic Model Routing for Coding Tasks.
| Date | Stars |
|---|---|
| 2026-07-31 | 1035 |
| 2026-08-01 | 1047 |
| 2026-08-06 | 1047 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
<div align="center">
# Agent-as-a-Router
**The official implementations of Agent-as-a-Router: Agentic Model Routing for Coding Tasks.**
<p>
<a href="https://www.omnisource.cn/agent-as-a-router">
<img alt="Homepage" src="https://img.shields.io/badge/Homepage-agent--as--a--router-1f6feb?style=for-the-badge">
</a>
<a href="https://arxiv.org/abs/2606.22902">
<img alt="Paper" src="https://img.shields.io/badge/Paper-arXiv%3A2606.22902-b31b1b?style=for-the-badge">
</a>
<a href="https://huggingface.co/datasets/Lance1573/CodeRouterBench">
<img alt="Benchmark" src="https://img.shields.io/badge/Benchmark-CodeRouterBench-ff9f1c?style=for-the-badge">
</a>
</p>
<p>
<a href="https://www.omnisource.cn/agent-as-a-router"><strong>Homepage</strong></a>
|
<a href="https://arxiv.org/abs/2606.22902"><strong>Paper</strong></a>
|
<a href="https://huggingface.co/datasets/Lance1573/CodeRouterBench"><strong>CodeRouterBench</strong></a>
</p>
</div>
ACRouter routes coding tasks to different backend models under a
performance-cost tradeoff. This repository contains the reproducible
implementation, CodeRouterBench data, reference outputs, and small demos for
plugging the router into your own workflow.
Offline reproduction does not require API keys or live model calls. The current
public benchmark is **OOD176**. Older OOD112/SWE-MiniSandbox assets are kept as
legacy supplementary data under `data/ood/`.
For the full pre-cleanup guide with maintainer notes, extended data details,
and publishing commands, see [docs/HANDBOOK.md](docs/HANDBOOK.md).
## Runtime Integration Highlights
ACRouter also ships with ready-to-adapt runtime integrations for popular
Claude Code/Codex routing tools:
- [`claude-code-router/`](claude-code-router/) adds gateway-level ACRouter
support to Claude Code Router, so routing can happen before a request is sent
to the selected backend model.
- [`cc-switch/`](cc-switch/) adds proxy-level ACRouter support to cc-switch, so
model selection can run before static provider/model mapping.
## Quick Start
```bash
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
```
## Reproduce The Main Results
```bash
# 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
```
Expected headline outputs:
```text
ID n=2919 AvgPerf=50.14 CumReg=202.0 $Total=22.31 Perf/$=2.25 rAcc=0.2395
ACRouter-OOD176 n=176 AvgPerf=73.30 CumReg=15.9 $Total=86.72 Perf/$=0.85
```
All commands above write to `outputs/tmp/` so checked-in reference outputs are
not overwritten.
## Hugging Face Assets
Dataset:
[`Lance1573/CodeRouterBench`](https://huggingface.co/datasets/Lance1573/CodeRouterBench)
Optional trained router adapter:
[`Lance1573/acrouter-qwen35-08b-router-lora`](https://huggingface.co/Lance1573/acrouter-qwen35-08b-router-lora)
Download only the files needed for OOD176 replay:
```bash
python scripts/download_hf_assets.py --minimal --dataset-dir .hf/CodeRouterBench
```
Download the benchmark plus the optional trained router adapter:
```bash
python scripts/download_hf_assets.py \
--minimal \
--with-router-model \
--dataset-dir .hf/CodeRouterBench \
--model-dir .hf/router_model
```
Run directly from a downloaded Hugging Face snapshot:
```bash
python scripts/run_acrouter_ood176.py \
--hf-dataset-dir .hf/CodeRouterBench \
--output-dir outputs/tmp/acrouter_ood176_hf
python scripts/run_baselines_ood176.py \
--hf-dataset-dir .hf/CodeRouterBench \
--output-dir outputs/tmp/baselines_ood176_hf
```
The replay matrix used by these commands is:
```text
raw_Excerpt of 8,966 characters
Read on GitHub29
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:5a6813ecec2b5a01, desc:agentic