litellm - ✅(Solved) Fix [Bug]: tools[].custom.eager_input_streaming: Extra inputs are not permitted — Bedrock rejects custom tool fields for Haiku 4.5 [1 pull requests, 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#23825Fetched 2026-04-08 00:49:00
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1referenced ×1

Error Message

API Error: 400 {"error":{"message":"{"message":"tools.0.custom.eager_input_streaming: Extra inputs are not permitted"}. Received Model Group=claude-haiku-4-5-20251001"}}

Root Cause

Claude Code sends requests via /v1/messages?beta=true. Tool definitions include a custom object:

{
  "name": "some_tool",
  "input_schema": {},
  "custom": { "eager_input_streaming": true }
}

Bedrock accepts this for Claude 4 models (Sonnet 4.6, Opus 4.6) but rejects it for Haiku 4.5 (us.anthropic.claude-haiku-4-5-20251001-v1:0).

Fix Action

Workaround

None available without patching LiteLLM or writing a custom pre-call hook.

PR fix notes

PR #23845: fix(bedrock): strip custom tool fields for Converse API to fix Haiku …

Description (problem / solution / changelog)

…4.5 rejection

Claude Code sends custom: {eager_input_streaming: true} on tool definitions. Bedrock Converse accepts this for Claude 4 models (Sonnet 4.6, Opus 4.6) but rejects it for Haiku 4.5 with 'Extra inputs are not permitted'.

  • Add strip_custom_from_tools_list() in common_utils for list-based stripping
  • Refactor remove_custom_field_from_tools to use the new helper
  • Call strip_custom_from_tools_list in _process_tools_and_beta before passing tools to _bedrock_tools_pt
  • Add unit tests for strip_custom_from_tools_list and _process_tools_and_beta

Relevant issues

Fixes #23825 Related: #16679

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

<!-- Select the type of Pull Request --> <!-- Keep only the necessary ones -->

🆕 New Feature 🐛 Bug Fix 🧹 Refactoring 📖 Documentation 🚄 Infrastructure ✅ Test

Changes

Changed files

  • litellm/llms/bedrock/chat/converse_transformation.py (modified, +9/-0)
  • litellm/llms/bedrock/common_utils.py (modified, +23/-1)
  • tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py (modified, +39/-0)
  • tests/test_litellm/llms/bedrock/test_bedrock_common_utils.py (modified, +78/-1)

Code Example

API Error: 400 {"error":{"message":"{\"message\":\"tools.0.custom.eager_input_streaming: Extra inputs are not permitted\"}. Received Model Group=claude-haiku-4-5-20251001"}}

---

{
  "name": "some_tool",
  "input_schema": {},
  "custom": { "eager_input_streaming": true }
}
RAW_BUFFERClick to expand / collapse

What happened?

Claude Code sends eager_input_streaming inside the custom field of tool definitions (a Claude API feature for streaming tool inputs). AWS Bedrock accepts this for Claude 4 models (Sonnet 4.6, Opus 4.6) but rejects it for Haiku 4.5:

API Error: 400 {"error":{"message":"{\"message\":\"tools.0.custom.eager_input_streaming: Extra inputs are not permitted\"}. Received Model Group=claude-haiku-4-5-20251001"}}

LiteLLM forwards the custom block from Anthropic API format to Bedrock Converse without stripping fields unsupported by older models.

Root cause

Claude Code sends requests via /v1/messages?beta=true. Tool definitions include a custom object:

{
  "name": "some_tool",
  "input_schema": {},
  "custom": { "eager_input_streaming": true }
}

Bedrock accepts this for Claude 4 models (Sonnet 4.6, Opus 4.6) but rejects it for Haiku 4.5 (us.anthropic.claude-haiku-4-5-20251001-v1:0).

Why drop_params: true does NOT fix this

drop_params only strips unsupported top-level OpenAI params. It does not traverse tool definition bodies to strip unknown nested fields like tools[].custom.*. Setting it globally or per-model has no effect.

Related issue

Same class of bug as #16679 (tools.3.custom.input_examples), closed but did not fix the general case of arbitrary custom.* fields being forwarded to Bedrock.

LiteLLM version

v1.82.3-stable

Model

us.anthropic.claude-haiku-4-5-20251001-v1:0 via bedrock_converse

Expected behavior

Strip the custom field (or unknown fields within it) from tool definitions when forwarding to Bedrock Converse.

Workaround

None available without patching LiteLLM or writing a custom pre-call hook.

Are you a ML Ops Team?

No

extent analysis

Fix Plan

To fix this issue, we need to strip the custom field or unknown fields within it from tool definitions when forwarding to Bedrock Converse. Here are the steps:

  • Modify the LiteLLM code to traverse the tool definition bodies and strip unknown nested fields like tools[].custom.*.
  • Add a check to remove the eager_input_streaming field from the custom object when the model is Haiku 4.5.

Example code snippet:

def strip_custom_fields(tool_definitions, model):
    if model == "us.anthropic.claude-haiku-4-5-20251001-v1:0":
        for tool in tool_definitions:
            if "custom" in tool:
                tool["custom"] = {k: v for k, v in tool["custom"].items() if k != "eager_input_streaming"}
                if not tool["custom"]:
                    del tool["custom"]
    return tool_definitions
  • Call this function before forwarding the tool definitions to Bedrock Converse.

Verification

To verify that the fix worked, test the API call with the Haiku 4.5 model and check that the eager_input_streaming field is no longer present in the custom object.

Extra Tips

  • Consider adding a more general solution to strip all unknown fields from the custom object, not just eager_input_streaming.
  • If possible, update the LiteLLM version to a newer one that may include this fix.
  • Add logging to track any removed fields to ensure that the fix is working as expected.

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…

FAQ

Expected behavior

Strip the custom field (or unknown fields within it) from tool definitions when forwarding to Bedrock Converse.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING