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(init.py): rename feature_flag

Krrish Dholakiaa9fdfb5a99fb
diff --git a/litellm/__init__.py b/litellm/__init__.py
index 22255eb34a2..bf084e20118 100644
--- a/litellm/__init__.py
+++ b/litellm/__init__.py
@@ -146,7 +146,7 @@ return_response_headers: bool = (
)
##################
logging: bool = True
-enable_caching_on_optional_params: bool = (
+enable_caching_on_provider_specific_optional_params: bool = (
False # feature-flag for caching on optional params - e.g. 'top_k'
)
caching: bool = (
diff --git a/litellm/caching.py b/litellm/caching.py
index ab62c344064..6ed6eb9fdbb 100644
--- a/litellm/caching.py
+++ b/litellm/caching.py
@@ -1903,7 +1903,7 @@ class Cache:
param not in litellm_param_kwargs
): # check if user passed in optional param - e.g. top_k
if (
- litellm.enable_caching_on_optional_params is True
+ litellm.enable_caching_on_provider_specific_optional_params is True
): # feature flagged for now
if kwargs[param] is None:
continue # ignore None params
diff --git a/litellm/tests/test_caching.py b/litellm/tests/test_caching.py
index b08f0039c48..a5579560680 100644
--- a/litellm/tests/test_caching.py
+++ b/litellm/tests/test_caching.py
@@ -302,7 +302,7 @@ def test_caching_with_models_v2():
def test_caching_with_optional_params():
- litellm.enable_caching_on_optional_params = True
+ litellm.enable_caching_on_provider_specific_optional_params = True
messages = [
{"role": "user", "content": "who is ishaan CTO of litellm from litellm 2023"}
]
@@ -352,7 +352,7 @@ def test_caching_with_optional_params():
print(f"response1: {response1}")
print(f"response2: {response2}")
pytest.fail(f"Error occurred:")
- litellm.enable_caching_on_optional_params = False
+ litellm.enable_caching_on_provider_specific_optional_params = False
embedding_large_text = (