You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Essentially the line .set(..., ex=ttl) combined with the other settings makes sure we can't get an infinite ttl. I've tried setting -1 in the settings (using the proxy) but that didn't work. Going into redis documentation I'm quite sure the only way to set an infinite ttl is to not pass it at all - e.g. have it set to the default None. But when we set it to None, litellm's internals convert it to the default of 60 seconds.
I thought about opening my own PR on this - but I'm not sure what is the correct way to go. Should the default be None making default TTLs infinite? Should defaults be configured on a framework level? Should we offer a constant value to enable litellm users to set an inifinite TTL (like an enum TTL.INFINITE or something).
Relevant log output
No response
Are you a ML Ops Team?
No
What LiteLLM version are you on ?
v1.58.1
Twitter / LinkedIn details
No response
The text was updated successfully, but these errors were encountered:
What happened?
The current implementation of the Redis cache, prevents users from configuring cache as never-expiring.
This occurs mainly because of thes lines:
litellm/litellm/caching/redis_cache.py
Lines 142 to 149 in 24dd655
jointly with these:
litellm/litellm/caching/redis_cache.py
Lines 120 to 123 in 24dd655
litellm/litellm/caching/base_cache.py
Lines 22 to 34 in 24dd655
Essentially the line
.set(..., ex=ttl)
combined with the other settings makes sure we can't get an infinite ttl. I've tried setting-1
in the settings (using the proxy) but that didn't work. Going into redis documentation I'm quite sure the only way to set an infinite ttl is to not pass it at all - e.g. have it set to the defaultNone
. But when we set it toNone
,litellm
's internals convert it to the default of 60 seconds.I thought about opening my own PR on this - but I'm not sure what is the correct way to go. Should the default be
None
making default TTLs infinite? Should defaults be configured on a framework level? Should we offer a constant value to enablelitellm
users to set an inifinite TTL (like an enumTTL.INFINITE
or something).Relevant log output
No response
Are you a ML Ops Team?
No
What LiteLLM version are you on ?
v1.58.1
Twitter / LinkedIn details
No response
The text was updated successfully, but these errors were encountered: