mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
* feat(complexity_router): plan-mode tier floor for coding-agent clients Claude Code and Copilot signal plan mode only through client-injected prompt text, which the ask-extraction path deliberately strips, so the router could never see it. Detect the sentinels on the raw wire body and route those requests to at least plan_mode_min_tier. The floor is raise-only and transient: classifier results above it still win, it overrides a session-affinity pin only on turns carrying the sentinel without rewriting the pin, and plan_mode decisions are not pinnable, so the first turn after plan mode exits routes as if plan mode had never happened. Classification is skipped when the floor is the top configured tier. On adaptive routers the floor rides _soft_floor_pick as a hard_floor that excludes below-floor candidates, closing the adaptive_eligible=all gap where a request classified at or above the floor could still route below it. Detection is staleness-aware: only leading system content and the newest-ask tail count, so sentinels surviving in history after plan mode exits, built-in or operator-supplied, never fire. Custom tier sets are supported with severity from the tier_definitions list order, same as keyword_tier_rules. Off by default; decisions are recorded with the new plan_mode cause and the matched sentinel in matched_keyword * fix(complexity_router): gate pin writes and the failure exit on sentinel presence, not the floor binding A plan-mode turn classified at or above the floor keeps its ordinary cause, but pinning it would carry a plan-mode-shaped choice past plan mode's exit (on adaptive routers the hard floor constrained that pick), so no sentinel-carrying turn writes the session pin. The default_model failure exit is skipped for sentinel turns for the same reason: default_model's placeholder tier can equal the floor while default_model itself sits in no pool the floor can vouch for |
||
|---|---|---|
| .. | ||
| adaptive_router | ||
| test_auto_router.py | ||
| test_base_routing_strategy.py | ||
| test_budget_limiter_hotpath.py | ||
| test_complexity_router.py | ||
| test_lar1_routing.py | ||
| test_litellm_encoder.py | ||
| test_lowest_latency.py | ||
| test_quality_router.py | ||
| test_router_routing_groups.py | ||
| test_router_routing_plugins.py | ||
| test_router_tag_regex_routing.py | ||
| test_router_tag_routing.py | ||
| test_savings_baseline.py | ||