litellm/tests/test_litellm/router_strategy
daqiangganjun 8327cd6d47
fix(router): count provider budget spend on every API surface (#38172)
* fix(router): count provider budget spend on every API surface

RouterBudgetLimiting read custom_llm_provider from litellm_params, which only
chat completions populates. Responses, anthropic_messages, embedding and rerank
calls raised inside the success callback before any spend was recorded, so those
budgets never moved and a ceiling made up mostly of that traffic was never hit.

Read the provider from the standard logging payload, which every surface fills
in. Dropping the raise also stops one missing field from taking the deployment
and tag budgets down with it.

* chore(router): drop the inline comment and type the budget limiter test helper

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-09-25 14:06:49 -07:00
..
adaptive_router fix(router): fall back from unhealthy auto-router tier (#40757) 2026-09-11 11:51:55 -07:00
complexity_router feat(router): native compact-to-fit across conversation APIs (#42074) 2026-09-21 22:52:29 -07:00
test_auto_router.py address review: trim remaining comment verbosity 2026-09-05 15:43:03 -07:00
test_base_routing_strategy.py fix(router): keep the routing and budget sync loops quiet while the Redis breaker is open 2026-09-10 19:15:40 -07:00
test_budget_limiter.py fix(router): count provider budget spend on every API surface (#38172) 2026-09-25 14:06:49 -07:00
test_budget_limiter_hotpath.py fix(router): await budget redis pipeline before sync reads (internal copy of #32618) (#43125) 2026-09-24 22:27:13 -07:00
test_complexity_router.py feat(router): native compact-to-fit across conversation APIs (#42074) 2026-09-21 22:52:29 -07:00
test_complexity_tier_predictor.py feat(router): add heuristic v2 complexity routing (#39276) 2026-09-02 23:33:04 +00:00
test_fuse_presets.py fix(router): preserve unavailable Fuse presets 2026-09-19 11:48:40 -07:00
test_lar1_routing.py chore: litellm oss staging (#31185) 2026-06-26 09:17:44 -07:00
test_least_busy.py fix(redis): log an open circuit breaker once instead of a traceback per request and count sync timeouts as timeouts 2026-09-10 13:50:34 -07:00
test_litellm_encoder.py fix: address cross-version CI failures 2026-09-02 14:17:19 -07:00
test_llm_v2.py feat(ui): show Capability and FUSE v2 routing forecasts 2026-09-19 17:04:14 -07:00
test_lowest_cost.py fix(router): give cost-based routing its own cache key so it stops overwriting latency samples (#40225) 2026-09-08 13:56:06 -07:00
test_lowest_latency.py feat(router): support percentile-based TTFT routing (#40352) 2026-09-09 10:47:34 -07:00
test_lowest_tpm_rpm.py test(router): cover legacy lowest TPM selection 2026-09-18 02:39:58 -07:00
test_quality_router.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_router_routing_groups.py fix(proxy): stop leaking periodic tasks on every DB config reload (#42784) 2026-09-24 15:42:36 -05:00
test_router_routing_plugins.py fix(router): let prompt-management plugins see the caller's own messages 2026-09-06 02:44:45 -07:00
test_router_tag_regex_routing.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_router_tag_routing.py test: move tests/test_litellm root and small trees into tests/unit (#43186) 2026-09-25 11:30:43 -07:00
test_savings_baseline.py fix(router): drop a tier param the routed target cannot take (#38622) 2026-08-28 14:17:49 -07:00
test_simple_shuffle.py fix(router): honor team and key provider weights 2026-09-14 23:31:52 -07:00
test_stall_detector.py fix(router): anchor stall detection on the newest tool call 2026-09-04 16:03:20 -07:00