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.1.tar.gz (83.2 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.1-py3-none-any.whl (53.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cre_router-0.2.1.tar.gz
  • Upload date:
  • Size: 83.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cre_router-0.2.1.tar.gz
Algorithm Hash digest
SHA256 2bd88733e1b2ff642fd3794c1168fc1c2b76824c644f7eb2af9b41b3fdef0237
MD5 217c3fcf45a4e7994bb8d9dec66d64ef
BLAKE2b-256 7e5135e1e35c4568ed1d674fd0952d3fa8c9696ea5c26d7f016ef239d7642533

See more details on using hashes here.

Provenance

The following attestation bundles were made for cre_router-0.2.1.tar.gz:

Publisher: release.yml on ymoslem/CRE-Router

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: cre_router-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 53.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for cre_router-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f98c0a092818dfe3a713e5ef8a6a081951d2772592ac636bf58018ed04c6f11
MD5 67a8f2e87359693d2cabfa79e0ea8c15
BLAKE2b-256 015bbdd82da6946f5200b04c88205660246fce4afaf9cd1fbc6ef8fb111fe9a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for cre_router-0.2.1-py3-none-any.whl:

Publisher: release.yml on ymoslem/CRE-Router

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

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