litellm - 💡(How to fix) Fix [Bug]: Bedrock API error when use model claude 4.6, drop_param not help [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#27184Fetched 2026-05-06 06:15:39
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

When asking a question through OpenKB chat using AWS Bedrock with the model global.anthropic.claude-sonnet-4-6, the system returns an error related to a missing tool_choice.type field.

Error Message

[ERROR] litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: tool_choice.type: Field required"}

Root Cause

When asking a question through OpenKB chat using AWS Bedrock with the model global.anthropic.claude-sonnet-4-6, the system returns an error related to a missing tool_choice.type field.

Fix Action

Fix / Workaround

Any guidance on a workaround or fix would be greatly appreciated. Thank you!

Code Example

[ERROR] litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: tool_choice.type: Field required"}

---
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Bug Report: tool_choice.type: Field required when using Claude via AWS Bedrock

Description

When asking a question through OpenKB chat using AWS Bedrock with the model global.anthropic.claude-sonnet-4-6, the system returns an error related to a missing tool_choice.type field.

Error Message

[ERROR] litellm.BadRequestError: BedrockException - {"message":"The model returned the following errors: tool_choice.type: Field required"}

Steps to Reproduce

  1. Configure OpenKB to use AWS Bedrock with model global.anthropic.claude-sonnet-4-6
  2. Open the chat interface
  3. Ask any question
  4. Error appears immediately

What I've Tried

  • Setting drop_params: true in the LiteLLM configuration — error still occurs

Expected Behavior

The chat should respond normally without errors.

Environment

  • Model: global.anthropic.claude-sonnet-4-6 (via AWS Bedrock)
  • LLM proxy: LiteLLM
  • Interface: OpenKB chat

Additional Context

This may be related to how tool_choice is passed to the Bedrock API. The Bedrock API appears to require tool_choice.type to be explicitly set, but it seems OpenKB or LiteLLM is sending an incomplete tool_choice object (or one without the type field) when no tools are needed.

Any guidance on a workaround or fix would be greatly appreciated. Thank you!

Steps to Reproduce

Relevant log output

What part of LiteLLM is this about?

SDK (litellm Python package)

What LiteLLM version are you on ?

v. 1.83.14

Twitter / LinkedIn details

No response

extent analysis

TL;DR

The issue can likely be resolved by ensuring that the tool_choice.type field is explicitly set when calling the Bedrock API, possibly through modifications in the LiteLLM configuration or the OpenKB chat interface.

Guidance

  • Verify the LiteLLM configuration to see if there's an option to explicitly set the tool_choice.type field, potentially as part of the model invocation parameters.
  • Check the OpenKB chat interface documentation to determine if there are any settings or configurations that could influence how tool_choice is passed to the Bedrock API.
  • Consider modifying the LiteLLM configuration to include a default tool_choice.type value when no specific tools are required, to comply with the Bedrock API's requirements.
  • Review the Bedrock API documentation to understand the expected format and values for the tool_choice object, including the type field.

Example

No specific code example can be provided without more details on the LiteLLM and OpenKB configurations, but the solution likely involves adding or modifying a configuration option similar to tool_choice: { type: 'default' } in the LiteLLM setup.

Notes

The exact solution depends on the specifics of the LiteLLM and OpenKB configurations, as well as the Bedrock API requirements. It's also possible that an update to LiteLLM or OpenKB could address this issue if it's a known problem.

Recommendation

Apply a workaround by explicitly setting the tool_choice.type field in the LiteLLM configuration or OpenKB chat interface settings, as this directly addresses the error message and the known requirement of the Bedrock API.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING