Skip to content

ypollak2/llm-router

v2.2.0 Feature

This release adds 3 notable features for engineering teams evaluating rollout.

Published 1mo LLM Frameworks
✓ No known CVEs patched
Read the diff → Tool health → What is this tool? →

✓ No known CVEs patched in this version

Topics

ai-routing anthropic claude claude-code cost-optimization gemini
+7 more
litellm llm llm-router mcp-server model-router ollama openai

Summary

AI summary

Added 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=1 response 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_classify cost 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_code DB column (src/llm_router/cost.py)

    New column in routing_decisions table for storing classification reasoning codes (idempotent migration). log_routing_decision() updated with reason_code: str | None = None parameter.

  • router.py reason_code propagation — passes reason_code from classification metadata to log_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_classify output when LLM_ROUTER_EXPLAIN is 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

Track ypollak2/llm-router

Get notified when new releases ship.

Sign up free

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.

All releases →

Related context

Earlier breaking changes

  • v9.2.0 Changes auto‑route directive from advisory "DO NOT SKIP" to hard constraint with explicit blocked tools list.
  • v9.2.0 Breaks permanent downgrade of enforcement after first Edit/Write; v13 now requires per‑turn routing.

Beta — feedback welcome: [email protected]