Skip to main content
SinapisAI × LAMDA — SAVERouter research collaboration

A research collaboration between SinapisAI and LAMDA.

SAVERouter

Routing Should Pay for Itself: Sparse Supervision for Economical LLM Routing

arXiv CI Release Python License: MIT

Guannan Lai · Gelin Bian · Hao-Xuan Ma · Jun-Peng Jiang · Long Chen · Jian-Dong Liu · Zhi-Hao Tan · Han-Jia Ye

Nanjing University · The Hong Kong University of Science and Technology · SinapisAI

[Paper] [Code] [SinapisAI]

Overview

LLM routing can reduce serving cost, but training a router often requires executing many candidate models on historical queries first. SAVERouter treats this supervision expenditure as part of the routing problem. It adaptively acquires a small, informative subset of query-model feedback, shares capability information across related queries, and retains query-level corrections for fine-grained routing.

Across four routing benchmarks, SAVERouter uses roughly 33–41% of the available training feedback while preserving competitive routing quality. The paper introduces two metrics that account for both the upfront investment and the subsequent serving-time savings:

  • SA-BEP: the number of deployment queries required to recover supervision expenditure.
  • SA-CR: the serving-cost ratio after amortizing supervision expenditure over a fixed deployment horizon.

Method

Overview of the SAVERouter method

Overview of SAVERouter.

SAVERouter has three main stages:

  1. Adaptive acquisition selects exactly K candidate models per training query using grouped empirical-Bayes UCB.
  2. Hierarchical capability estimation combines a structured group-model prior with shrinkage toward the feedback collected for each group and model.
  3. Query-level refinement learns contextual residuals and constructs the quality-cost routing frontier.

The sparse supervision artifact contains only acquired (query, model, quality, cost) tuples. Router fitting never receives a dense outcome matrix.

Installation

Clone the repository and create the environment:

git clone https://github.com/LAMDA-Model-Reuse/SaveRouter.git
cd SaveRouter
bash scripts/setup.sh

Run the download-free smoke test and unit tests:

.venv/bin/saverouter smoke-test
.venv/bin/python -m pytest

Reproducing the experiments

Run one benchmark or the complete four-benchmark suite:

bash scripts/reproduce.sh llmrouterbench
bash scripts/reproduce.sh all

The reproduction script downloads the original benchmark data and frozen encoders, uses the paper profiles under configs/paper/, and writes results to outputs/. A fresh full run requires approximately 12–15 GB of free disk space. CUDA is recommended for MMR-Bench and first-time feature extraction; CPU execution is supported.

After installation, the equivalent CLI command is:

saverouter reproduce --benchmark all --device auto --verify

The paper's main comparison is shown below. Small numerical differences can occur across BLAS, CUDA, and encoder environments; --verify checks all metrics under the repository's declared tolerances.

Main results on four routing benchmarks

Main results on four routing benchmarks.

The evaluator constructs the complete policy family used in the paper: 201 cost-weight policies, cost-threshold policies, and incremental predicted-quality-gain per predicted-cost gates.

Outputs

outputs/<benchmark>/result.json       # profile, metrics, and metadata
outputs/<benchmark>/pareto.csv        # physical routing frontier
outputs/<benchmark>/supervision.npz   # exact sparse observations
outputs/main_results.csv              # four-benchmark summary

Dataset revisions, model order, query order, split, seed, grouping profile, and acquisition mask are recorded for reproducibility. Dataset and encoder artifacts are downloaded from their publishers at pinned revisions.

Using SAVERouter on a custom benchmark

from saverouter import FixedKSparseRouter, simulate_fixed_k_supervision

feedback = simulate_fixed_k_supervision(
    rewards_train,
    group_ids,
    costs=costs_train,
    k=4,
    seed=42,
)

router = FixedKSparseRouter().fit(query_features, feedback)
choices = router.route(
    test_features,
    max_cost=0.01,
    group_ids=test_group_ids,
)

For live feedback acquisition, use collect_fixed_k_supervision with a callback that invokes a model only after it is selected. See examples/online_feedback.py.

Supervision-amortized metrics

Let C0 be upfront supervision expenditure, Cb the serving cost of the best single model, Cr routed serving cost at the quality target, and Co online routing overhead:

SA-BEP = ceil(C0 / (Cb - Cr - Co))
SA-CR@H = (C0 + H * (Cr + Co)) / (H * Cb)

SA-CR@H < 1 indicates that routing has paid back its upfront supervision cost by deployment horizon H. The experiments use H = 1,000,000.

Repository structure

configs/paper/       frozen benchmark profiles
examples/            custom and online-feedback examples
results/reference/   numerical reproduction references
saverouter/           method, benchmark adapters, and CLI
scripts/              setup and reproduction entry points
tests/                unit and leakage-regression tests

Citation

If you find SAVERouter useful, please cite:

@article{lai2026routing,
  title   = {Routing Should Pay for Itself: Sparse Supervision for Economical LLM Routing},
  author  = {Lai, Guannan and Bian, Gelin and Ma, Hao-Xuan and Jiang, Jun-Peng and Chen, Long and Liu, Jian-Dong and Tan, Zhi-Hao and Ye, Han-Jia},
  journal = {arXiv preprint arXiv:2609.37402},
  year    = {2026},
  url     = {https://arxiv.org/abs/2609.37402}
}

Acknowledgments

This repository adapts benchmark loaders and evaluation conventions from ORBIT. Benchmark datasets and pretrained encoders retain their respective licenses and terms.

License

SAVERouter is released under the MIT License.

Metadata

Release files for saverouter 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for saverouter 0.1.0
File Size Uploaded
saverouter-0.1.0.tar.gz 42.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for saverouter 0.1.0
File Interpreter ABI Platform
saverouter-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 86.5 kB

Release files / saverouter-0.1.0.tar.gz

Download URL saverouter-0.1.0.tar.gz
Size 42.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3f33475f030f8fcddb9d5a9a7a73bcb54de33096cb38ab7b739177e67ed21b99
BLAKE2b-256 checksum
How to use checksums
6c35fca374eda0ac72921e2d0094654f23bb87ddb08f7408ee0198aeae64f242
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / saverouter-0.1.0-py3-none-any.whl

Download URL saverouter-0.1.0-py3-none-any.whl
Size 44.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8d90cf0b3739836ba1cea61f4539f3e5ca3c9f41e398c9bc9196f6942b95251
BLAKE2b-256 checksum
How to use checksums
95c41b5af27e5a1eea80e92b4792e5cc788d9a5e44e7bf4ade03f98a2b3cf16c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page