forked from phoenix/litellm-mirror
Merge pull request #2789 from BerriAI/litellm_set_ttl
fix(proxy_server.py): allow user to set in-memory + redis ttl
This commit is contained in:
commit
7233e5ab25
3 changed files with 22 additions and 2 deletions
|
@ -1908,6 +1908,12 @@ class ProxyConfig:
|
|||
global redis_usage_cache
|
||||
from litellm import Cache
|
||||
|
||||
if "default_in_memory_ttl" in cache_params:
|
||||
litellm.default_in_memory_ttl = cache_params["default_in_memory_ttl"]
|
||||
|
||||
if "default_redis_ttl" in cache_params:
|
||||
litellm.default_redis_ttl = cache_params["default_in_redis_ttl"]
|
||||
|
||||
litellm.cache = Cache(**cache_params)
|
||||
|
||||
if litellm.cache is not None and isinstance(litellm.cache.cache, RedisCache):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue