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 1 - latency fix (#7655)

Ishaan Jafffd4648291656
diff --git a/litellm/caching/caching_handler.py b/litellm/caching/caching_handler.py
index 821224652cb..40c10017320 100644
--- a/litellm/caching/caching_handler.py
+++ b/litellm/caching/caching_handler.py
@@ -670,6 +670,8 @@ class LLMCachingHandler:
Raises:
None
"""
+ if litellm.cache is None:
+ return
new_kwargs = kwargs.copy()
new_kwargs.update(
@@ -678,8 +680,6 @@ class LLMCachingHandler:
args,
)
)
- if litellm.cache is None:
- return
# [OPTIONAL] ADD TO CACHE
if self._should_store_result_in_cache(
original_function=original_function, kwargs=new_kwargs