Cascaded Framework for Cost-Aware LLM Serving
Repo ymoslem/CRE-Router, read from GitHub 1 min ago. ymoslem has not joined Take My Repo.
estimate_stage2_cost: estimates the TPOT and E2EL that Stage 2 adds to a routing before deployment, from the training statistics alone. REPRODUCE.md shows how to call it.CITATION.cff, so GitHub shows how to cite the repository.cre fit --crossover-tol: treats two clusters' switching points within the tolerance as tied and also considers the routing that switches them in the other order. Takes a number or auto; the default, 0, is off.cre fit lists near-ties under "Near-ties", both within a cluster (--error-tol) and across clusters.cre --version.cre evaluate --help names --no-enable-prefix-caching for the vLLM server.teleqna_*_Oct2026.json.example_config_teleqna.yaml serves Qwen3-4B-Instruct and Gemma4-26B and loads the matching Qwen3-4B estimator.--no-enable-prefix-caching, so later runs of the same prompts are not timed with a cached prefill.cre fit plans Stage 2: it escalates to the most accurate model the routing uses and gates every cluster served by a cheaper model, saves the plan in router.json, and prints the estimators to train next. --escalate-to sets the target by hand.cre qe-data, which builds a gated model's estimator data from its cre evaluate generations. The logic moves from data/prep_qe.py into cre_router.qe.data.params in the serving config, laid over every request to that model, so a config sets each model's sampling and switches Gemma 4's reasoning. example_config_telemath_tpot.yaml serves the TeleMath routing at a TPOT budget of 25 ms.configs/routings/telemath_e2el_b120s_1xA100_Sep2026.json, listed in REPRODUCE.md.cre serve escalates a rejected answer straight to the planned target, instead of climbing a ladder of models ordered by cost. Artifacts written by an earlier cre fit must be fitted again before serving with QE.README.md and the PyPI description walk through every step from cre cluster to cre serve, Stage 2 included.cre cascade, in favour of cre compose. It estimated Stage 1 + 2 from per-cluster averages, pricing every escalated question at the strong model's cluster average; cre compose measures Stage 1 + 2 on the batches that were actually served, and every reported Stage 1 + 2 number comes from it. Replace cre cascade --stats <file> with cre compose --routing <spec>, using a routing spec like those in configs/routings/.
Removed with it: cascade_system_metrics, cascade_system_metrics_ntier, cascade_system_accuracy and cluster_cascade_accuracy in cre_router.routing, ModelStats.output_tokens_for, and the --out option of cre qe-cascade, which wrote the file only cre cascade read. cre qe-cascade still reports each cluster's cascade accuracy and escalations.
The *_2xA100_Jun2026.json configs, in favour of the September 2026 configs, which cover AIME, TeleQnA and TeleMath on one and two A100s under vLLM 0.19.0.
The routing tests run on the September 2026 two-card stats, and check each fit against the routing spec in configs/routings/ it must reproduce, with expected values recomputed from the stats files.
The system diagram marks Stage 1 in violet and is cropped to the drawing.
REPRODUCE.md states its scope, every routing and every Stage 1 + 2 number, and lists both TeleMath one-card budgets at which per-cluster cost changes the routing.
The release workflow attaches the built packages to an existing GitHub release instead of failing.
cre compose measures a routing's Stage 1 and Stage 1 + 2 accuracy, TPOT and E2EL on the batches that were actually served, including each escalation batch, from saved captures or the released captures dataset. A routing spec names the capture behind each tier and each gated cluster's escalation batch; clusters escalated together can share one batch. Every Stage 1 + 2 number the paper reports comes from it, and configs/routings/ holds a spec for each.
cre stats rebuilds the per-cluster stats file cre fit reads from saved captures, regrading every answer with its task's grader. A pool spec in configs/pools/ names the capture behind each model, and the shipped stats configs rebuild byte for byte from the released captures.
cre_router.captures reads a saved capture: it regrades each answer from its full output and joins each request to its question, checked on output length, so a capture that does not match its records is refused rather than composed.
cre_router.bootstrap gives confidence intervals for evaluations that cross questions with runs. gap() compares two systems on paired per-question differences, resampling questions and each system's runs; interval() keeps runs shared, for a difference between two stages of one system.
cre_router.throughput reports vLLM's whole-run output throughput together with the full-load (steady-state) throughput, the output tokens per second while every slot is busy.
Baselines: cre_router.baselines implements the FrugalGPT cascade (Chen et al., 2024), with per-stage thresholds, one scorer per tier and cost accounting for cascades of any depth, and the HybridLLM router (Ding et al., 2024) with its three label schemes.
The no-clustering ablation (k = 1) as routing specs, for TeleMath under TPOT and E2EL.
Stats configs carry cluster_e2el_ms, so --cost-metric e2el fits on every shipped config. New configs: TeleMath on one and two A100s, and AIME and TeleQnA on two A100s.
teleqna_think, the TeleQnA task for reasoning models, with the thinking sampling and a 40,960-token cap.
cre evaluate --max-output-tokens lowers a task's output cap for a model whose context cannot hold it. It can only lower the cap, and the stats entry records it.
A data extra (pyarrow) for reading the released datasets.
A TeleMath serving example, example_config_telemath.yaml, for the E2EL routing.
cre --help lists every command, each subcommand prints what it does, and every option shows its default.
cre evaluate raises EmptyCaptureError when no request in the run generated a token. Such a run used to finish as a well-formed stats file reading error 1.0 at 0.0 ms.
The serving examples use the reported one-card systems. The TeleQnA example serves Gemma4-E4B and Gemma4-26B with the Gemma4-E4B classifier, and the AIME example uses the VibeThinker-1.5B classifier trained on the reported captures.
The README quickstart and data-format links point to configs that exist, and each config's note names its own file.