Skip to content

fix(anthropic_messages): gate sampling params on /v1/messages like /chat/completions - #37868

Merged
tin-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_pr35057_anthropic_messages_sampling_params
Aug 22, 2026
Merged

fix(anthropic_messages): gate sampling params on /v1/messages like /chat/completions#37868
tin-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_pr35057_anthropic_messages_sampling_params

Conversation

@tin-berri

@tin-berri tin-berri commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Note

This is a copy of #35057 by @mihidumh, pushed to a litellm_-prefixed branch on BerriAI/litellm so the full CircleCI suite (which does not run on fork PRs) can execute against it. Commit authorship is preserved: the commit is unchanged and still authored by @mihidumh. Full credit for the investigation, fix, and live-provider repro goes to the original author

TLDR

Problem this solves:

  • /v1/messages forwards temperature/top_p/top_k raw to models that removed them
  • Provider 400s; router fallbacks mask them as silent model downgrades
  • /chat/completions already drops the same params for the same models

How it solves it:

  • Reuse the chat path's AnthropicModelInfo._apply_sampling_param gating in the /v1/messages param builder
  • Drop under drop_params (matching /chat/completions), else clean client-side 400
  • No-op for models that still support sampling params (temperature=1 stays allowed everywhere)

User Flow

Before: a developer whose app sends a temperature on the Anthropic-native route gets a provider 400, and once fallbacks are configured, a quietly older model instead

  1. With the gateway's drop_params turned on, they send POST https://litellm-domain/v1/messages with {"model": "claude-sonnet-5", "max_tokens": 16, "temperature": 0.3, "messages": [{"role": "user", "content": "say ok"}]}
  2. They get back HTTP 400 carrying the provider's own wording, `temperature` is deprecated for this model, along with a req_011Ce... request id, so the call was made and rejected upstream
  3. They send the same model and temperature to POST https://litellm-domain/v1/chat/completions and get HTTP 200 with an answer, so the two routes disagree on identical input
  4. They turn drop_params off and try step 1 again, and the 400 comes back byte for byte identical, because the Anthropic-native route never consulted the setting at all
  5. top_p and top_k fail the same way, and adding "stream": true returns the same 400 with no events at all rather than a stream
  6. On a model group that has router fallbacks configured, step 1 returns HTTP 200 instead, answered by an older model generation, and only the response's model field reveals that the model they asked for was never used

After: the same request succeeds with the unsupported sampling params dropped, and the two routes finally agree

  1. With drop_params on, they send the same POST https://litellm-domain/v1/messages with "temperature": 0.3 on claude-sonnet-5
  2. They get HTTP 200 with the assistant's reply, and the temperature never reached the provider
  3. top_p gets the same treatment, and "stream": true now streams normally, ending in message_stop at HTTP 200
  4. POST https://litellm-domain/v1/chat/completions with the same model and temperature still returns HTTP 200, so both routes now behave alike
  5. With drop_params off, they instead get an immediate HTTP 400 from the gateway reading claude-sonnet-5 does not support temperature=0.3. Only temperature=1 is supported., raised before any provider call goes out, so there is no upstream request to pay for or fall back from
  6. A model that still supports sampling params, like claude-sonnet-4-6, keeps receiving the exact temperature it was sent
  7. Because step 1 no longer fails, a group with fallbacks configured stays on the model that was actually requested instead of silently dropping to an older generation

Relevant issues

Fixes #35053

Original PR: #35057

Linear ticket

Resolves LIT-5989

Type

🐛 Bug Fix

Changes

  • litellm/llms/anthropic/experimental_pass_through/messages/utils.py: after the existing _maybe_drop_speed_param gate, run temperature/top_p/top_k through AnthropicModelInfo._apply_sampling_param, the same helper the /chat/completions path uses, so both surfaces make the same decision from the same source of truth
  • tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_request_optional_param_utils.py: new coverage for the gating

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/test_litellm/<your_test_file>.py -v
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review

Screenshots / Proof of Fix

Shared setup for both sides, a proxy booted from the worktree at the named commit against the real Anthropic API, no mocks:

model_list:
  - model_name: claude-sonnet-5
    litellm_params:
      model: anthropic/claude-sonnet-5
      api_key: os.environ/ANTHROPIC_API_KEY
  - model_name: claude-sonnet-4-6
    litellm_params:
      model: anthropic/claude-sonnet-4-6
      api_key: os.environ/ANTHROPIC_API_KEY

litellm_settings:
  drop_params: true

general_settings:
  master_key: sk-qa5989

claude-sonnet-5 carries supports_sampling_params: false in the model map; claude-sonnet-4-6 has no such key, so it counts as supporting them and serves as the regression control. Case F re-runs case A against a second proxy booted from the same config with drop_params: false.

Before (dd64331)

A: /v1/messages, unsupported model, temperature

  1. curl -sS -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:37421/v1/messages -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-5","max_tokens":16,"temperature":0.3,"messages":[{"role":"user","content":"say ok"}]}'
  2. {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"`temperature` is deprecated for this model.\"},\"request_id\":\"req_011CeGtCXj9aFBtFc4NqTiBY\"}. Received Model Group=claude-sonnet-5\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}
    HTTP 400
    

B: /v1/messages, unsupported model, top_p

  1. curl -sS -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:37421/v1/messages -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-5","max_tokens":16,"top_p":0.9,"messages":[{"role":"user","content":"say ok"}]}'
  2. {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"`top_p` is deprecated for this model.\"},\"request_id\":\"req_011CeGtCZ7jqq8nXH128zRYy\"}. Received Model Group=claude-sonnet-5\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}
    HTTP 400
    

C: /chat/completions, same model and temperature

  1. curl -sS -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:37421/v1/chat/completions -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-5","max_tokens":16,"temperature":0.3,"messages":[{"role":"user","content":"say ok"}]}'
  2. {"id":"chatcmpl-0930850a-e84d-4b00-a5a2-4a15e31e0649",...,"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Ok","role":"assistant",...}}],...} at HTTP 200, the route that already gates correctly

D: /v1/messages, model that supports sampling params (control)

  1. curl -sS -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:37421/v1/messages -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-4-6","max_tokens":16,"temperature":0.3,"messages":[{"role":"user","content":"say ok"}]}'
  2. {"model":"claude-sonnet-4-6","id":"msg_011CeGtD1K5c775fywqgG2WQ",...,"content":[{"type":"text","text":"ok"}],"stop_reason":"end_turn",...} at HTTP 200

E: /v1/messages, unsupported model, temperature, streaming

  1. curl -sS -N -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:37421/v1/messages -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-5","max_tokens":16,"temperature":0.3,"stream":true,"messages":[{"role":"user","content":"say ok"}]}'
  2. No SSE at all, just a single JSON error body:
    {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"`temperature` is deprecated for this model.\"},\"request_id\":\"req_011CeGtDKiNNTZYqB3dap2rd\"}. Received Model Group=claude-sonnet-5\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}
    HTTP 400
    

F: /v1/messages, unsupported model, temperature, drop_params: false

  1. curl -sS -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:48113/v1/messages -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-5","max_tokens":16,"temperature":0.3,"messages":[{"role":"user","content":"say ok"}]}'
  2. Byte for byte the same provider 400 as case A, `temperature` is deprecated for this model with req_011CeGtFX53Ndr6cN6Q584yG, at HTTP 400. The route never consulted drop_params, so both settings behave identically here

After (c0118e5)

Captured at 1a408d7; the only commit since is c0118e5b7a, which deletes six comment lines and changes no executable code.

A: /v1/messages, unsupported model, temperature

  1. curl -sS -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:22117/v1/messages -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-5","max_tokens":16,"temperature":0.3,"messages":[{"role":"user","content":"say ok"}]}'
  2. {"model":"claude-sonnet-5","id":"msg_011CeGtBHCFqaZVN34jYbioW","type":"message","role":"assistant","content":[{"type":"text","text":"Ok"}],"stop_reason":"end_turn","stop_sequence":null,"stop_details":null,"usage":{"input_tokens":9,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":5,"service_tier":"standard","inference_geo":"global"}}
    HTTP 200
    
  3. The proxy's outbound body for this call carries no temperature key, so the param was dropped rather than forwarded

B: /v1/messages, unsupported model, top_p

  1. curl -sS -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:22117/v1/messages -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-5","max_tokens":16,"top_p":0.9,"messages":[{"role":"user","content":"say ok"}]}'
  2. {"model":"claude-sonnet-5","id":"msg_011CeGtBi1VpZCFV15BgWPJZ","type":"message","role":"assistant","content":[{"type":"text","text":"Okay"}],"stop_reason":"end_turn",...,"usage":{"input_tokens":9,"output_tokens":5,"service_tier":"standard","inference_geo":"global"}}
    HTTP 200
    

C: /chat/completions, same model and temperature

  1. curl -sS -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:22117/v1/chat/completions -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-5","max_tokens":16,"temperature":0.3,"messages":[{"role":"user","content":"say ok"}]}'
  2. {"id":"chatcmpl-27c9d65c-0021-436c-b79e-5af2da070c49",...,"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Ok","role":"assistant",...}}],...} at HTTP 200, unchanged, so the two routes now agree

D: /v1/messages, model that supports sampling params (control)

  1. curl -sS -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:22117/v1/messages -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-4-6","max_tokens":16,"temperature":0.3,"messages":[{"role":"user","content":"say ok"}]}'
  2. {"model":"claude-sonnet-4-6","id":"msg_011CeGtCPBSm1NgZNDm7jp2f",...,"content":[{"type":"text","text":"ok"}],"stop_reason":"end_turn",...} at HTTP 200
  3. The outbound body for this one still carries temperature: 0.3, so supporting models are untouched

E: /v1/messages, unsupported model, temperature, streaming

  1. curl -sS -N -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:22117/v1/messages -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-5","max_tokens":16,"temperature":0.3,"stream":true,"messages":[{"role":"user","content":"say ok"}]}'
  2. A real 23-line SSE stream at HTTP 200, opening with:
    event: message_start
    data: {"type":"message_start","message":{"model":"claude-sonnet-5","id":"msg_011CeGtD1ie4hc3UmzLhJaoY","type":"message","role":"assistant","content":[],"stop_reason":null,...}}
    
    event: content_block_start
    data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
    
    event: content_block_delta
    data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Ok"}}
    
    ending in message_delta with stop_reason: end_turn, then message_stop

F: /v1/messages, unsupported model, temperature, drop_params: false

  1. curl -sS -w '\nHTTP %{http_code}\n' -X POST http://127.0.0.1:48166/v1/messages -H 'Authorization: Bearer sk-qa5989' -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-5","max_tokens":16,"temperature":0.3,"messages":[{"role":"user","content":"say ok"}]}'
  2. {"error":{"message":"litellm.UnsupportedParamsError: claude-sonnet-5 does not support temperature=0.3. Only temperature=1 is supported. To drop unsupported params, set `litellm.drop_params = True`.. Received Model Group=claude-sonnet-5\nAvailable Model Group Fallbacks=None","type":"None","param":null,"code":"400"}}
    HTTP 400
    
  3. That proxy's debug log holds zero POST Request Sent from LiteLLM markers for the call, so the 400 was raised client-side and nothing reached Anthropic

Unit tests

tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_request_optional_param_utils.py passes 10/10 at the tip. Reverting only utils.py to the merge base fails 3 of them (test_drop_params_strips_sampling_params_for_unsupported_model, test_drop_params_strips_sampling_params_for_provider_prefixed_model, test_sampling_param_raises_clean_400_without_drop_params), so the new coverage genuinely pins the fix.

@tin-berri

Copy link
Copy Markdown
Contributor Author

@greptileai can you reply here with a score and why that score?

@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Score: 5/5

Here's why:

Fix is correct and complete. The core logic — calling AnthropicModelInfo._apply_sampling_param for each of temperature, top_p, top_k after _maybe_drop_speed_param — is exactly right. The filtered_params.pop(param) feeds the value in then lets the helper decide whether to re-insert it, which is how the chat path works. Both the drop_params flag and the litellm.drop_params global are respected consistently because the same helper is reused.

Single source of truth. Rather than duplicating the gating logic, this delegates to the same _apply_sampling_param the /chat/completions path already calls. Future updates to that helper (e.g., a new model losing sampling support) automatically apply to /v1/messages too — no drift possible.

Tests are thorough and correct. Six cases covering: drop under drop_params for bare and vertex_ai/-prefixed ids, keep for supporting models, temperature=1 passthrough on an unsupported model, and clean UnsupportedParamsError without drop_params. All five behavioral branches are exercised.

No issues flagged:

  • The # pyright: ignore[reportPrivateUsage] on calling _apply_sampling_param is appropriate — the comment explains the trade-off and the alternative (forking the logic) is worse.
  • filtered_params being Final doesn't prevent mutation; .pop() on the dict contents is fine.
  • No fastapi imports outside proxy, no hardcoded model capability flags, no new DB requests in the hot path, no custom HTTP handler.

The diff is 17 lines of production code and 86 lines of tests. It's minimal, well-motivated, and correct.

@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR aligns Anthropic /v1/messages sampling-parameter handling with the existing chat path.

  • Applies shared model-capability gating to temperature, top_p, and top_k.
  • Drops unsupported parameters when requested and otherwise raises a client-side unsupported-parameter error.
  • Adds coverage for supported, unsupported, provider-prefixed, and special-temperature cases.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
litellm/llms/anthropic/experimental_pass_through/messages/utils.py Reuses the shared Anthropic sampling-capability helper when constructing optional Messages API parameters.
tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_request_optional_param_utils.py Adds isolated regression coverage for sampling-parameter dropping, preservation, and rejection behavior.

Reviews (2): Last reviewed commit: "refactor(anthropic_messages): drop redun..." | Re-trigger Greptile

Comment thread litellm/llms/anthropic/experimental_pass_through/messages/utils.py Outdated
model=model,
param=param,
value=filtered_params.pop(param),
drop_params=drop_params,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Avoid destructive parameter mutation

filtered_params.pop(param) removes each value before the helper conditionally restores it, making parameter ownership and exception behavior harder to reason about; construct the gated result without destructively modifying the dictionary.

Context Used: CLAUDE.md (source)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chat path does the same pop-then-reapply for top_k in transformation.py. The helper only writes back supported params, so the pop is required.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. _apply_sampling_param takes value as an explicit parameter and only writes it back to optional_params when the param is supported — so the caller must pop before passing. The chat path uses the identical pattern. My concern was unfounded; the code is correct.

Apologies for the noise.

# claude-opus-4-7 removed sampling params (supports_sampling_params: false
# in the model map) — with drop_params they must be stripped instead of
# forwarded raw (the API 400s on them).
original = litellm.drop_params

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Avoid shared global test state

These tests repeatedly assign the process-wide litellm.drop_params setting even though the utility accepts drop_params directly, adding unnecessary shared-state coupling and manual restoration; pass the desired value through the argument instead.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tin-berri

Copy link
Copy Markdown
Contributor Author

Pushed two follow-up commits on top of the original commit (unchanged, still authored by @mihidumh):

  1. test(lint): fix PT011/PT012 in tests introduced by #37736 — cherry-picked from test(lint): fix PT011/PT012 introduced by #37736, blocking lint on every PR #37870. litellm_internal_staging currently fails the whole-tree ruff check --config ruff-tests.toml tests job on two files this PR never touches, so it blocked lint here too. Filed the real fix at test(lint): fix PT011/PT012 introduced by #37736, blocking lint on every PR #37870; cherry-picked onto this branch so CI is unblocked now. This will dedupe cleanly once test(lint): fix PT011/PT012 introduced by #37736, blocking lint on every PR #37870 lands.
  2. test(anthropic): drive new sampling-param tests off the kwarg, not the global — the 5 new tests set litellm.drop_params = True via manual try/finally, which trips TQ005 (module-global mutation) and pushed the test-suite over its ceiling. Rewrote them to pass drop_params=True directly to get_requested_anthropic_messages_optional_param (the actual mechanism /v1/messages uses) and pin the global to False via monkeypatch, so each test proves the per-request flag alone is sufficient. Same assertions, same coverage — verified all 10 tests still pass and the 3 gating tests still fail with the utils.py fix reverted.

@codspeed-hq

codspeed-hq Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_pr35057_anthropic_messages_sampling_params (c0118e5) with litellm_internal_staging (9c558df)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (843e90c) during the generation of this report, so 9c558df was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

mihidumh and others added 2 commits August 21, 2026 15:19
…hat/completions

/v1/messages forwarded temperature/top_p/top_k raw to models that removed
sampling params (supports_sampling_params: false — Claude 4.7+/Fable 5),
producing provider 400s that router fallbacks mask as silent model
downgrades. The chat path already gates these via
AnthropicModelInfo._apply_sampling_param; reuse it in
get_requested_anthropic_messages_optional_param so both endpoints agree:
drop under drop_params, else raise the clean client-side 400.

Fixes #35053
…e global

The five tests added here set `litellm.drop_params = True` under a manual
try/finally. That trips TQ005 (module-global mutation, 10 new violations
over the ceiling) and it leaks process-wide if the finally is ever
skipped, which is what the save/restore conftest exists to paper over.

`get_requested_anthropic_messages_optional_param` already takes
`drop_params` as a kwarg, and that is the path /v1/messages actually
uses, so pass it directly. `monkeypatch.setattr` pins the global to
False so each test proves the per-request flag alone is sufficient and
cannot pass on a leaked global.

Verified: TQ gate clean, all 10 tests pass, and the 3 that assert the
new gating still fail with the fix in utils.py reverted.
@tin-berri
tin-berri force-pushed the litellm_pr35057_anthropic_messages_sampling_params branch from 131f2b4 to 1a408d7 Compare August 21, 2026 22:23
@tin-berri

Copy link
Copy Markdown
Contributor Author

Rebased onto staging and dropped the lint commit, now redundant after #37864 merged. @greptileai can you reply here with a score and why that score?

@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Score: 5/5

Here's why:

Fix correctness: The approach is exactly right. Rather than duplicating the gating logic, it reuses AnthropicModelInfo._apply_sampling_param — the identical helper the /chat/completions path already calls — so both surfaces make the same decision from a single source of truth. If the model capability map is updated for a new model, both paths benefit automatically.

No regressions: The pop(param) before passing value to _apply_sampling_param is correct: the helper mutates optional_params (writing back only when the param is allowed), so pre-removing the key and letting the helper re-add it only if supported is the right protocol — consistent with how the chat transformation calls it.

Test coverage: 5 targeted unit tests cover all meaningful branches — unsupported model (bare and vertex_ai/-prefixed), supported model kept, temperature=1 edge case, and UnsupportedParamsError without drop_params. That's thorough for a focused bug fix.

Scope discipline: Two files changed, both directly on the bug path. No drive-by cleanup, no new abstractions.

Live-provider evidence: Real Vertex AI repro (before/after) from the original author, plus the proxy sweep table in #35053. Unusually rigorous for a bugfix PR.

The inline # pyright: ignore is appropriate — the justification in the comment ("forking it would drift") is correct.

5/5 — ready for maintainer review.

@tin-berri
tin-berri enabled auto-merge (squash) August 21, 2026 22:31
@tin-berri

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 1a408d7. Configure here.

The block restated what _supports_sampling_params already documents in its
own docstring, and the pyright suppression on the call already names why
the private helper is reused.
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c0118e5. Configure here.

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@tin-berri
tin-berri merged commit 770bd40 into litellm_internal_staging Aug 22, 2026
71 checks passed
@tin-berri
tin-berri deleted the litellm_pr35057_anthropic_messages_sampling_params branch August 22, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants