ADR 330 · Accepted
A Claude model record measures its sampling parameters
Context
Claude 4.7 and later models answer a non-default temperature, top_p or top_k with HTTP 400 on API version 2023-06-01, which the Claude adapter pins. Anthropic's model-deprecations page states this; its 2026-10-21 migration guide adds that the default temperature is 1.0 (both read on 2026-11-29, not measured against the API). Issue #1484 reported the 400 for claude-sonnet-5-5.
The fix for #1484 is a table in code, ClaudeSamplingSupport. It lists the families released before Claude 4.7 and refuses every other id. That is safe and blind in the same way the OpenAI table was before ADR-275:
A model released after the table gets no sampling parameters, even if it accepts them, until a release adds it.
A deployment name that a gateway made up, such as my-claude-sonnet-4-5, gets none, whatever model is behind it.
No public source settles it per endpoint:
Anthropic's GET /v1/models returns capabilities (batch, citations, image and PDF input, structured outputs, effort, thinking, context management, server tools) and token limits. It states nothing about sampling parameters.
OpenRouter's public GET /api/v1/models lists supported_parameters per model. On 2026-11-29 it named temperature for anthropic/claude-sonnet-4.6, claude-opus-4.6, claude-haiku-4.5 and claude-sonnet-4.5, and not for claude-opus-4.7, claude-opus-4.8 or any 5.x model. That agrees with Anthropic's text, but it describes OpenRouter's endpoint, and ADR-275 found the same list wrong for GPT-6 effort scales. It also cannot speak for a gateway deployment name.
On 2026-11-29 the product owner chose to measure: a test request when a model record is saved.
Decision
1. A save measures, once per model identity
For a model record whose provider uses the anthropic adapter type, a probe runs after the record is created and after a save that changes model_id or provider_uid. It runs on every DataHandler write of a model record (the record form among them) and in the setup wizard. The model module writes neither field: it toggles the active flag, sets the default and confirms capabilities. The demo-data seed command writes model rows directly, without DataHandler, and stays unprobed: its demo Claude provider carries no API key and is inactive, so a probe could not measure. The "Test model" action runs the probe too, so an operator can measure again without editing the record. It runs only once the action has sent its chat request, whether that succeeded or failed, and the answer names the probe's outcome after the chat result. When no chat request was sent (no provider, an adapter that could not be built, embeddings, decisions, capabilities served elsewhere) the action sends no probe either. Any other save sends nothing.
2. The probe sends one non-default value, past the gate it feeds
The probe sends one Messages request with the record's model id, a one-word user message, max_tokens: 1 and temperature: 0.5. It builds the request itself. Going through the adapter's chat path would not work, because that path strips temperature for every id the table does not list: the request would succeed and record "accepted" for a parameter it never sent. The probe sends exactly one attempt: the adapter's retries would multiply the timeout of section 6.
3. Only two answers are measurements
HTTP 200: the model accepts sampling parameters.
HTTP 400 whose error message names temperature: it does not.
Every other answer stores nothing and keeps an earlier measurement: an authentication error, a missing model, a rate limit, a server error, a 400 about another field, a timeout. A record that was never measured stays empty, and empty never means "no".
4. The measurement outranks the table for the record's own model id
The record stores the measurement (empty / yes / no), the API version the probe sent (anthropic-version) and the time. The version sent is the adapter's, unless the provider's customHeaders option replaces it. A measurement taken under another version than the record's requests carry now counts as no measurement. For a request to the record's own model id the order is:
the stored measurement;
ClaudeSamplingSupport;
and the table's answer for an id it does not list is "no". A request whose model option names a different id uses the table alone, as ADR-275 does for reasoning profiles. The adapter and the configuration form read the same resolver.
This is the reverse of ADR-275, where the bundled table outranks discovered data, and this record amends ADR-275 for the anthropic adapter type. That ranking holds against a third party's catalogue. A probe asks the record's own endpoint with the record's own credential and model id, which is the measurement the table rows were made from.
5. An identity change forgets the measurement
A probe stores its answer only while the record still names the model id and the provider it measured, and while that provider still has the endpoint URL and adapter type the probe used, so a probe that a later save of another identity or another endpoint overlapped stores nothing.
ModelIdentityChangeHook clears the three fields when model_id or provider_uid changes, as it clears the discovered reasoning profile, and the probe of section 1 measures the new identity.
A save of the provider record that changes its endpoint URL or its adapter type clears the three fields on every model of that provider. A "yes" measured on the old endpoint would otherwise outrank a table that says "no". Nothing is probed then; the table decides until the next probe of section 1.
6. A probe never fails a save
The probe has a timeout of 10 seconds. Its failure never refuses or rolls back the save. A DataHandler write queues the outcome as a flash message, which the record form shows; a command-line user has no session, so there the message is kept for the running process only. The wizard logs the outcome.
One request can save several models of one provider: the wizard does, and so does a copy or an import of many records. After an answer that is not about the model (an authentication error, a rate limit, a server error, a timeout, a transport error) the probe sends nothing to that provider for 60 seconds, so such a request waits for one timeout per minute at most, and the editor is told that no request was sent. A 403 does not pause the provider: a gateway key can be limited to some models, so it is an answer about the model. "Test model" is an operator's explicit request and is sent during that pause too.
Decisions of the product owner
On 2026-11-29 the product owner decided three points of this record:
Scope: the ``anthropic`` adapter type only. The OpenAI adapters already strip sampling parameters by the reasoning profile (ADR-275). OpenRouter ignores a parameter a provider does not support unless the request sets require_parameters (OpenRouter's provider-routing documentation, read 2026-11-29), and nr_llm does not set it. Gemini, Mistral, Groq and Ollama have no reported case.
Synchronous, bounded by the timeout. The probe runs in the save request, so the form can show its result at once. A queued probe through the background task queue (spec 031) would not delay the save, but the editor would see no result and a model would run unmeasured until a worker ran.
The measurement outranks the table (section 4).
Consequences
A new Claude model, and a gateway deployment of an older one, get their sampling parameters back after one save, without a release.
Each create or identity change of a Claude model record costs one request: at most one short input message and one output token, and nothing when Anthropic refuses it.
A save of a Claude model record can take up to 10 seconds longer.
A wrong answer from the endpoint, such as a gateway that accepts and drops temperature, is stored as "yes". The parameter then has no effect, which is the same outcome as leaving it out.
On API version 2026-10-21 every model refuses the parameters. If the adapter moves to that version, the stored measurements stop counting (section 4), every new probe answers "no", and the table must say the same.
Alternatives considered
Retry without the parameter and remember after a production request fails with a 400. Not chosen on 2026-11-29. It needs no extra request, but the first failing request reaches an editor, and the detection depends on the wording of production errors.
An operator field "send sampling parameters: yes / no / auto". Not chosen. It needs no request, but nobody fills it in until a request has already failed.
OpenRouter's ``supported_parameters`` as a source. It costs no tokens. It describes OpenRouter's endpoint and cannot speak for a gateway name.
References
Specification: specs/066-claude-sampling-probe/spec.md
Issue #1484, pull request #1485 (the table)
ADR-275: a model record carries its reasoning profile