Skip to content

fix(llm, anthropic): Drop sampling parameters models reject - #1214

Merged
JeanMertz merged 1 commit into
mainfrom
drop-sampling
Oct 1, 2026
Merged

JeanMertz merged 1 commit into
mainfrom
drop-sampling

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

Every Claude model from 4.7 onwards answers a non-default temperature, top_p or top_k with a 400, so a configured value made every request to Opus 4.7, Opus 5.5, Sonnet 5.5 and their siblings fail. JP now sends these parameters only to models known to accept them (the 4.6 generation and older), and logs a warning for each configured value it drops.

The Models API does not report this, so it lives in JP's model override table as a sampling flag, surfaced as the sampling-parameters model feature. A model missing from the table gets no sampling parameters: a model this binary does not know is almost always newer than it, and every model since 4.7 rejects them. An older model reached through a custom base_url loses its temperature as a result, with a warning.

@JeanMertz
JeanMertz added this pull request to stack #1215 September 30, 2026 10:57
@JeanMertz
JeanMertz force-pushed the drop-sampling branch 2 times, most recently from 6b0ee22 to d3f72ed Compare September 30, 2026 13:43
Base automatically changed from new-models to main September 30, 2026 22:31
@JeanMertz
JeanMertz force-pushed the drop-sampling branch 2 times, most recently from 2ad843e to a807da4 Compare September 30, 2026 22:38
Every Claude model from 4.7 onwards answers a non-default
`temperature`, `top_p` or `top_k` with a 400, so a configured value made
every request to Opus 4.7, Opus 5.5, Sonnet 5.5 and their siblings fail.
JP now sends these parameters only to models known to accept them (the
4.6 generation and older), and logs a warning for each configured value
it drops.

The Models API does not report this, so it lives in JP's model override
table as a `sampling` flag, surfaced as the `sampling-parameters` model
feature. A model missing from the table gets no sampling parameters: a
model this binary does not know is almost always newer than it, and
every model since 4.7 rejects them. An older model reached through a
custom `base_url` loses its `temperature` as a result, with a warning.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz
JeanMertz merged commit ac3edd0 into main Oct 1, 2026
22 checks passed
@JeanMertz
JeanMertz deleted the drop-sampling branch October 1, 2026 10:33
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.

1 participant