mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-30 01:08:33 +00:00
* feat(proxy): per-key and per-team model ITPM/OTPM limits in the v3 rate limiter Keys and teams can set model_itpm_limit and model_otpm_limit in their metadata. The v3 limiter counts input and output tokens for them separately, reserves the output at admission and credits the unused part back after the call, the same way project limits already work. Resolves LIT-11138 * test(proxy): cover key model OTPM limits on the fallback path * test(rate-limit): a fallback over the key model OTPM is skipped for the next one * fix(proxy): ignore malformed key and team model IO limits and keep charging them on project-covered batches * fix(proxy): keep key and team model IO limits on the native batch path and validate them per entry * fix(proxy): do not read project metadata for batch IO limits a covering project limit replaces * refactor(proxy): restore native PROJECT_OTPM_DESCRIPTOR_KEY export and share IO limit metadata helpers * fix(proxy): inherit team model ITPM/OTPM only without a key limit and read key/team limits like int() A key that sets its own model_itpm_limit or model_otpm_limit for a model is no longer also held to its team's limit for that model and direction, which matches how model_tpm_limit and model_rpm_limit are inherited. The batch output floor follows the same rule. Key and team limits now accept what the project limits accept, so numeric text and floats are read with int() and booleans are still ignored. * test(proxy): cover key and team IO limit inheritance on batch ITPM, numeric batch limits and socket paths * fix(proxy): name output token limits OTPM in batch rate limit errors * style(rust): apply rustfmt to the project IO scope list in the limiter builder * fix(proxy): name input token limits ITPM in batch rate limit errors * fix(proxy): check guaranteed-throughput key ITPM/OTPM limits against the team's limits * perf(proxy): parse team keys' ITPM/OTPM allocations once per limit type * fix(proxy): keep Final bindings out of the ITPM/OTPM allocation loop * test(proxy): cover key and team IO limits on batches and the team allocation check in integration --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| 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 | ||