feat(anthropic): support Claude Opus 4.7 by omitting deprecated temperature#3
Open
Khurdhula-Harshavardhan wants to merge 1 commit intomainfrom
Open
feat(anthropic): support Claude Opus 4.7 by omitting deprecated temperature#3Khurdhula-Harshavardhan wants to merge 1 commit intomainfrom
Khurdhula-Harshavardhan wants to merge 1 commit intomainfrom
Conversation
…rature Opus 4.7 returns a 400 when temperature/top_p/top_k are set; the safest migration per Anthropic's docs is to omit them entirely. Guard on the model id so existing 4.6 / Sonnet 4.6 runs continue to send temperature=0.0 unchanged. Ref: https://platform.claude.com/docs/en/about-claude/models/whats-new-claude-4-7 Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
temperature,top_p, andtop_k— passing any of them now returns a 400. The current Anthropic provider unconditionally sendstemperature=config.temperature, so any run with--model-id claude-opus-4-7fails immediately.temperatureis still passed for every existing model (Opus 4.6, Sonnet 4.6, future Anthropic models without theopus-4-7substring), and is omitted only when the id containsopus-4-7.thinkingfield, which this provider does not.Ref: What's new in Claude Opus 4.7 — "Starting with Claude Opus 4.7, setting
temperature,top_p, ortop_kto any non-default value will return a 400 error. The safest migration path is to omit these parameters entirely."Methodology note
Anthropic's docs also state: "If you were using
temperature = 0for determinism, note that it never guaranteed identical outputs." The within-Anthropic comparison stays roughly apples-to-apples; a one-line README footnote on Opus 4.7's row is recommended when results land.Test plan
claude-opus-4-7confirms the model returns valid JSON without sampling params.temperatureis still in kwargs forclaude-opus-4-6andclaude-sonnet-4-6, and absent forclaude-opus-4-7.python -m sob.run --provider anthropic --modality text --model-id claude-opus-4-7 --sample-size 5"claude-opus-4-7": "Claude-Opus-4.7"todata/evaluation/display_names.jsonafter eval summaries land (separate PR or follow-up commit).🤖 Generated with Claude Code