This release adds 3 notable features for engineering teams evaluating rollout.
✓ No known CVEs patched in this version
Topics
+7 more
Summary
AI summaryAdded LLM_ROUTER_EXPLAIN env var for routing summaries, cost comparison tables in llm_classify, and reason_code column with propagation.
Full changelog
Added
-
LLM_ROUTER_EXPLAIN=1response prefix (src/llm_router/tools/text.py)When set, every routed response (
llm_query,llm_research,llm_generate,llm_analyze,llm_code) is prefixed with a compact routing summary:[→ gemini-2.5-flash · query · $0.00003 · 42.9x cheaper than Sonnet]Shows: model used, task type, per-call cost, and cost ratio vs Sonnet baseline — the "why this model?" answer right in the response stream.
-
llm_classifycost comparison table (src/llm_router/tools/routing.py)The classification output now includes a "Why not a more expensive model?" breakdown showing Opus/Sonnet/Haiku costs side-by-side with the chosen tier, including a multiplier for each skipped tier (e.g. "↑ 60x more expensive — unnecessary for simple task"). Always shown; no env var required.
-
reason_codeDB column (src/llm_router/cost.py)New column in
routing_decisionstable for storing classification reasoning codes (idempotent migration).log_routing_decision()updated withreason_code: str | None = Noneparameter. -
router.pyreason_code propagation — passesreason_codefrom classification metadata tolog_routing_decision().
Technical
_explain_prefix()helper: pure function, zero overhead when env var not set.- Cost table uses per-1k-output-token pricing — representative of real-world savings signal.
- Routing tip injected into
llm_classifyoutput whenLLM_ROUTER_EXPLAINis not set.
Weekly OSS security release digest.
The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.
No spam, unsubscribe anytime.
Share this release
About ypollak2/llm-router
Subscription-aware LLM router for Claude Code. Routes tasks to 20+ providers (OpenAI, Gemini, Groq, Ollama, Codex) based on complexity classification, Claude subscription pressure, and cost. Free tasks stay on Claude subscription; expensive tasks fall back to the cheapest capable model. Includes 30 MCP tools, 6 auto-routing hooks, semantic dedup cache, prompt caching, daily spend cap, and a live web dashboard.
Related context
Related tools
Beta — feedback welcome: [email protected]