Skip to main content

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 clustercre evaluatecre fitcre qe-traincre 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

Apache-2.0 licensed.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cre_router-0.2.0.tar.gz (81.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cre_router-0.2.0-py3-none-any.whl (53.2 kB view details)

Uploaded Python 3

File details

Details for the file cre_router-0.2.0.tar.gz.

File metadata

  • Download URL: cre_router-0.2.0.tar.gz
  • Upload date:
  • Size: 81.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.13

File hashes

Hashes for cre_router-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3785d7073fb61fbf4aeb00673f10f47ba04315b02f9f2b95c8bfb8d3e68808d5
MD5 704b036dc153280a17b48bdd65bf0d11
BLAKE2b-256 094ef24953bc4390d2c36b22019fec09dd09b804a6e87832e94bcfc1f5bbdd29

See more details on using hashes here.

File details

Details for the file cre_router-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cre_router-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 53.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.13

File hashes

Hashes for cre_router-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db1705fbc7641c2bf44fc8cc1febac4b5fdf573e38da2beb7260424f804c95ee
MD5 b098d9045455e7757cefb7941c7a9bc1
BLAKE2b-256 1d83a5677d13ec6a4bae0e5773e9ae5c9b84ea53e91cc999233c15131990a4a5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page