litellm/tests/test_litellm/proxy/hooks
devin-ai-integration[bot] c6c3881d7f
fix(proxy): share model rate-limit buckets between a model_group_alias and its target (#42516)
* fix(proxy): share model rate-limit buckets between a model_group_alias and its target

A request sent under a model_group_alias counted in its own per-key, per-team,
per-org, and per-project model bucket, so a key could double a deployment's
default_api_key_rpm_limit / tpm_limit by alternating the alias and the model
group name, and a metadata model_rpm_limit / model_tpm_limit keyed by the
model group never applied to alias requests. The limiter now resolves the
requested name to its model group before keying any model bucket, looks the
limit up by the requested name first and the model group second, and charges
post-call tokens to the same bucket.

* fix(proxy): charge the model group resolved at admission when reconciling reserved tokens

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-09-22 13:31:58 -07:00
..
litellm_skills test: use local model cost map in import-isolation subprocess 2026-08-30 12:47:15 -07:00
test_async_post_call_streaming_iterator_hook.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_autorouter_baseline_cache.py fix(proxy): estimate auto-router baseline costs from durable cache history 2026-09-19 12:44:47 -07:00
test_batch_enqueued_tokens.py test(batch): prove an open Redis breaker keeps enqueued-token reservations quiet 2026-09-10 14:26:11 -07:00
test_batch_file_validation.py Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_batch_enqueued_token_limit 2026-08-19 19:31:46 -07:00
test_batch_rate_limiter.py fix(rate_limiter): render the 429 reset time in UTC as labelled 2026-09-19 00:40:51 +00:00
test_dynamic_rate_limiter.py fix(dynamic_rate_limiter): inject clock so active-project window is stable within a request (#32299) 2026-07-06 18:12:47 -07:00
test_dynamic_rate_limiter_v3.py fix(rate_limiter): skip non-Latin-1 x-litellm-priority header on /v1/messages (#40636) 2026-09-10 17:48:46 -07:00
test_image_generation_guardrails.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_key_management_event_hooks.py fix(proxy): write key deleted audit logs for cascade and alias key deletions (#42446) 2026-09-22 11:52:08 -07:00
test_max_budget_per_session_limiter.py fix(redis): quiet every per-request Redis fallback while the breaker is open 2026-09-10 14:18:53 -07:00
test_max_iterations_limiter.py Agents - add max budget + tpm/rpm limiting per agent AND per agent session (#22849) 2026-03-07 19:12:42 -08:00
test_model_max_budget_limiter.py fix(proxy): claim a finished batch's per-model budget charge atomically 2026-09-19 17:41:19 -07:00
test_parallel_request_limiter.py Litellm oss 090626 (#30021) 2026-06-10 10:34:07 -07:00
test_parallel_request_limiter_v3.py fix(proxy): share model rate-limit buckets between a model_group_alias and its target (#42516) 2026-09-22 13:31:58 -07:00
test_post_call_failure_hook_integration.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_post_call_response_headers_hook.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_post_call_streaming_hook_integration.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_post_call_success_hook_integration.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_prompt_cache_observer.py feat(proxy): predict prompt-cache costs across deployments 2026-09-12 14:02:45 -07:00
test_prompt_injection_detection.py merge: origin/main into litellm_prompt_injection_llm_api_check_dispatch 2026-09-18 07:43:34 +00:00
test_proxy_hooks_init.py [Fix] Proxy: Address Greptile feedback on hook-cycle PR 2026-05-04 20:13:31 -07:00
test_proxy_rate_limit_provider_field.py fix(proxy): remove duplicate user budget hook that 429'd zero-cost models 2026-09-16 15:42:15 -07:00
test_proxy_track_cost_callback.py fix(proxy): keep request metadata out of the cost tracking failure alert 2026-09-19 03:21:28 -07:00
test_rate_limiter_toctou.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_send_invite_email.py feat(proxy)!: default audit logs on for enterprise licenses (#37518) 2026-08-19 18:49:21 -07:00
test_sensitive_data_routing.py fix(redis): quiet every per-request Redis fallback while the breaker is open 2026-09-10 14:18:53 -07:00
test_tpm_concurrent.py fix(proxy): share model rate-limit buckets between a model_group_alias and its target (#42516) 2026-09-22 13:31:58 -07:00
test_user_management_event_hooks.py test(proxy): cover the user-created audit hook's database read-back 2026-07-31 19:48:30 +00:00