Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix DualCache import error in CI and update docstrings for cache coordinator

harish-berri354ad40d15f5
diff --git a/litellm/proxy/auth/handle_jwt.py b/litellm/proxy/auth/handle_jwt.py
index 9e7c0abd983..8cb871c9221 100644
--- a/litellm/proxy/auth/handle_jwt.py
+++ b/litellm/proxy/auth/handle_jwt.py
@@ -6,6 +6,8 @@ Currently only supports admin.
JWT token must have 'litellm_proxy_admin' in scope.
"""
+from __future__ import annotations
+
import fnmatch
import hashlib
import os
diff --git a/litellm/proxy/common_utils/cache_coordinator.py b/litellm/proxy/common_utils/cache_coordinator.py
index 24da9450ab8..92d9916098d 100644
--- a/litellm/proxy/common_utils/cache_coordinator.py
+++ b/litellm/proxy/common_utils/cache_coordinator.py
@@ -20,11 +20,27 @@ T = TypeVar("T")
class AsyncCacheProtocol(Protocol):
- """Protocol for cache backends used by EventDrivenCacheCoordinator."""
+ """Protocol for cache backends used by EventDrivenCacheCoordinator.
- async def async_get_cache(self, key: str, **kwargs: Any) -> Any: ...
+ Matches ``DualCache`` / ``UserApiKeyCache`` call shapes (explicit optional params
+ before ``**kwargs``), not only ``(key, **kwargs)``, so overloads validate.
+ """
+
+ async def async_get_cache(
+ self,
+ key: str,
+ parent_otel_span: Any = None,
+ local_only: bool = False,
+ **kwargs: Any,
+ ) -> Any: ...
- async def async_set_cache(self, key: str, value: Any, **kwargs: Any) -> Any: ...
+ async def async_set_cache(
+ self,
+ key: str,
+ value: Any,
+ local_only: bool = False,
+ **kwargs: Any,
+ ) -> Any: ...
class EventDrivenCacheCoordinator: