litellm/tests/test_litellm/caching
devin-ai-integration[bot] 16db51e2cf
feat(caching): add semantic_cache_scope to isolate semantic cache hits per end user (#39590)
Semantic cache keys omit the prompt, so every end user behind one virtual key
shares a bucket and can be served another user's semantically similar response.
Add an opt-in cache_params.semantic_cache_scope (key | end_user) that appends the
authenticated end-user id to the tenant scope, read from metadata and
litellm_metadata so /v1/chat/completions, /v1/responses and /v1/messages are all
covered, falling back to the key scope when no end-user id is present. Expose the
setting in the cache settings API and the Admin UI cache settings form

Co-authored-by: yassin <yassin@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-03 18:44:54 -07:00
..
test_azure_blob_cache.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_caching.py feat(caching): add semantic_cache_scope to isolate semantic cache hits per end user (#39590) 2026-09-03 18:44:54 -07:00
test_caching_handler.py fix(caching): flush async cache writes cancelled at event loop shutdown 2026-08-26 11:47:10 -07:00
test_check_and_fix_namespace_none_guard.py chore: litellm oss staging160626 (#30527) 2026-06-16 18:23:13 -07:00
test_disk_cache.py fix(cache): make in-memory and disk cache increments atomic (#34013) 2026-07-20 15:51:01 -07:00
test_dual_cache.py fix(cache): use sync Redis batch reads (#39358) 2026-09-03 14:37:48 -07:00
test_embedding_router.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_evicted_client_closer.py test(caching): align closer tests with self-healing handlers 2026-08-04 18:23:06 -07:00
test_gcs_cache.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_in_memory_cache.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_llm_caching_handler.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_llm_client_cache_e2e.py fix: don't close HTTP/SDK clients on LLMClientCache eviction (#22925) 2026-03-05 12:00:38 -08:00
test_qdrant_semantic_cache.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_redis_cache.py fix(caching): don't trip redis circuit breaker on short timeout bursts (#38999) 2026-09-03 22:18:20 +00:00
test_redis_cluster_cache.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_redis_cluster_node_isolation.py fix(caching): keep a node timeout from forcing a cluster-wide topology reinit on redis-py 8.x (#39349) 2026-09-03 17:31:58 -07:00
test_redis_connection_pool.py fix(redis): coerce env var string types and fix param discovery through decorator wrappers (#30644) 2026-08-31 20:51:31 -07:00
test_redis_semantic_cache.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_s3_cache.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_valkey_semantic_cache.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00