mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix(caching): bound warning registry to prevent unbounded growth
This commit is contained in:
parent
c1f79fdf86
commit
3cf31e0c4d
1 changed files with 7 additions and 2 deletions
|
|
@ -393,13 +393,18 @@ class Cache:
|
|||
continue # ignore None params
|
||||
param_value = kwargs[param]
|
||||
cache_key += f"{param}: {param_value}"
|
||||
elif kwargs[param] is not None and param not in _warned_dropped_cache_params:
|
||||
elif (
|
||||
kwargs[param] is not None
|
||||
and param not in _warned_dropped_cache_params
|
||||
and len(_warned_dropped_cache_params) < 100
|
||||
):
|
||||
_warned_dropped_cache_params.add(param)
|
||||
verbose_logger.warning(
|
||||
"litellm.cache: provider-specific param '%s' is excluded from the cache key by default, "
|
||||
"so requests differing only in '%s' will return the same cached response. "
|
||||
"Set litellm.enable_caching_on_provider_specific_optional_params=True to include it in the key.",
|
||||
param, param,
|
||||
param,
|
||||
param,
|
||||
)
|
||||
|
||||
if is_semantic_cache:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue