forked from phoenix/litellm-mirror
fix(proxy_server.py): don't override cache params on proxy config if set
This commit is contained in:
parent
ebf17d99e5
commit
f0434350f1
1 changed files with 10 additions and 4 deletions
|
@ -1686,16 +1686,22 @@ class ProxyConfig:
|
||||||
|
|
||||||
verbose_proxy_logger.debug(f"passed cache type={cache_type}")
|
verbose_proxy_logger.debug(f"passed cache type={cache_type}")
|
||||||
|
|
||||||
if cache_type == "redis" or cache_type == "redis-semantic":
|
if (
|
||||||
|
cache_type == "redis" or cache_type == "redis-semantic"
|
||||||
|
) and len(cache_params.keys()) == 0:
|
||||||
cache_host = litellm.get_secret("REDIS_HOST", None)
|
cache_host = litellm.get_secret("REDIS_HOST", None)
|
||||||
cache_port = litellm.get_secret("REDIS_PORT", None)
|
cache_port = litellm.get_secret("REDIS_PORT", None)
|
||||||
cache_password = litellm.get_secret("REDIS_PASSWORD", None)
|
|
||||||
|
|
||||||
cache_params.update(
|
cache_params.update(
|
||||||
{
|
{
|
||||||
"type": cache_type,
|
"type": cache_type,
|
||||||
"host": cache_host,
|
"host": cache_host,
|
||||||
"port": cache_port,
|
"port": cache_port,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
if litellm.get_secret("REDIS_PASSWORD", None) is not None:
|
||||||
|
cache_password = litellm.get_secret("REDIS_PASSWORD", None)
|
||||||
|
cache_params.update(
|
||||||
|
{
|
||||||
"password": cache_password,
|
"password": cache_password,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue