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 importing Cache from litellm (#6219)

Ishaan Jaffcda0a993e23c
diff --git a/litellm/caching/__init__.py b/litellm/caching/__init__.py
new file mode 100644
index 00000000000..65aea7f0975
--- /dev/null
+++ b/litellm/caching/__init__.py
@@ -0,0 +1 @@
+from .caching import Cache
diff --git a/tests/local_testing/test_caching.py b/tests/local_testing/test_caching.py
index 454068de8a0..b95b6668143 100644
--- a/tests/local_testing/test_caching.py
+++ b/tests/local_testing/test_caching.py
@@ -2291,3 +2291,10 @@ async def test_basic_rerank_caching(sync_mode, top_n_1, top_n_2, expect_cache_hi
assert response.results is not None
assert_response_shape(response, custom_llm_provider="cohere")
+
+
+def test_basic_caching_import():
+ from litellm.caching import Cache
+
+ assert Cache is not None
+ print("Cache imported successfully")