diff --git a/litellm/router.py b/litellm/router.py index da04e59f18a..50064490961 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -1343,9 +1343,12 @@ 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: Final[dict[str, Any]] = {} + cache_config: dict[str, Any] = {} + + cache_config.update(cache_kwargs) + cache_type = cache_config.pop("type", cache_type) self.client_ttl = client_ttl self.kubernetes_pod_discovery: Final = KubernetesPodDiscovery() @@ -1370,8 +1373,6 @@ class Router: ) cache_config["db"] = str(redis_db) - # Add additional key-value pairs from cache_kwargs - cache_config.update(cache_kwargs) redis_cache = self._create_redis_cache(cache_config) if cache_responses: