mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-05 01:59:27 +00:00
* fix(router): let a latency-exhausted session pin fall back to the other deployments With latency-based routing and session affinity, a session pinned to a deployment that reached its rpm/tpm limit in the latency map got "No deployments available" until the minute reset, because the pin narrowed the candidates to that one deployment before the strategy rejected it. When latency routing is the request's effective strategy (request override, routing group or router default, under the name the pick keys its latency map by), a session pin to a deployment that a pick among it alone would reject now falls through to the healthy deployments, and a caller-key pin to that same deployment is skipped too. previous_response_id and encrypted-content pins still hold, and a pin check that fails keeps the pin. The check is the selector's own pick over the pinned deployment, so it reads the same counts and token estimate and takes the request input as given. With session_affinity_repin_on_failover on, a successful replacement moves the declined pin; the declined id rides in the request's own metadata and the proxy strips it from client metadata. Off by default, nothing changes. * fix(router): check a session pin against the input its pick counts A pick made through select() with its input passed beside the request (router.async_get_available_deployment(..., input=...)) kept that input out of the request kwargs, so the session pin check estimated no input tokens, kept a pin whose tpm budget the input would overrun, and the strategy then rejected it with no deployment left. The callback filters now receive the pick's own messages and input, and the session pin check estimates from that same input. * fix(router): keep declined affinity metadata out of provider payloads * fix(router): keep declined session pins in internal metadata * test(router): isolate declined pin metadata assertions * test(router): verify declined pin metadata isolation * refactor(router): reuse existing selection for session pin admission --------- Co-authored-by: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| pre_call_checks | ||
| __init__.py | ||
| test_access_windows.py | ||
| test_add_retry_fallback_headers.py | ||
| test_client_initalization_utils.py | ||
| test_cooldown_cache.py | ||
| test_cooldown_handlers.py | ||
| test_deployment_pricing.py | ||
| test_dynamic_queue.py | ||
| test_dynamic_queue_redis.py | ||
| test_dynamic_queue_router.py | ||
| test_embedding_batch_size_check.py | ||
| test_endpoint_eligibility.py | ||
| test_fallback_event_handlers.py | ||
| test_fallback_event_v2_dispatch.py | ||
| test_get_retry_from_policy.py | ||
| test_handle_error.py | ||
| test_health_check_allowed_fails_integration.py | ||
| test_health_state_cache.py | ||
| test_kubernetes_pod_discovery.py | ||
| test_pattern_match_deployments.py | ||
| test_prompt_caching_cache.py | ||
| test_ptu_shares.py | ||
| test_reasoning_effort_capability.py | ||
| test_request_priority.py | ||
| test_router_health_check_routing.py | ||
| test_router_interactions_endpoints.py | ||
| test_router_utils_common_utils.py | ||
| test_routing_read_batch.py | ||