Repository navigation
fix(bedrock): drop temperature for Grok 4.6/4.7 and Kimi K3 on converse - #49367
Open
IsmaelMartinez wants to merge 1 commit into
Open
IsmaelMartinez wants to merge 1 commit into
IsmaelMartinez wants to merge 1 commit into
Conversation
Bedrock answers any temperature on these models with "This model doesn't support the temperature field", so mark their converse entries supports_sampling_params: false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IsmaelMartinez
requested review from
joshua-berri,
kerry-berri,
mateo-berri and
ryan-crabbe-berri
as code owners
October 31, 2026 01:11
This was referenced Oct 31, 2026
|
Verified this independently against the mechanism in #49366 (litellm main @ c4b01b2 vs this PR head 4856b82, pure-Python path):
(Written with AI assistance; the verification steps above were run as described.) |
3 tasks done
Author
|
Thanks @anishpentyala for verifying this independently. One detail on the Moonshot docs you linked: through Bedrock Converse, Kimi K3 and both Grok models reject even |
This was referenced Nov 4, 2026
This was referenced Nov 16, 2026
This branch has not been deployed
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.
Bedrock rejects any temperature on Grok 4.6, Grok 4.7 and Kimi K3 through Converse, but LiteLLM still sends it, even with drop_params. This marks their Converse cost-map entries as not supporting sampling params, so LiteLLM drops temperature and top_p the way it already does for Claude Fable 5 and GPT 5.6.
Details
TLDR
Problem this solves:
drop_params=TrueHow it solves it:
supports_sampling_params: falseon their nine Converse entriesUser Flow
Before: a developer calling Kimi K3 on Bedrock with a temperature gets a 400
litellm.completion(model="bedrock/global.moonshotai.kimi-k3", temperature=0.2, drop_params=True)This model doesn't support the temperature fieldAfter: the same call succeeds
litellm.completion(model="bedrock/global.moonshotai.kimi-k3", temperature=0.2, drop_params=True)drop_paramsthey get LiteLLM'sUnsupportedParamsErrorinstead of Bedrock's 400Relevant issues
Fixes #49366
Seen downstream in The-PR-Agent/pr-agent#4530.
Screenshots / Proof of Fix
Live calls with
temperature=0.2, max_tokens=16,LITELLM_LOCAL_MODEL_COST_MAP=True.Before (a9b1814)
bedrock/global.moonshotai.kimi-k3,drop_params=True:BadRequestError: BedrockException - {"message":"This model doesn't support the temperature field. Remove temperature and try again."}bedrock/converse/us.xai.grok-4.6andbedrock/converse/global.xai.grok-4.7,drop_params=True: same errorbedrock/global.zai.glm-5.3: OKconverseon all three models:top_p=0.9,temperature=1andtemperature=0are rejected too ("doesn't support the topP field" / "the temperature field"); GLM-5.3 accepts all threeAfter (4856b82)
bedrock/global.moonshotai.kimi-k3,drop_params=True: OK; withdrop_params=False:UnsupportedParamsError: bedrock does not support parameters: ['temperature']bedrock/global.zai.glm-5.3: OKtest_converse_drops_temperature_for_grok_and_kimi: 9 passed; with the map restored to main, 9 failedType
🐛 Bug Fix
✅ Test
Caveats (if any)
Low
in.andus-gov.entries flagged by analogy, not called livebedrock_mantle/entries left unchanged, that route was not testedFinal Attestation
🤖 Generated with Claude Code