Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

fix: exclude parallel_tool_calls for Bedrock models in LiteLLM - #10235

Closed
ghost wants to merge 3 commits into
mainfrom
fix/litellm-bedrock-parallel-tool-calls
Closed

fix: exclude parallel_tool_calls for Bedrock models in LiteLLM#10235
ghost wants to merge 3 commits into
mainfrom
fix/litellm-bedrock-parallel-tool-calls

Conversation

@ghost

@ghost ghost commented Dec 20, 2025

Copy link
Copy Markdown

Fixes the API error when using LiteLLM as a proxy to AWS Bedrock models.

Problem

Users were experiencing litellm.UnsupportedParamsError: bedrock does not support parameters: ['parallel_tool_calls'] when using LiteLLM to proxy requests to AWS Bedrock models. This is because Bedrock does not support the OpenAI-specific parallel_tool_calls parameter.

Solution

  • Added isBedrockModel() method to detect Bedrock models by checking for patterns like:
    • Model IDs containing "bedrock"
    • Model IDs starting with "anthropic.", "amazon.", or other AWS provider prefixes
    • AWS Bedrock model ID patterns
  • Modified the request options to conditionally exclude parallel_tool_calls when routing to Bedrock models
  • Added comprehensive tests to verify the fix works for Bedrock models while maintaining existing behavior for other models

Testing

  • All existing tests pass ✅
  • Added 3 new test cases covering:
    • Bedrock models excluding parallel_tool_calls
    • Non-Bedrock models still including parallel_tool_calls
    • Default behavior when parallelToolCalls is not specified

View task on Roo Code Cloud


Important

Fixes LiteLLM to exclude unsupported parallel_tool_calls for AWS Bedrock models by detecting model patterns and updating request handling.

  • Behavior:
    • Adds isBedrockModel() in lite-llm.ts to detect Bedrock models by checking model ID patterns.
    • Modifies createMessage() in lite-llm.ts to exclude parallel_tool_calls for Bedrock models.
  • Testing:
    • Adds tests in lite-llm.spec.ts to verify exclusion of parallel_tool_calls for Bedrock models and inclusion for non-Bedrock models.
    • Tests auto-detection and explicit configuration of Bedrock models.
  • UI:
    • Adds litellmUseAzureBedrock checkbox in LiteLLM.tsx for user configuration.
    • Updates settings.json with new UI text for Bedrock configuration.

This description was created by Ellipsis for 5d474ee. You can customize this summary. It will automatically update as commits are pushed.

@ghost

ghost commented Dec 20, 2025

Copy link
Copy Markdown
Author

Rooviewer Clock   See task on Roo Cloud

Review complete. Found 1 minor issue related to naming conventions.

  • Rename litellmUseAzureBedrock to litellmUseAwsBedrock or litellmUseBedrock (naming inconsistency: Azure vs AWS Bedrock)
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 20, 2025
@hannesrudolph
hannesrudolph marked this pull request as ready for review December 20, 2025 20:02
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Dec 20, 2025
@ghost

ghost commented Dec 20, 2025

Copy link
Copy Markdown
Author

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation correctly:

  • Adds isBedrockModel() method to detect Bedrock models via multiple patterns (including "bedrock", "anthropic.", "amazon.", and AWS provider prefixes)
  • Conditionally excludes parallel_tool_calls parameter for Bedrock models to fix the UnsupportedParamsError
  • Includes comprehensive test coverage for Bedrock models, non-Bedrock models, and default behavior

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

* Check if the model is routed through AWS Bedrock
* Bedrock doesn't support the parallel_tool_calls parameter
*/
private isBedrockModel(modelId: string): boolean {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn’t seem right

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roomote address this

@ghost ghost Dec 21, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixaroo Clock   See task on Roo Cloud

This issue was already addressed in commit bbd325f. The anthropic. prefix was removed from Bedrock detection to prevent false positives when users access Anthropic directly through LiteLLM. All tests pass.

View commit | Revert commit

@mrubens mrubens left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just add a checkbox/dropdown to the litellm provider about whether it’s bedrock? Maybe we want something like this for OpenAI compatible too so we can make sure to format the params correctly.

@hannesrudolph

Copy link
Copy Markdown
Contributor

Should we just add a checkbox/dropdown to the litellm provider about whether it’s bedrock? Maybe we want something like this for OpenAI compatible too so we can make sure to format the params correctly.

Yeah @roomote make it so

@ghost

ghost commented Dec 21, 2025

Copy link
Copy Markdown
Author

Fixaroo Clock   See task on Roo Cloud

Added a "Backend is AWS Bedrock" checkbox to the LiteLLM provider settings. This allows users to explicitly specify if their LiteLLM proxy routes to AWS Bedrock, instead of relying on auto-detection. All local checks passed.

View commit | Revert commit

- Add litellmUseAzureBedrock option to provider settings schema
- Add checkbox UI in LiteLLM settings to let users specify Bedrock backend
- Update isBedrockModel() to use user-specified option over auto-detection
- Add comprehensive tests for the new option
- Add English translations for the new setting
"getXaiApiKey": "Get xAI API Key",
"litellmApiKey": "LiteLLM API Key",
"litellmBaseUrl": "LiteLLM Base URL",
"litellmUseAzureBedrock": "Backend is AWS Bedrock",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typographical note: The key litellmUseAzureBedrock mentions 'Azure' while the value and description refer to 'AWS Bedrock'. Please verify if the key should be renamed (e.g., to litellmUseAWSBedrock) to avoid confusion.

litellmApiKey: z.string().optional(),
litellmModelId: z.string().optional(),
litellmUsePromptCache: z.boolean().optional(),
litellmUseAzureBedrock: z.boolean().optional(),

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming inconsistency: The property is named litellmUseAzureBedrock but it configures AWS Bedrock (Amazon), not Azure (Microsoft). This conflation of cloud providers in the variable name could confuse developers. Consider renaming to litellmUseAwsBedrock or litellmUseBedrock to match the actual functionality.

Fix it with Roo Code or mention @roomote and request a fix.

@github-project-automation github-project-automation Bot moved this from New to Done in Roo Code Roadmap Dec 23, 2025
@github-project-automation github-project-automation Bot moved this from Triage to Done in Roo Code Roadmap Dec 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants