[OPIK-7438] [BE] fix: gate sampling params for Anthropic adaptive-thinking models on the playground/inference path#7575
Draft
JetoPistola wants to merge 2 commits into
Conversation
…nking models on the playground/inference path LlmProviderAnthropicMapper.toCreateMessageRequest forwarded temperature/top_p unconditionally, so adaptive-thinking models (claude-sonnet-5, claude-opus-4-7/4-8) 400 with "temperature is deprecated for this model" on API-created playground/inference/proxy requests that bypass the FE sanitizer (OPIK-6244). Gate temperature and top_p by AnthropicModelName.supportsSamplingParams(model) and whenever extended thinking is enabled per-request via custom_parameters, mirroring the judge-path logic in AnthropicClientGenerator (OPIK-7526 / PR #7531). top_k is not sent on this path (ChatCompletionRequest has no top_k), so nothing to gate there. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
⏱️ pre-commit per-hook timing
⏭️ 40 skipped (no matching files changed)
|
Contributor
Backend Tests - Integration Group 13 49 files 49 suites 4m 24s ⏱️ Results for commit d49a79b. ♻️ This comment has been updated with latest results. |
…cedence in sampling gate Addresses review on #7575: add claude-opus-4-7 to the adaptive-model gating parameterization (all three adaptive models now asserted to drop temperature/top_p), and add a case setting both temperature and top_p on a sampling-capable model to guard the precedence branch (temperature kept, top_p null). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Backend Tests - Integration Group 1426 tests 426 ✅ 10m 51s ⏱️ Results for commit d49a79b. ♻️ This comment has been updated with latest results. |
2 tasks
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.
Details
Follow-up to PR #7531 (online-rules judge path). That PR gated
temperatureserver-side for Anthropic adaptive-thinking models (claude-sonnet-5,claude-opus-4-7/4-8) on the judge path, but deliberately left the sibling playground / online-inference / proxy path out of scope.LlmProviderAnthropicMapper.toCreateMessageRequeststill forwardedtemperature/top_punconditionally, so those models400withtemperature is deprecated for this modelfor API-created requests — which bypass the FE sanitizer added in OPIK-6244.Changes (backend-only,
infrastructure/llm/antropic):temperature/top_pMapStruct mappings to@Namedresolvers that gate onAnthropicModelName.supportsSamplingParams(request.model())and whenever extended thinking is enabled per-request viacustom_parameters.thinking.type(any non-blank type other thandisabled), mirroring the judge-path logic inAnthropicClientGenerator.top_pis now also dropped when gated (previously it could leak oncetemperaturewas suppressed).top_kis not sent on this path (ChatCompletionRequesthas notop_k), so there is nothing to gate — no dead code added.Change checklist
Issues
Testing
SamplingParamsGatingcases inAnthropicMappersTest(11): adaptive models drop temperature+top_p; sampling-capable models forward them; thinking-enabled (enabled/adaptive/future) drops them;disabled/blank/absent thinking forwards them.AnthropicMappersTest(7) unaffected — Podam random models default to sampling-supported.mvn clean test-compileclean on Corretto 25;AnthropicMappersTest(18) +AnthropicClientGeneratorTest(32) all green;spotless:applyclean.Documentation
No user-facing docs change required.