litellm/tests/unit/caching
Kerry Lu 0f786fa1c7
feat(router): add deployment rpd and tpd daily limits to enforce_model_rate_limits (#48875)
* feat(router): add deployment rpd and tpd daily limits to enforce_model_rate_limits

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(router): route rate limit cache increments through typed helpers

* chore(ui): regenerate schema.d.ts for deployment rpd and tpd fields

* test(types): add rpd and tpd to the owned litellm_params inventory

* fix(router): run daily rpd/tpd checks after the minute checks and increment rpm and rpd in one cache trip

* fix(router): flatten the async rpm reject branch for the ruff strict gate

* fix(router): hand rpm and rpd back on any rate limit reject

A request the rpm, rpd or tpd check rejects no longer keeps its request counts, so retries against a deployment whose rpd is spent cannot fill its rpm and block the in-group fallover with the minute 429.

* test(router): a minute-rejected request no longer keeps its rpm count

---------

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-28 15:52:44 -07:00
..
__init__.py
test_azure_blob_cache.py
test_cache_preset_key.py
test_caching.py
test_caching_handler.py
test_check_and_fix_namespace_none_guard.py
test_disk_cache.py
test_dual_cache.py
test_embedding_router.py
test_evicted_client_closer.py
test_gcs_cache.py
test_in_memory_cache.py
test_llm_caching_handler.py
test_llm_client_cache_e2e.py
test_qdrant_semantic_cache.py
test_redis_batch.py
test_redis_cache.py
test_redis_cluster_cache.py
test_redis_cluster_node_isolation.py
test_redis_connection_pool.py
test_redis_semantic_cache.py
test_request_redis_batch_post_call.py
test_request_redis_batch_pre_call.py
test_responses_stream_cache_keys.py
test_s3_cache.py
test_unit_test_caching.py
test_valkey_semantic_cache.py