fix: exclude parallel_tool_calls for Bedrock models in LiteLLM - #10235
fix: exclude parallel_tool_calls for Bedrock models in LiteLLM#10235ghost wants to merge 3 commits into
Conversation
Review complete. Found 1 minor issue related to naming conventions.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Review complete. No issues found. The implementation correctly:
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 { |
There was a problem hiding this comment.
Fixaroo
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.
mrubens
left a comment
There was a problem hiding this comment.
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 |
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. |
- 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", |
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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.
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-specificparallel_tool_callsparameter.Solution
isBedrockModel()method to detect Bedrock models by checking for patterns like:parallel_tool_callswhen routing to Bedrock modelsTesting
parallel_tool_callsparallel_tool_callsparallelToolCallsis not specifiedView task on Roo Code Cloud
Important
Fixes LiteLLM to exclude unsupported
parallel_tool_callsfor AWS Bedrock models by detecting model patterns and updating request handling.isBedrockModel()inlite-llm.tsto detect Bedrock models by checking model ID patterns.createMessage()inlite-llm.tsto excludeparallel_tool_callsfor Bedrock models.lite-llm.spec.tsto verify exclusion ofparallel_tool_callsfor Bedrock models and inclusion for non-Bedrock models.litellmUseAzureBedrockcheckbox inLiteLLM.tsxfor user configuration.settings.jsonwith new UI text for Bedrock configuration.This description was created by
for 5d474ee. You can customize this summary. It will automatically update as commits are pushed.