mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-05 01:59:27 +00:00
* fix(router): count least-busy calls under the deployment's own group Least-busy counted an in-flight call under the name the caller asked for, while picks read counts under the group they pick in. A call that reached a deployment through a complexity router, a model_group_alias, or a wildcard was invisible to the next pick for that deployment's group, so overlapping calls stacked on one deployment. Picks and counts now both key on the deployment's own model_name, falling back to the requested group when no deployment name is known. Direct group calls keep the exact counter key they had before. * fix(router): count Vertex pass-through and stale-metadata calls under the deployment's own group Vertex pass-through now stamps the resolved deployment's model_name after the caller's metadata merge, so its least-busy count uses the same key as the pick. The count's group now comes only from the metadata bucket stamped for the call's own deployment, so an outer router's leftover bucket cannot rename it. The in-flight test bounds its wait and cleans up its tasks * fix(router): free least-busy counts when a pass-through call fails upstream Pass-through upstream errors skip the logging failure handlers and reach callbacks only through async_post_call_failure_hook, so a rejected Vertex call kept its deployment counted busy until the 1 hour TTL ran out. Least-busy now settles pass-through calls from that hook, and a second settle for the same call is a no-op Also covers a Vertex call by alias followed by one by the group name * fix(proxy): drop a client-sent deployment_model_name from request metadata * fix(router): free a pass-through least-busy count only for a call it saw start A failure hook payload without a litellm_call_id, such as a 401 body or a pre-call rejection, no longer lowers a deployment's count * fix(router): free a pass-through failure's least-busy count only for a pass-through start The proxy failure hook gets the client's own body when a pass-through request fails before the provider call, on a 401 or a pre-call 429. A body that named a running chat call's litellm_call_id and deployment freed that call's count, so the next pick went to the busy deployment. A chat caller picks its own id with x-litellm-call-id, so the id is not a secret Each started call now records whether it started as a pass-through call, and the failure hook frees a count only for a pass-through start under the call id the failure names. The logging success and failure paths still end any start * fix(logging): keep the logged call type when a request param is named call_type update_environment_variables spread optional_params after setting call_type, so a provider that keeps unknown body keys (Gemini on Vertex) let a chat body's "call_type": "pass_through_endpoint" replace the call type every callback sees. Least-busy reads that value to flag a pass-through start, so a caller could mark its own chat call as pass-through and free its count with a failing pass-through request naming its x-litellm-call-id call_type now goes after the optional_params spread. The pass-through routes still set it through additional_params, which no caller fills from a request --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| adaptive_router | ||
| complexity_router | ||
| switchyard_router | ||
| __init__.py | ||
| test_auto_router.py | ||
| test_auto_router_model_naming.py | ||
| test_auto_router_tuning_baseline.py | ||
| test_base_routing_strategy.py | ||
| test_baseline_request.py | ||
| test_budget_limiter.py | ||
| test_budget_limiter_hotpath.py | ||
| test_complexity_router.py | ||
| test_complexity_tier_predictor.py | ||
| test_fuse_presets.py | ||
| test_lar1_routing.py | ||
| test_least_busy.py | ||
| test_litellm_encoder.py | ||
| test_llm_v2.py | ||
| test_lowest_cost.py | ||
| test_lowest_latency.py | ||
| test_lowest_tpm_rpm.py | ||
| test_lowest_tpm_rpm_v2.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 | ||
| test_simple_shuffle.py | ||
| test_stall_detector.py | ||