Repository navigation
Conversation
…outputs The cost map marks every Bedrock Claude 5 entry (opus-5, sonnet-5, haiku-5-5, opus-5-5, sonnet-5-5 and all regional variants) with supports_native_structured_output: false, so response_format json_schema without thinking falls back to the forced json tool path. For these models that path is broken: Opus/Sonnet 5.5 reject forced tool_choice outright (400, or empty content_filter replies on current releases), and Opus 5 / Sonnet 5 return invalid or stringified payloads. The issue's direct boto3 measurements show the native outputConfig.textFormat path returning valid JSON 30/30 across all five models. Flip supports_native_structured_output to true for the 50 Bedrock Claude 5 entries, and update the opt-in routing tests whose premise (5-family native output is opt-in only) the flag change intentionally reverses; the opt-in slots now use Claude 4.8 entries that remain opt-in. Fixes BerriAI#47687
kaust1495
requested review from
klu-berri,
mateo-berri and
ryan-crabbe-berri
as code owners
October 21, 2026 07:30
Contributor
Merging this PR will not alter performance1 warning
Comparing |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
2 of 3 tasks
… structured-output regression test Fixes the TQ005 test-quality gate failure on the PR: the regression test mutated the litellm.model_cost process-wide global with manual save/restore; monkeypatch.setattr restores it at teardown instead.
This was referenced Oct 24, 2026
6 of 7 tasks
Contributor
|
Heads up, #49696 drops the |
5 of 7 tasks
Contributor
|
Closing as superseded by #49703, which sends native output only on Opus 5.5, Sonnet 5.5 and Fable 5.1, keeping Opus 5 on the json tool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #47687
Summary
Every Bedrock Claude 5 cost-map entry (opus-5, sonnet-5, haiku-5-5, opus-5-5, sonnet-5-5 and regional variants) has
supports_native_structured_output: false, soresponse_formatjson_schema without thinking uses the forced json tool path - which these models reject (Opus/Sonnet 5.5: 400 on forced tool_choice / empty content_filter replies; Opus 5, Sonnet 5: invalid or stringified payloads). Per the issue's direct boto3 measurements the nativeoutputConfig.textFormatpath returns valid JSON 30/30 across all five models. This flips the flag to true for the 50 Bedrock Claude 5 entries.Tests
outputConfig(no tools) for all five Claude 5 families; fails before, passes after.pytest tests/unit/llms/bedrock/- zero net regressions vs clean main (3052 vs 3051 passed; identical 17 pre-existing env failures + 111 collection errors).Behavioral evidence for AWS-side acceptance is the issue reporter's boto3 matrix (cited in #47687); the routing change itself is fully covered by unit tests.
AI-assisted disclosure: this PR was prepared with AI assistance (implementation and tests), reviewed and tested locally by the contributor.