Skip to content

ypollak2/llm-router

v7.2.0 Breaking

This release includes 2 breaking changes for platform teams planning a safe upgrade.

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

Renamed _CLAUDE_MODELS to _CLAUDE_CHEAP_MODELS, excluded Opus and expanded hard cap logic to block all Claude models.

Full changelog

Key Fixes

1. Claude Opus Cost Misclassification

  • Problem: Expensive Claude Opus ($15/1M) was incorrectly promoted to the front of routing chains when subscription quota was available
  • Root Cause: _CLAUDE_MODELS frozenset included both cheap models (Haiku/Sonnet at $3/1M) and expensive Opus
  • Fix: Renamed to _CLAUDE_CHEAP_MODELS and excluded Opus entirely. Hard cap logic (≥99% pressure) now blocks ALL Claude models, not just cheap ones

2. Test Environment Isolation (no_providers_env Fixture)

  • Problem: Tests expecting zero configured providers were picking up Ollama from .env files
  • Root Cause: monkeypatch.delenv wasn't enough because Pydantic Settings reads from both env vars AND .env files
  • Fix: Create a minimal mock config object that bypasses file-based configuration entirely

Changes

  • src/llm_router/profiles.py: Renamed _CLAUDE_MODELS_CLAUDE_CHEAP_MODELS, removed Opus, updated hard cap logic
  • src/llm_router/router.py: Enhanced QUOTA_BALANCED logging with provider priority indicators
  • tests/conftest.py: Improved no_providers_env fixture with manual config mocking

Test Status

✅ Core router tests: 100% passing (25+ tests)
✅ Codex routing tests: 100% passing in isolation (3 tests)
✅ test_no_providers_configured: Now passing
⚠️ Full suite: Environment isolation issues with pre-existing shared state (affects Codex routing tests only when run with full suite)

Availability

📦 PyPI
🐙 GitHub Release

Breaking Changes

  • Renamed `_CLAUDE_MODELS` to `_CLAUDE_CHEAP_MODELS` and removed Opus from the set
  • Hard cap logic now blocks all Claude models (previously only cheap ones) when quota pressure ≥99%

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]