diff --git a/litellm/router.py b/litellm/router.py index b91c2e364e3..8ab38305b7c 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -969,18 +969,16 @@ class Router: self.deployment_names: list = [] # names of models under litellm_params. ex. azure/chatgpt-v-2 self.deployment_latency_map = {} ### CACHING ### - cache_type: Literal["local", "redis", "redis-semantic", "s3", "disk"] = "local" # default to an in-memory cache + cache_type: Literal["local", "redis", "redis-semantic", "s3", "disk"] = "local" redis_cache = None - cache_config: dict[str, Any] = {} # mutable-ok: built incrementally from cache_kwargs, then passed to litellm.Cache() + cache_config: dict[str, Any] = {} - # Apply cache_kwargs so they're available regardless of Redis presence. - # "type" is extracted to avoid duplicate keyword arg in litellm.Cache() below. cache_config.update(cache_kwargs) - cache_type = cache_config.pop("type", cache_type) # rebind-ok: cache_type may be overridden to "redis" below + cache_type = cache_config.pop("type", cache_type) self.client_ttl = client_ttl if redis_url is not None or (redis_host is not None and redis_port is not None): - cache_type = "redis" # rebind-ok: switch to Redis when Redis params are provided + cache_type = "redis" if redis_url is not None: cache_config["url"] = redis_url