From 9525e8609c02199f4b2027ca46739debe52356c5 Mon Sep 17 00:00:00 2001 From: yetuge <2219677952@qq.com> Date: Wed, 14 Oct 2026 12:00:47 +0000 Subject: [PATCH] docs: fix stale ttl entry in RedisSemanticCache docstring The `__init__` docstring documents a `ttl` argument, but the constructor has no such parameter, and its `**kwargs` are never read: the Redis connection is built only from redis_url/host/port/password, and a per-entry TTL comes from the `ttl` key in the kwargs of each set_cache/async_set_cache call, where `_get_ttl` picks it up at write time. Reword the `**kwargs` entry to say that instead of implying a constructor-level default. Documentation only; no behavior change. --- litellm/caching/redis_semantic_cache.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/caching/redis_semantic_cache.py b/litellm/caching/redis_semantic_cache.py index 8f99d76ba46..bddfd76f340 100644 --- a/litellm/caching/redis_semantic_cache.py +++ b/litellm/caching/redis_semantic_cache.py @@ -81,8 +81,10 @@ class RedisSemanticCache(BaseCache): embedding; defaults to the Router deployment's configured max_input_tokens embedding_timeout: Seconds a cache lookup may spend embedding the prompt before it gives up and lets the request continue to the LLM - ttl: Default time-to-live for cache entries in seconds - **kwargs: Additional arguments passed to the Redis client + **kwargs: Additional constructor arguments are accepted but currently + unused. Cache-entry TTL is not a constructor setting: _get_ttl reads + a `ttl` from the kwargs of each set_cache/async_set_cache call, so a + TTL applies to that individual cache write only Raises: Exception: If similarity_threshold is not provided or required Redis