Repository navigation
Drop temperature when LiteLLM rejects it for newer Anthropic models - #80
Merged
Merged
Conversation
LiteLLM 1.96 rejects temperature=0 client-side for claude-opus-5-5,
claude-sonnet-5-5 and claude-fable-5-1 with an UnsupportedParamsError
("does not support temperature=0"). The existing fallback only matched
Anthropic's "`temperature` is deprecated" message, so every Anthropic
test failed with a BadRequestError. Match both messages, and remember
the fallback per model so later calls skip the doomed first request.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
LiteLLM words the same client-side rejection as "don't support temperature=" for gpt-5 and o-series models. Match both wordings, document what temperature_fallback now means, and tidy the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
Runs against the newest Anthropic models (
claude-opus-5-5,claude-sonnet-5-5,claude-fable-5-1) fail on every test. The same happens with gpt-5 and o-series models, which LiteLLM rejects with slightly different wording ("don't support temperature="). LiteLLM 1.96 rejectstemperature=0for these models before the request goes out, with anUnsupportedParamsError: "does not support temperature=0. Only temperature=1 is supported."wp-bench already drops
temperatureand retries when Anthropic answers "temperatureis deprecated". This error has different text, so the fallback never ran and the error was re-raised. The console fills with LiteLLM's "Give Feedback / Get Help" banner, one per failed test.Fix
temperatureinstead of failing first every time. Records still carrytemperature_fallback: true.Out of scope
top_p: LiteLLM rejects it on the same models when set, but the default is unset, so default configs are not affected.temperature_fallbackflag is the signal; the frozen-benchmark work in feat: define one public benchmark release contract #78 already excludes those records.How to test
pytest python -q: two new tests intest_models.py. One uses the real LiteLLM exception and checks that only the first call sendstemperature. The other checks that an unrelated bad request is still raised.UnsupportedParamsError. After it, it runs, and the banner appears once at most.Workaround until this lands: set
temperature: 1on those models in the config.🤖 Generated with Claude Code