mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-04 01:48:57 +00:00
* feat(batches): share a model_info batch_enqueued_token_limit pool across teams and projects A model_list entry's model_info.batch_enqueued_token_limit is now one enqueued-token pool per model group, shared by every caller. Teams can hold per-model allocations in model_batch_enqueued_token_limit like projects, and team and project writes answer 400 when the allocations for a model would add up past its pool The pool never lifts the per-minute counters. A team allocation that covers every model in the batch lifts them like a team-wide limit. Pool and team allocation scopes are saved in a new trailing model_scopes field on the reservation record, so older pods still refund the rest * fix(proxy): draw wildcard-routed models from the wildcard route's batch enqueued-token pool * fix(proxy): charge a batch row's pool to the model serving it, not the deployment model an upload rewrote it to * fix(proxy): keep batch pools on the serving group and lift limits only for pooled team allocations A named model_list entry no longer draws from a wildcard route's pool, a team allocation lifts the per-minute and daily batch limits only when every model serving the batch has a pool, coverage reads the model serving each row so model-routed uploads count, the allocation query gets a bounded span name, and the file-reading opt-outs log one warning when they skip a configured pool. * fix(proxy): lift team batch limits only when the serving entry has a pool and keep project coverage on row models * fix(proxy): return batch allocation errors as plain text * fix(proxy): expire each batch pool reservation on its own and keep team allocations from lifting limits A model pool or team allocation reservation now lives in a per-scope sorted set with its own expiry, so a batch nobody retrieves through the proxy frees its tokens after the TTL even while other teams keep sending batches on that model. Key, team and project counters keep the shared counter older pods charge and refund. A team's per-model allocation now only caps the team's batches. Only a key or team-wide batch_enqueued_token_limit, which was admin-only before, lifts the per-minute and daily limits, so values a team admin saved before the upgrade never lift them. * perf(proxy): keep a running total beside each batch pool's reservations A pool or team allocation reserve summed every open reservation in Redis, so a pool with 10,000 open batches blocked Redis for about 11 ms on each batch create. The reserve now reads a running total, subtracts only the reservations that expired since, and rebuilds the total from the reservations when Redis evicts it. Both keys share one hash slot |
||
|---|---|---|
| .. | ||
| litellm_skills | ||
| model_capacity_golden | ||
| __init__.py | ||
| native_capacity_handler.py | ||
| parallel_request_limiter_v3_golden.json | ||
| test_async_post_call_streaming_iterator_hook.py | ||
| test_autorouter_baseline_cache.py | ||
| test_banned_keyword_list.py | ||
| test_batch_enqueued_tokens.py | ||
| test_batch_enqueued_tokens_rust.py | ||
| test_batch_file_validation.py | ||
| test_batch_rate_limiter.py | ||
| test_dynamic_rate_limiter.py | ||
| test_dynamic_rate_limiter_v3_on_native_limiter_rust.py | ||
| test_dynamic_rate_limiter_v3_rust.py | ||
| test_image_generation_guardrails.py | ||
| test_key_management_event_hooks.py | ||
| test_max_budget_per_session_limiter.py | ||
| test_max_iterations_limiter.py | ||
| test_message_thread_ownership.py | ||
| test_model_budget_shared_windows.py | ||
| test_model_capacity_native.golden.json | ||
| test_model_capacity_native.py | ||
| test_model_max_budget_limiter.py | ||
| test_parallel_request_limiter.py | ||
| test_parallel_request_limiter_v3.py | ||
| test_parallel_request_limiter_v3_native.py | ||
| test_parallel_request_limiter_v3_rust.py | ||
| test_post_call_failure_hook_integration.py | ||
| test_post_call_response_headers_hook.py | ||
| test_post_call_streaming_hook_integration.py | ||
| test_post_call_success_hook_integration.py | ||
| test_priority_class_share.py | ||
| test_prompt_cache_observer.py | ||
| test_prompt_injection_detection.py | ||
| test_proxy_hooks_init.py | ||
| test_proxy_rate_limit_provider_field.py | ||
| test_proxy_rate_limit_provider_field_capacity_rust.py | ||
| test_proxy_rate_limit_provider_field_rust.py | ||
| test_proxy_track_cost_callback.py | ||
| test_proxy_track_cost_callback_ledger.py | ||
| test_proxy_track_cost_callback_rust.py | ||
| test_rate_limiter_toctou_capacity_rust.py | ||
| test_rate_limiter_toctou_rust.py | ||
| test_search_free_tier.py | ||
| test_send_invite_email.py | ||
| test_sensitive_data_routing.py | ||
| test_tpm_concurrent.py | ||
| test_tpm_concurrent_rust.py | ||
| test_unit_test_max_model_budget_limiter.py | ||
| test_user_management_event_hooks.py | ||