Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

_create_redis_cache

Ishaan Jaff2a377b161d58
diff --git a/litellm/router.py b/litellm/router.py
index d1c410e7865..c2382098b04 100644
--- a/litellm/router.py
+++ b/litellm/router.py
@@ -618,8 +618,11 @@ class Router:
@staticmethod
def _create_redis_cache(
- cache_config: dict[str, Any]
- ) -> RedisCache | RedisClusterCache:
+ cache_config: Dict[str, Any]
+ ) -> Union[RedisCache, RedisClusterCache]:
+ """
+ Initializes either a RedisCache or RedisClusterCache based on the cache_config.
+ """
if cache_config.get("startup_nodes"):
return RedisClusterCache(**cache_config)
else: