From dff7f83e7cfb2c924ef5b16e3bcd47ccf0be6425 Mon Sep 17 00:00:00 2001 From: shin-bot-litellm Date: Sat, 31 Jan 2026 21:26:29 +0000 Subject: [PATCH] fix(proxy): resolve 'multiple values for keyword argument' in batch cancel and file retrieve - batch_endpoints.py: Pop batch_id from data before creating CancelBatchRequest to avoid duplicate batch_id when data already contains it from earlier cast - files_endpoints.py: Pop file_id from data before calling afile_retrieve to avoid duplicate file_id when data was initialized with {"file_id": file_id} - test_claude_agent_sdk.py: Disable bedrock-nova-premier test as it requires an inference profile for on-demand throughput (AWS limitation) Fixes: e2e_openai_endpoints tests (test_batches_operations, test_file_operations) Fixes: proxy_e2e_anthropic_messages_tests (nova-premier model skip) --- litellm/proxy/batches_endpoints/endpoints.py | 3 +++ litellm/proxy/openai_files_endpoints/files_endpoints.py | 3 +++ .../test_claude_agent_sdk.py | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/litellm/proxy/batches_endpoints/endpoints.py b/litellm/proxy/batches_endpoints/endpoints.py index 220ecc5453..f47e2e1667 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 9ff4cc563b..da267eac98 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 317313c055..fcb10e79af 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 ]