style(router): remove explanatory comments per review feedback

This commit is contained in:
Lavya Tandel 2026-08-11 22:53:38 +05:30
parent 939467b351
commit ef4f1bdba1

View file

@ -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