Five concrete outcomes
- Failover on the right errors only. Error classifier rule separates transient (5xx, rate-limit) from permanent (4xx, auth, malformed) — never burns a fallback on a bad API key.
- Streaming and non-streaming from one call site. Dual-path rule keeps the surface clean.
- Tool calls normalized across providers. Anthropic's
tool_use, OpenAI'stool_calls, Gemini'sfunction_call— unified shape, one parser. - Cost-aware routing with a hard ceiling. Cheapest-first with budget guard. P95 latency tracking with stickiness floor and jitter handling.
- Cache discipline you can defend. Exact + semantic cache, TTL discipline, invalidation rules — not a
dictthat grows forever.
What's inside
10 enforceable .mdc rule files + bundled CLAUDE.md + working reference/llm_router.py (~200 LOC) with adapters for Anthropic, OpenAI, Gemini, and OpenRouter, plus reference/tests/test_llm_router.py.
FAQ
Does this replace LiteLLM, Portkey, or OpenRouter?
No — it complements them. The rules describe correct routing behavior; the reference router shows how that behavior looks in code. You can apply the same patterns inside LiteLLM, Portkey, or your own router.
Are the adapters production-ready or just demos?
Production-ready in shape (proper streaming, tool-call normalization, error classification) — but the reference is intentionally readable, not optimized for every edge case. Treat it as a foundation you extend, not a black box.
Can I add a Bedrock adapter?
Yes — the provider-abstraction.mdc rule defines the contract. The Bedrock adapter is a 50-line addition that the rules will guide your agent to write correctly.
Personal vs Commercial?
Personal is one developer, unlimited Personal Projects. Commercial covers an entire legal entity, paid client work, internal forking. See LICENSE.
Updates and refunds?
Patch-level v1.x updates free for life of license. 14-day no-questions refund through Lemon Squeezy.
Available now
Instant download after payment. 14-day no-questions refund. Crypto via Cryptomus; card via Lemon Squeezy (Merchant of Record — handles VAT, receipts, and refunds).