Skip to content

fix(bedrock): drop temperature and top_p for OpenAI GPT-6 models on Converse - #42726

Closed
kimnamu wants to merge 5 commits into
BerriAI:mainfrom
kimnamu:bedrock_gpt_6_converse_tools_sampling
Closed

kimnamu wants to merge 5 commits into
BerriAI:mainfrom
kimnamu:bedrock_gpt_6_converse_tools_sampling

Conversation

@kimnamu

@kimnamu kimnamu commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for #39834, which gave the Bedrock GPT-5.6 Converse rows supports_sampling_params: false. This PR puts the same flag on the GPT-6 rows

TLDR

Problem this solves:

  • GPT-6 on Converse gets 400 for temperature
  • Same for top_p, even with drop_params

How it solves it:

  • supports_sampling_params: false on every GPT-6 Converse row
  • Same flag as GPT-5.6, transformation code untouched
Before (8bbe7edb71) After (4d06477381)
GPT-6 Sol, Luna, Astra and global. Sol, temperature: 0.2 or top_p: 0.9 on chat completions, drop_params on 400 from Bedrock 200, dropped
Same with temperature: 0.2 on messages, and on responses through bedrock/converse/ 400 from Bedrock 200, dropped
GPT-6 temperature: 0.2 or top_p: 0.9 without drop_params (SDK) 400 from Bedrock UnsupportedParamsError from litellm before sending, same as GPT-5.6
GPT-6 tools on chat completions get_weather call unchanged
Responses on the default route bedrock/us.openai.gpt-6-sol 200 unchanged
GPT-5.6 Sol, every row above works unchanged
converse_transformation.py, price fields unchanged
Details

#42746 and #42798 added the GPT-6 Sol and Luna rows after this PR was opened, so tools already work on main. This version drops the name check and flags all eight GPT-6 Converse rows in both cost map files

Bare openai.gpt-6-astra has no row, but Bedrock rejects it as on-demand, and the sampling lookup finds the us. and global. flags anyway

# flags removed from both cost map files, tests kept
$ pytest -p no:xdist -q tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py -k like_gpt_5_6
E         Left contains 2 more items:
E         {'temperature': 0.2, 'topP': 0.9}
8 failed, 16 passed, 346 deselected
# at 4d06477381
24 passed, 346 deselected
Check main (8bbe7edb71) This PR (4d06477381)
tests/test_litellm/llms/bedrock 1445 passed 1469 passed
tests/unit/llms/bedrock 545 passed 545 passed
tests/test_litellm/llms/anthropic/chat 503 passed 503 passed
cost map JSON validity and cost map guard tests 25 passed 25 passed
ci_cd/cost_map_guard.py, generate_model_prices_schema.py --check passed, schema in sync
ruff strict, type discipline, test quality gates OK

User Flow

Before: an app that sets a temperature gets a 400 from GPT-6

  1. The proxy serves bedrock/converse/us.openai.gpt-6-sol with drop_params: true
  2. The app sends POST http://localhost:4000/v1/chat/completions with "temperature": 0.2 (same on /v1/messages)
  3. 400, "This model doesn't support the temperature field"

After: the temperature is dropped and the call succeeds

  1. The proxy serves bedrock/converse/us.openai.gpt-6-sol with drop_params: true
  2. The app sends the same POST
  3. 200, "pong"

Relevant issues

Fixes #42725

Pre-Submission checklist

  • Meaningful tests added
  • Covering test files pass locally
  • Required CI checks pass
  • Scope is one problem
  • Greptile Confidence Score of at least 4/5

Screenshots / Proof of Fix

Live Bedrock calls through a local proxy
# LITELLM_LOCAL_MODEL_COST_MAP=True python litellm/proxy/proxy_cli.py --config config.yaml --port 4000
model_list:
  - model_name: gpt-6-sol
    litellm_params: {model: bedrock/converse/us.openai.gpt-6-sol, aws_region_name: us-east-1}
  - model_name: gpt-6-luna
    litellm_params: {model: bedrock/converse/us.openai.gpt-6-luna, aws_region_name: us-east-1}
  - model_name: gpt-6-astra
    litellm_params: {model: bedrock/converse/us.openai.gpt-6-astra, aws_region_name: us-east-1}
  - model_name: gpt-6-sol-global
    litellm_params: {model: bedrock/converse/global.openai.gpt-6-sol, aws_region_name: us-east-1}
  - model_name: gpt-6-sol-default-route
    litellm_params: {model: bedrock/us.openai.gpt-6-sol, aws_region_name: us-east-1}
  - model_name: gpt-5.6-sol
    litellm_params: {model: bedrock/converse/us.openai.gpt-5.6-sol, aws_region_name: us-east-1}
litellm_settings:
  drop_params: true
general_settings:
  master_key: os.environ/LITELLM_MASTER_KEY
H=(-H "Authorization: Bearer $LITELLM_MASTER_KEY" -H "Content-Type: application/json")
U=http://localhost:4000
O=/tmp/lt42726-out.json
W='[{"type":"function","function":{"name":"get_weather","description":"Current weather for a city","parameters":{"type":"object","properties":{"city":{"type":"string"}},"required":["city"]}}}]'
chat() { curl -s -o $O -w '%{http_code} ' $U/v1/chat/completions "${H[@]}" -d "{\"model\":\"$1\",$2,\"messages\":[{\"role\":\"user\",\"content\":\"Say pong.\"}]}"; jq -c '.choices[0].message.content // (.error.message | .[0:120])' $O; }
temp() { chat "$1" '"temperature":0.2'; }
top_p() { chat "$1" '"top_p":0.9'; }
resp_temp() { curl -s -o $O -w '%{http_code} ' $U/v1/responses "${H[@]}" -d "{\"model\":\"$1\",\"temperature\":0.2,\"input\":\"Say pong.\"}"; jq -c '([.output[]? | select(.type=="message") | .content[0].text] | first) // (.error.message | .[0:120])' $O; }
msgs_temp() { curl -s -o $O -w '%{http_code} ' $U/v1/messages "${H[@]}" -d "{\"model\":\"$1\",\"max_tokens\":256,\"temperature\":0.2,\"messages\":[{\"role\":\"user\",\"content\":\"Say pong.\"}]}"; jq -c '([.content[]? | select(.type=="text") | .text] | first) // (.error.message | .[0:120])' $O; }
tools() { curl -s -o $O -w '%{http_code} ' $U/v1/chat/completions "${H[@]}" -d "{\"model\":\"$1\",\"messages\":[{\"role\":\"user\",\"content\":\"What is the weather in Paris right now?\"}],\"tools\":$W}"; jq -c '(.choices[0].message.tool_calls[0]?.function | select(.) | "\(.name) \(.arguments)") // .choices[0].message.content // (.error.message | .[0:120])' $O; }

Before (8bbe7ed)

Chat completions, temperature

  1. Run
$ temp gpt-6-sol
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ temp gpt-6-luna
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ temp gpt-6-astra
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ temp gpt-6-sol-global
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ temp gpt-6-sol-default-route
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ temp gpt-5.6-sol
200 "pong"

Chat completions, top_p

  1. Run
$ top_p gpt-6-sol
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the topP field. Remove topP and try a"
$ top_p gpt-6-luna
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the topP field. Remove topP and try a"
$ top_p gpt-6-astra
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the topP field. Remove topP and try a"
$ top_p gpt-6-sol-global
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the topP field. Remove topP and try a"
$ top_p gpt-6-sol-default-route
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the topP field. Remove topP and try a"
$ top_p gpt-5.6-sol
200 "pong"

Responses, temperature

  1. Run
$ resp_temp gpt-6-sol
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ resp_temp gpt-6-luna
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ resp_temp gpt-6-astra
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ resp_temp gpt-6-sol-global
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ resp_temp gpt-6-sol-default-route
200 "pong"
$ resp_temp gpt-5.6-sol
200 "pong"

Messages, temperature

  1. Run
$ msgs_temp gpt-6-sol
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ msgs_temp gpt-6-luna
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ msgs_temp gpt-6-astra
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ msgs_temp gpt-6-sol-global
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ msgs_temp gpt-6-sol-default-route
400 "litellm.BadRequestError: BedrockException - {\"message\":\"This model doesn't support the temperature field. Remove tempera"
$ msgs_temp gpt-5.6-sol
200 "pong"

Chat completions, tools

  1. Run
$ tools gpt-6-sol
200 "get_weather {\"city\": \"Paris\"}"
$ tools gpt-6-luna
200 "get_weather {\"city\": \"Paris\"}"
$ tools gpt-6-astra
200 "get_weather {\"city\": \"Paris\"}"
$ tools gpt-6-sol-global
200 "get_weather {\"city\": \"Paris\"}"
$ tools gpt-6-sol-default-route
200 "get_weather {\"city\": \"Paris\"}"
$ tools gpt-5.6-sol
200 "get_weather {\"city\": \"Paris\"}"

After (4d06477)

Chat completions, temperature

  1. Run
$ temp gpt-6-sol
200 "pong"
$ temp gpt-6-luna
200 "pong"
$ temp gpt-6-astra
200 "pong"
$ temp gpt-6-sol-global
200 "pong"
$ temp gpt-6-sol-default-route
200 "pong"
$ temp gpt-5.6-sol
200 "pong"

Chat completions, top_p

  1. Run
$ top_p gpt-6-sol
200 "pong"
$ top_p gpt-6-luna
200 "pong"
$ top_p gpt-6-astra
200 "pong"
$ top_p gpt-6-sol-global
200 "pong"
$ top_p gpt-6-sol-default-route
200 "pong"
$ top_p gpt-5.6-sol
200 "pong"

Responses, temperature

  1. Run
$ resp_temp gpt-6-sol
200 "pong"
$ resp_temp gpt-6-luna
200 "pong"
$ resp_temp gpt-6-astra
200 "pong"
$ resp_temp gpt-6-sol-global
200 "pong"
$ resp_temp gpt-6-sol-default-route
200 "pong"
$ resp_temp gpt-5.6-sol
200 "pong"

Messages, temperature

  1. Run
$ msgs_temp gpt-6-sol
200 "pong"
$ msgs_temp gpt-6-luna
200 "pong"
$ msgs_temp gpt-6-astra
200 "pong"
$ msgs_temp gpt-6-sol-global
200 "pong"
$ msgs_temp gpt-6-sol-default-route
200 "pong"
$ msgs_temp gpt-5.6-sol
200 "pong"

Chat completions, tools

  1. Run
$ tools gpt-6-sol
200 "get_weather {\"city\": \"Paris\"}"
$ tools gpt-6-luna
200 "get_weather {\"city\": \"Paris\"}"
$ tools gpt-6-astra
200 "get_weather {\"city\": \"Paris\"}"
$ tools gpt-6-sol-global
200 "get_weather {\"city\": \"Paris\"}"
$ tools gpt-6-sol-default-route
200 "get_weather {\"city\": \"Paris\"}"
$ tools gpt-5.6-sol
200 "get_weather {\"city\": \"Paris\"}"

Type

🐛 Bug Fix

Caveats (if any)

Low

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

…ls on Converse

The Converse tool, tool_choice and sampling gates only read the cost map for
OpenAI GPT models. Models with no entry yet (GPT-6 Sol and Luna) lose tools and
the forced json_tool_call, and an entry without supports_sampling_params (GPT-6
Astra) sends temperature and topP, which Bedrock rejects with a 400 even when
drop_params is on. Add the existing _is_openai_gpt_reasoning_model check to
these gates so these models get the same params as GPT-5.6. An explicit
supports_sampling_params flag still wins, and gpt-oss keeps temperature
@kimnamu
kimnamu requested a review from a team September 23, 2026 10:43
@greptile-apps

greptile-apps Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The behavior appears correct for known models, but the metadata-driven capability requirement must be satisfied before merging

Findings

  1. P2 Hardcoded model capability flags ▶

Summary

Updates Bedrock Converse parameter handling so OpenAI GPT reasoning models receive tools and forced structured-output tool choices while unsupported sampling parameters are dropped or rejected

  • Preserves explicit sampling capability metadata as an override
  • Adds regression coverage for unmapped regional models, mapped GPT-6 Astra, structured output, tools, and sampling
  • Uses hardcoded model-family capability checks where repository rules require metadata-driven flags

Reviews (1) · Last reviewed commit: "fix(bedrock): accept tools and drop temp..."

@codspeed

codspeed Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing kimnamu:bedrock_gpt_6_converse_tools_sampling (9475bcb) with main (aa601ce)

Open in CodSpeed

@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

… repo rule and BerriAI#39834 do

The GPT-6 Sol, Luna and Astra Converse rows now set supports_sampling_params false in both cost map files, like the GPT-5.6 rows. Tools and tool choice already come from the rows BerriAI#42746 and BerriAI#42798 added, so the name-based checks in converse_transformation.py are removed
@kimnamu kimnamu changed the title fix(bedrock): accept tools and drop temperature for OpenAI GPT-6 models on Converse fix(bedrock): drop temperature and top_p for OpenAI GPT-6 models on Converse Sep 24, 2026
@kimnamu

kimnamu commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks to the maintainers for the cost map rule and for #39834, which did this for GPT-5.6. 4d06477 now does the same for GPT-6

litellm.completion, bedrock/converse/, us-east-1 main 8bbe7edb71 old tip a9ac03f92e new tip 4d06477381
GPT-6 Sol, Luna, Astra, global. Sol, temperature and top_p with drop_params 400 from Bedrock 200, dropped 200, dropped
Same without drop_params 400 from Bedrock UnsupportedParamsError UnsupportedParamsError, like GPT-5.6
GPT-6 tools get_weather call unchanged unchanged
Decided by no flag, sent as is model name check supports_sampling_params: false on the 8 GPT-6 Converse rows
Price fields, including the Sol and Luna rows in #42728 unchanged

The name check is gone because the rows from #42746 and #42798 already carry tools. #42728 has the same Sol and Luna rows, so whichever lands second may need a trivial rebase there

# flags removed from both cost map files, tests kept
$ pytest -p no:xdist -q tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py -k like_gpt_5_6
E         Left contains 2 more items:
E         {'temperature': 0.2, 'topP': 0.9}
8 failed, 16 passed, 346 deselected
# at 4d06477381
24 passed, 346 deselected
Suites, gates and the live run
# main 8bbe7edb71 vs 4d06477381, bearer token unset
tests/test_litellm/llms/bedrock: 1445 passed, 1 skipped -> 1469 passed, 1 skipped
tests/unit/llms/bedrock: 545 passed -> 545 passed
tests/test_litellm/llms/anthropic/chat: 503 passed -> 503 passed
test_aaamodel_prices_and_context_window_json_is_valid, test_cost_map_guard.py: 25 passed -> 25 passed
$ python ci_cd/cost_map_guard.py --base 8bbe7edb71 --head 4d06477381 --head-ref bedrock_gpt_6_converse_tools_sampling
cost map guard passed (human PR, file checks only)
$ python ci_cd/generate_model_prices_schema.py --check
model_prices_and_context_window.schema.json is in sync and model_prices_and_context_window.json validates against it
$ python scripts/ruff_strict_gate.py --base origin/main    # type_discipline_gate and test_quality_gate also OK
OK: every strict rule is within its codebase ceiling (base origin/main)
# litellm.completion(model="bedrock/converse/<id>", aws_region_name="us-east-1") at 4d06477381
## temperature 0.2 + top_p 0.9, drop_params
us.openai.gpt-6-sol        200 'pong'
us.openai.gpt-6-luna       200 'pong'
us.openai.gpt-6-astra      200 'pong'
global.openai.gpt-6-sol    200 'pong'
us.openai.gpt-5.6-sol      200 'pong'
## temperature 0.2, no drop_params
us.openai.gpt-6-sol        UnsupportedParamsError: litellm.UnsupportedParamsError: bedrock does not support parameters: ['temperature'], for model=converse/us.openai.gpt-6-sol. To drop these, set `litellm.drop_params=True
us.openai.gpt-5.6-sol      UnsupportedParamsError: litellm.UnsupportedParamsError: bedrock does not support parameters: ['temperature'], for model=converse/us.openai.gpt-5.6-sol. To drop these, set `litellm.drop_params=Tr

The PR description is updated with a fresh proxy run at 4d06477 (chat completions, responses, messages, tools)

@mateo-berri

Copy link
Copy Markdown
Contributor

#44307 landed supports_sampling_params false on every GPT-6 row on main, so this change is already in. Closing this one, thanks for the PR

@mateo-berri mateo-berri closed this Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Bedrock GPT-6 Sol/Luna tools are dropped on Converse, and temperature returns 400 even with drop_params

2 participants