mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(proxy_server.py): allow user to set in-memory + redis ttl
addresses - https://github.com/BerriAI/litellm/issues/2700
This commit is contained in:
parent
ceabf726b0
commit
203e2776f8
3 changed files with 22 additions and 2 deletions
|
@ -1914,6 +1914,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_in_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