mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-24 22:09:56 +00:00
* fix(router): keep chat and other non-batch calls off Azure batch-only deployments in mixed groups A model group that mixes an Azure chat deployment with an Azure mode: batch deployment load balanced chat, responses and every other non-batch call onto the batch-only deployment, which Azure answers with 400. Selection now skips Azure and azure_ai mode: batch deployments for any call outside the batch and file APIs while the group has another deployment, in the healthy set, the retry count and the order walk. Batch creates, retrieves, cancels and file calls still pick them, and a group of only batch deployments is unchanged. * fix(router): count only routable deployments for retries and cooldowns, keep fine-tuning on batch deployments A chat call on a group with one chat deployment and an Azure batch-only one counted both, so one 429 cooled down the lone chat deployment and skipped its retry. Retries and cooldowns now count only the deployments the call can use, and fine-tuning job calls keep the batch deployment like the other batch and file calls. * fix(router): keep pinned, vector store and container calls on Azure batch deployments A call pinned to a batch-only deployment keeps it. Vector store and container calls count as resource-scoped calls the batch deployment also takes, like file and fine-tuning calls Team and routing-group cooldown counts, host failure reports and the mock rate-limit path now count only the deployments the call can use, so a lone chat deployment beside a batch-only one keeps single-deployment rules everywhere * fix(router): skip Azure batch-only deployments before pre-call checks A too-long prompt on a mixed group now takes its context window fallback instead of a "no deployments" 429. Pre-call rate-limit refusals report whether the call is a batch API call, so a chat deployment's cooldown counts its batch peer only for calls that peer serves. Adds a direct test of is_batch_api_call_type for the router coverage check. * fix(router): never cool a chat deployment because of a batch-only peer A cooldown now counts only the deployments that could take every call the failing deployment serves, whatever call failed. A batch-only Azure deployment never stands in for a chat one, so a rate-limited file or batch call no longer cools the lone chat deployment and leaves chat with no deployment. Failure reports drop the batch_api flag, which no longer reaches the decision. * fix(router): cool a deployment for batch calls only when its batch-only peer can take them A 429 on a batch or file call against a deployment that is alone for chat but has an Azure batch-only peer now cools it under a separate key that only batch and file calls read. Chat keeps its only deployment, while batch and file calls move to the peer instead of hitting the rate-limited one again. Failure reports carry the batch_api flag again so host reports and pre-call refusals make the same decision as the call loop. * fix(router): decide the batch-only skip before capability filters A web search call the chat deployment cannot take used to leave only the batch-only deployment, so it got Azure's 400. The skip is now decided on the whole group first, so the call gets the same answer as the chat deployment alone. Also marks three call loop tests with rstest and runs cargo fmt. * fix(router): treat the batch-only deployment as absent for every chat filter Drop Azure batch-only deployments right where the skip is decided, so the health check filter, the allowed-fails safety net, route fallback and the pre-call, tag and usage pools see the group as if the chat deployment were alone. Weighted failover no longer counts a batch-only deployment as one left to try for a chat call, and a batch create refused by a pre-call check counts as a batch call, so its cooldown stays scoped to batch and file calls. --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| core | ||
| __init__.py | ||
| test_enforce_model_rate_limits.py | ||
| test_io_token_rate_limits.py | ||
| test_router.py | ||
| test_router_callback_hook_sequence.py | ||
| test_router_endpoints.py | ||
| test_router_entry_points.py | ||
| test_router_facade.py | ||
| test_router_fallbacks.py | ||
| test_router_fuzz_regressions_rust_only.py | ||
| test_router_get_deployments.py | ||
| test_router_helper_utils.py | ||
| test_router_host.py | ||
| test_router_max_parallel_requests.py | ||
| test_router_provider_endpoints.py | ||
| test_router_retries.py | ||
| test_router_surface_check.py | ||
| test_router_timeout.py | ||
| test_router_vector_store_endpoints.py | ||