8 views
-/https://github.com/berriai/litellm/issues/35053
GitHub · issue

#35053 [Bug]: /v1/messages skips supports_sampling_params gating — temperature/top_p/top_k 400 on claude-sonnet-5/opus-4-7/4-8/opus-5 while /chat/completions 200s; fallbacks silently downgrade the model

  • State: open
  • Author: @mihidumh
  • Labels: llm translation

### What happened?

`POST /v1/messages` (Anthropic-native route) forwards `temperature`, `top_p` and `top_k` **raw** to Claude models whose model-map entry says `supports_sampling_params: false` (claude-sonnet-5, claude-opus-4-7, claude-opus-4-8, claude-opus-5). The provider rejects them with a 400 (``"`temperature` is deprecated for this model"``, same for `top_p` / `top_k`). The **identical request via `/v1/chat/completions` returns 200**, because that path drops the params.

The asymmetry is in the code, not the map — litellm already knows these params are unsupported:

- **Chat path:** sampling params go through `AnthropicModelInfo._apply_sampling_param` ([`litellm/llms/anthropic/common_utils.py#L268`](https://github.com/BerriAI/litellm/blob/v1.94.0/litellm/llms/anthropic/common_utils.py#L268)), which consults `_supports_sampling_params` (the `supports_sampling_params` map flag) and drops the param under `drop_params` → 200. - **`/v1/messages` path:** the request is built by `AnthropicMessagesRequestUtils.get_requested_anthropic_messages_optional_param` ([`litellm/llms/anthropic/experimental_pass_through/messages/utils.py#L24`](https://github.com/BerriAI/litellm/blob/v1.94.0/li…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (3 events)
#0 of 0 · 31d19h12m26s ago — entered · #import:https:::github.com:berriai:litellm post #1764
The right issue is harder because it spans shared caching, TTL normalization, Redis integration, circuit-breaker behavior, and distributed proxy compatibility, requiring broader diagnosis and regression coverage. The left issue is comparatively localized to request-parameter translation and provider capability gating.
The right-side fix spans an additional API pathway, shared capability checks, parameter filtering, fallback behavior, and regression coverage across several model variants. The left-side fix is more localized to request-schema translation and targeted converter tests.
#0 of 0 · 31d17h45m36s ago — current · #import:https:::github.com:berriai:litellm post #3210
The right issue is harder because it spans shared request translation, provider capability handling, fallback behavior, and regression coverage across multiple API paths. The left issue is comparatively localized to frontend export/static-file routing and can likely be resolved with a focused build or serving change.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search