mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
fix(router.py): add modelgroup to call metadata
This commit is contained in:
parent
b6fe6b2839
commit
3a8d7ec835
3 changed files with 71 additions and 131 deletions
|
@ -62,6 +62,10 @@ class InMemoryCache(BaseCache):
|
|||
cached_response['cache'] = True # set cache-hit flag to True
|
||||
return cached_response
|
||||
return None
|
||||
|
||||
def flush_cache(self):
|
||||
self.cache_dict.clear()
|
||||
self.ttl_dict.clear()
|
||||
|
||||
|
||||
class RedisCache(BaseCache):
|
||||
|
@ -97,6 +101,9 @@ class RedisCache(BaseCache):
|
|||
traceback.print_exc()
|
||||
logging.debug("LiteLLM Caching: get() - Got exception from REDIS: ", e)
|
||||
|
||||
def flush_cache(self):
|
||||
self.redis_client.flushall()
|
||||
|
||||
class DualCache(BaseCache):
|
||||
"""
|
||||
This updates both Redis and an in-memory cache simultaneously.
|
||||
|
@ -147,6 +154,10 @@ class DualCache(BaseCache):
|
|||
return result
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
|
||||
def flush_cache(self):
|
||||
self.redis_cache.flush_cache()
|
||||
self.in_memory_cache.flush_cache()
|
||||
|
||||
#### LiteLLM.Completion Cache ####
|
||||
class Cache:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue