Commit d8c24e8
fix(bedrock): pre-clamp reasoning_effort for chat invoke; correct test caps
- Add _clamp_adaptive_reasoning_effort_for_bedrock to AmazonAnthropicClaudeConfig
so raw reasoning_effort=xhigh degrades to the model's bedrock effort ceiling
before AnthropicConfig.map_openai_params converts it to output_config.
Mirrors converse path (_handle_reasoning_effort_parameter) and messages path
(_clamp_adaptive_reasoning_effort_for_bedrock) so the three Bedrock paths
are consistent.
- grid_spec: restore caps=_CAPS_4_6 for Bedrock converse/invoke Opus 4.6 entries
so the test reflects the model's actual JSON capabilities. Teach expected()
to bypass the xhigh/max cap check when bedrock_effort_ceiling will clamp
the wire effort, so the test still passes for Bedrock's graceful degradation
contract without lying about native model caps.
Co-authored-by: Yassin Kortam <[email protected]>1 parent 1333799 commit d8c24e8
2 files changed
Lines changed: 49 additions & 3 deletions
File tree
- litellm/llms/bedrock/chat/invoke_transformations
- tests/llm_translation/reasoning_effort_grid
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
81 | 92 | | |
82 | 93 | | |
83 | 94 | | |
| |||
91 | 102 | | |
92 | 103 | | |
93 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
94 | 126 | | |
95 | 127 | | |
96 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
74 | 88 | | |
75 | 89 | | |
76 | 90 | | |
| |||
82 | 96 | | |
83 | 97 | | |
84 | 98 | | |
85 | | - | |
| 99 | + | |
86 | 100 | | |
87 | 101 | | |
88 | 102 | | |
| |||
233 | 247 | | |
234 | 248 | | |
235 | 249 | | |
236 | | - | |
| 250 | + | |
237 | 251 | | |
238 | 252 | | |
239 | 253 | | |
| |||
262 | 276 | | |
263 | 277 | | |
264 | 278 | | |
265 | | - | |
| 279 | + | |
266 | 280 | | |
267 | 281 | | |
268 | 282 | | |
| |||
0 commit comments