Cluster, Route, Escalate: a cascaded framework for cost-aware LLM serving
Project description
CRE-Router
Implementation of the paper Cluster, Route, Escalate: Cascaded Framework for Cost-Aware LLM Serving.
Production LLM serving trades accuracy against cost. CRE-Router routes each query to the most cost-effective model in a pool, then escalates low-quality outputs to a stronger model:
- Stage 1 (clustering-based routing). Queries are embedded and clustered offline; each cluster is routed to the model that minimizes a cost-adjusted error score (Error + lambda * Cost), with lambda tuned once to satisfy a latency (TPOT) budget.
- Stage 2 (quality-estimation cascade). A lightweight ModernBERT classifier inspects each efficient-model output and escalates low-quality answers up an ordered ladder of stronger models.
Both stages train only on task-correctness labels obtainable from standard benchmark evaluation; no extra annotation is required.
Install
pip install "cre-router[full]"
full installs the whole pipeline on one machine. Narrower installs are
available through the serve, qe, and eval extras; see the
installation guide.
Usage
The workflow is driven by the cre CLI, one stage per step:
cre cluster → cre evaluate → cre fit → cre qe-train → cre serve
Run cre <stage> --help for options. Runnable end-to-end quickstarts (a
no-GPU routing-table demo and a full serving walkthrough) are in the
README.
Links
- Source and documentation: https://github.com/ymoslem/CRE-Router
- Paper: https://arxiv.org/abs/2606.27457
- Reproducing the paper: https://github.com/ymoslem/CRE-Router/blob/main/REPRODUCE.md
Apache-2.0 licensed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cre_router-0.1.0.tar.gz.
File metadata
- Download URL: cre_router-0.1.0.tar.gz
- Upload date:
- Size: 48.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6252a1adecf3b595232b84212a9d29b33ed2a6a29484adccf1ca15ecb18dab8
|
|
| MD5 |
129402942e4713e5a5d75a4bafb9477d
|
|
| BLAKE2b-256 |
6c52c0c13241aafc892160d12e2d4c3dee5609b5f112e2d13941e2868131e658
|
File details
Details for the file cre_router-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cre_router-0.1.0-py3-none-any.whl
- Upload date:
- Size: 37.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
239ed78828f04c9a197e43a08c7f6bd728ee3abb48f0d41fe23a44454c3e72fe
|
|
| MD5 |
339f3a5340b10980b5cd1f72ed579aeb
|
|
| BLAKE2b-256 |
026b0a192699bc29ccb6fbc93af62690197089c7175314b1d9e8c68bc2a1f4ef
|