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: filter internal params in fallback code and fix test issues (#17941)

Alexsander Hamir6635325629ed
diff --git a/litellm/litellm_core_utils/fallback_utils.py b/litellm/litellm_core_utils/fallback_utils.py
index 7ce53862089..aa5bdd92713 100644
--- a/litellm/litellm_core_utils/fallback_utils.py
+++ b/litellm/litellm_core_utils/fallback_utils.py
@@ -3,7 +3,7 @@ from typing import Optional
import litellm
from litellm._logging import verbose_logger
-from litellm.litellm_core_utils.core_helpers import safe_deep_copy
+from litellm.litellm_core_utils.core_helpers import safe_deep_copy, filter_internal_params
from .asyncify import run_async_function
@@ -49,6 +49,9 @@ async def async_completion_with_fallbacks(**kwargs):
else:
model = fallback
+ # Filter out internal parameters that shouldn't be sent to provider APIs
+ completion_kwargs = filter_internal_params(completion_kwargs)
+
response = await litellm.acompletion(
**completion_kwargs,
model=model,
diff --git a/tests/local_testing/test_completion.py b/tests/local_testing/test_completion.py
index a72751d6f58..d06568c8796 100644
--- a/tests/local_testing/test_completion.py
+++ b/tests/local_testing/test_completion.py
@@ -3118,8 +3118,9 @@ async def test_completion_bedrock_httpx_models(sync_mode, model):
def test_completion_bedrock_titan_null_response():
try:
+ # amazon.titan-text-lite-v1 is deprecated, using titan-text-express-v1 instead
response = completion(
- model="bedrock/amazon.titan-text-lite-v1",
+ model="bedrock/amazon.titan-text-express-v1",
messages=[
{
"role": "user",
diff --git a/tests/local_testing/test_gcs_bucket.py b/tests/local_testing/test_gcs_bucket.py
index b3eaf4d9ca0..fbca0e0060d 100644
--- a/tests/local_testing/test_gcs_bucket.py
+++ b/tests/local_testing/test_gcs_bucket.py
@@ -108,7 +108,6 @@ async def test_aaabasic_gcs_logger():
},
"endpoint": "http://localhost:4000/chat/completions",
"model_group": "gpt-3.5-turbo",
- "deployment": "azure/gpt-4.1-mini",
"model_info": {
"id": "4bad40a1eb6bebd1682800f16f44b9f06c52a6703444c99c7f9f32e9de3693b4",
"db_model": False,
@@ -216,7 +215,6 @@ async def test_basic_gcs_logger_failure():
},
"endpoint": "http://localhost:4000/chat/completions",
"model_group": "gpt-3.5-turbo",
- "deployment": "azure/gpt-4.1-mini",
"model_info": {
"id": "4bad40a1eb6bebd1682800f16f44b9f06c52a6703444c99c7f9f32e9de3693b4",
"db_model": False,
@@ -626,7 +624,6 @@ async def test_basic_gcs_logger_with_folder_in_bucket_name():
},
"endpoint": "http://localhost:4000/chat/completions",
"model_group": "gpt-3.5-turbo",
- "deployment": "azure/gpt-4.1-mini",
"model_info": {
"id": "4bad40a1eb6bebd1682800f16f44b9f06c52a6703444c99c7f9f32e9de3693b4",
"db_model": False,