From 9498f330d735cfd7d62857c1bda760089671f1ea Mon Sep 17 00:00:00 2001 From: samearth17 Date: Mon, 10 Aug 2026 00:18:14 +0530 Subject: [PATCH] fix(router): apply cache_kwargs when Redis is not configured --- litellm/router.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/litellm/router.py b/litellm/router.py index feaf69a44ae..e7d91859ec6 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -528,6 +528,10 @@ class Router: cache_type: Literal["local", "redis", "redis-semantic", "s3", "disk"] = "local" # default to an in-memory cache redis_cache = None cache_config: Final[dict[str, Any]] = {} + # FIX: Apply cache_kwargs regardless of whether Redis is used + cache_config.update(cache_kwargs) + if "type" in cache_kwargs: + cache_type = cache_kwargs["type"] self.client_ttl = client_ttl if redis_url is not None or (redis_host is not None and redis_port is not None):