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(proxy): resolve 'multiple values for keyword argument' in batch cancel and file retrieve

shin-bot-litellmdff7f83e7cfb
diff --git a/litellm/proxy/batches_endpoints/endpoints.py b/litellm/proxy/batches_endpoints/endpoints.py
index 220ecc5453c..f47e2e1667b 100644
--- a/litellm/proxy/batches_endpoints/endpoints.py
+++ b/litellm/proxy/batches_endpoints/endpoints.py
@@ -760,6 +760,9 @@ async def cancel_batch(
custom_llm_provider = (
provider or data.pop("custom_llm_provider", None) or "openai"
)
+ # Extract batch_id from data to avoid "multiple values for keyword argument" error
+ # data was cast from CancelBatchRequest which already contains batch_id
+ data.pop("batch_id", None)
_cancel_batch_data = CancelBatchRequest(batch_id=batch_id, **data)
response = await litellm.acancel_batch(
custom_llm_provider=custom_llm_provider, # type: ignore
diff --git a/litellm/proxy/openai_files_endpoints/files_endpoints.py b/litellm/proxy/openai_files_endpoints/files_endpoints.py
index 9ff4cc563b9..da267eac981 100644
--- a/litellm/proxy/openai_files_endpoints/files_endpoints.py
+++ b/litellm/proxy/openai_files_endpoints/files_endpoints.py
@@ -904,6 +904,9 @@ async def get_file(
llm_router=llm_router,
)
else:
+ # Remove file_id from data to avoid "multiple values for keyword argument" error
+ # data was initialized with {"file_id": file_id}
+ data.pop("file_id", None)
response = await litellm.afile_retrieve(
custom_llm_provider=custom_llm_provider, file_id=file_id, **data # type: ignore
)
diff --git a/tests/proxy_e2e_anthropic_messages_tests/test_claude_agent_sdk.py b/tests/proxy_e2e_anthropic_messages_tests/test_claude_agent_sdk.py
index 317313c0553..fcb10e79af3 100644
--- a/tests/proxy_e2e_anthropic_messages_tests/test_claude_agent_sdk.py
+++ b/tests/proxy_e2e_anthropic_messages_tests/test_claude_agent_sdk.py
@@ -16,10 +16,12 @@ from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions
# Test models from proxy_config.yaml
# Note: bedrock-converse-claude-sonnet-4.5 removed temporarily as the Bedrock Converse API
# for Claude Sonnet 4.5 may not be available in all regions/accounts
+# Note: bedrock-nova-premier requires an inference profile for on-demand throughput
+# https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles.html
TEST_MODELS = [
("bedrock-claude-sonnet-4.5", "Bedrock Invoke API"),
# ("bedrock-converse-claude-sonnet-4.5", "Bedrock Converse API"), # Disabled: not yet available in CI
- ("bedrock-nova-premier", "AWS Nova Premier"),
+ # ("bedrock-nova-premier", "AWS Nova Premier"), # Disabled: requires inference profile for on-demand throughput
]