Files
magpie/docs
yetone 9db2ed3dc6 gateway: temperature, top_p and top_k are left out for the Claudes that refuse them, so Haiku 5.5 no longer answers auto mode's classifier "temperature is deprecated for this model" (#1454)
Claude Code's auto mode classifier asks at temperature 0, and magpie's
own classifiers do too. Through the aihubmix relay, claude-haiku-5-5
answered 400 "`temperature` is deprecated for this model." (and the same
for `top_p` and `top_k`). magpie relayed sampling parameters as they
came, and built them from a chat request's temperature or top_p.

samplingAsTaken, beside thinkingOffAsTaken in forwardOnce, so relayed and
built requests and retries all go through it, leaves the three out for
the models Anthropic documents as refusing them:
- Opus 4.7, 4.8, 5 and 5.5, Fable 5 and Mythos 5 refuse them at any
  value.
- Sonnet 5 and 5.5 refuse anything but the default.
- Haiku 5.5 takes only temperature 1 and top_p 0.99, never both, and no
  top_k.
Left out, each model samples at its default. The model is read as the
vendor names it, from the body or, for Bedrock and Vertex, the path.
Older Claudes (Haiku 4.5, Sonnet 4.6, Opus 4.6 and before), other
vendors' models and later lines go byte for byte as they came. A Claude
under a name these rules can't read, answering that a sampling parameter
is deprecated or not supported (samplingDeprecated), is asked again
without them, once.

aihubmix itself took every value for the other models and refused it
only on Haiku 5.5. The other models are left out by the docs' rule, for
direct keys and relays that pass the vendor's 400 on.

Verified:
- Tests:
  - TestSamplingAsTheModelTakesIt covers each refusing model's
    spellings, a Bedrock path, and byte-identical bodies for Haiku 4.5,
    Sonnet 4.6/4.5, Opus 4.6/4.1, Claude 3.7, Sonnet/Haiku 6, deepseek,
    glm, kimi and gpt.
  - TestHaikuFiveFiveSamplingOnTheWire uses a fake vendor answering
    with the relay's literal 400s. It covers the classifier relayed,
    top_p/top_k, magpie's own classifier built from chat, Haiku 4.5
    keeping temperature 0, and an unreadable name retried once.
- Without the forwardOnce call, three wire cases FAIL. Without the
  retry, the unreadable-name case FAILs.
- Live, through this build's `magpie serve` under a sandbox HOME with
  the aihubmix key, in the classifier's shape (temperature 0, stop
  </block>, thinking disabled), all 200:
  - claude-haiku-5-5 at default and max effort and with thinking
    omitted;
  - claude-haiku-4-5, claude-sonnet-5-5, claude-opus-5-5 and
    claude-sonnet-5;
  - chat to claude-haiku-5-5 at temperature 0 and at top_p 0.5.
  Straight to aihubmix, Haiku 5.5 at temperature 0, top_p 0.5 or
  top_k 5 gives the 400.
- gofmt -l, GOOS=linux and GOOS=windows go vet -tags nogui
  ./internal/gateway, and go test -tags nogui ./internal/gateway under a
  temp HOME with pinned caches.
2026-10-10 11:13:42 +08:00
..