llm-route-audit
Prove it before you route.
Test cheaper AI models on your own requests, and switch only where the answers stay just as good.
Demo run: the cheapest model everywhere cut cost to 19% but only 58% of answers passed; per-task routing kept every answer passing at 26% of the cost. Only 5 requests, so run it on your own logs.
The problem
Most teams send every request to their most expensive model, just to be safe. Model routers promise savings by guessing which requests are "easy", but nobody checks the guesses, so quality can drop without anyone noticing.
llm-route-audit replaces the guess with a test. It replays your real requests on cheaper models, grades each answer against the original, and tells you, task by task, where switching is safe:
| Task | Use | Why |
|---|---|---|
| Sorting tickets | claude-haiku-4-5 |
as good as the original on 49 of 50, 75% cheaper |
| Drafting replies | claude-sonnet-5-5 at low effort |
as good on 48 of 50, 55% cheaper |
| Reviewing contracts | keep claude-opus-5-5 |
no cheaper model was good enough |
Example output. Your numbers come from your own traffic.
What you get
- Lower bills, same quality. Switch only the tasks where a cheaper model matched the original.
- Proof, not guesses. Every pass rate and cost comes with a 95% range, measured on your requests.
- No surprise spend. A cost estimate before anything runs, a hard spending limit, and cached answers.
- Safe after the switch. Spot checks and user feedback catch quality drops, and the route can be sent back.
- Private. It runs on your machine. Nothing is sent anywhere except the model calls you approve.
How it works
your logs ─▶ test cheaper models ─▶ grade vs the original ─▶ report ─▶ switch ─▶ keep watching
- Test. Replay a sample of your logged requests on the models you choose to try.
- Grade. Compare every answer with the original: exact checks first, then an AI judge. Your own labels always win.
- Report. For each task, the cheapest model that kept at least 95% of the original's quality.
- Switch and watch. Export a routing table for your gateway or app, then monitor routed traffic over time.
Try it in one minute
No API key needed. The repository includes the results of a real run.
git clone https://github.com/good2idnan/llm-route-audit.git && cd llm-route-audit
uv sync
uv run llm-route-audit report examples/sample_logs.jsonl \
--replay examples/demo/replay.jsonl --grades examples/demo/grades.jsonl --min-samples 1
Use it on your traffic
pip install llm-route-audit
List the models to try in candidates.yaml:
candidates:
- model: claude-haiku-4-5
- model: claude-sonnet-5-5
effort: low
Then run:
llm-route-audit analyze logs.jsonl # what you spend today
llm-route-audit replay logs.jsonl -c candidates.yaml --max-spend 1 # try the cheaper models
llm-route-audit grade logs.jsonl --config grading.yaml # mark every answer (rules per task)
llm-route-audit report logs.jsonl # where switching is safe
llm-route-audit export logs.jsonl --out routing-policy.yaml # your routing table
After you switch, monitor, outcomes and status keep an eye on quality. Every command shows its cost first and asks before spending.
Works with
| Models | Anthropic, OpenAI, Google Gemini, OpenRouter, Ollama, any OpenAI-compatible server |
| Logs | LiteLLM, Langfuse, OpenTelemetry, or simple JSONL |
| Routing | LiteLLM config export, or the built-in runtime router for Python apps |
| Also audits | tool-using agents (step by step and whole sessions) and auto-routers such as OpenRouter's |
Learn more
- Full guide: every command and option
- Agents · Audit a router · Runtime router · Log format · FAQ
- Changelog · Contributing
License
Metadata
Release files for llm-route-audit 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llm_route_audit-0.3.2.tar.gz | 213.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_route_audit-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 343.3 kB
Release files / llm_route_audit-0.3.2.tar.gz
| Download URL | llm_route_audit-0.3.2.tar.gz |
|---|---|
| Size | 213.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e1be750b3391a90b997e9596078d8cf8aaad6b1a2afc541b44f38e44ce50bc6
|
|
BLAKE2b-256 checksum How to use checksums |
82cb4a05cc8cc6d3bf4fda755496045bc55741c8d9d5cb9cd37e9f29c5888645
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / llm_route_audit-0.3.2-py3-none-any.whl
| Download URL | llm_route_audit-0.3.2-py3-none-any.whl |
|---|---|
| Size | 130.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6886fccc0fa69d7d17c32365a2e92a1881a9cdcb8217efe440fdb27502a2a84d
|
|
BLAKE2b-256 checksum How to use checksums |
db1571c2526121fc7238cc2ef075a336913bf50c2ad2c251c6ca636e6d70e564
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|