diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py index 4084284f7d0..f7e32869a23 100644 --- a/litellm/proxy/utils.py +++ b/litellm/proxy/utils.py @@ -2075,11 +2075,8 @@ async def _lookup_deprecated_key( now_ts + _DEPRECATED_KEY_CACHE_TTL_SECONDS, ) return deprecated_row.active_token_id - # Cache negative result to avoid repeated DB lookups for invalid tokens - _deprecated_key_cache[hashed_token] = ( - None, - now_ts + _DEPRECATED_KEY_CACHE_TTL_SECONDS, - ) + # Only cache positive results; negative lookups are fast on indexed columns + # and caching them risks evicting real deprecated key entries. except Exception as e: verbose_proxy_logger.debug("Deprecated key lookup skipped: %s", e)