Skip to content

fix(bedrock/converse): drop toolSpec.strict for Opus 4.7/4.8 (#31582) - #31923

Merged
mateo-berri merged 4 commits into
litellm_internal_stagingfrom
litellm_fix_bedrock_opus_47_strict_tools
Jul 2, 2026
Merged

fix(bedrock/converse): drop toolSpec.strict for Opus 4.7/4.8 (#31582)#31923
mateo-berri merged 4 commits into
litellm_internal_stagingfrom
litellm_fix_bedrock_opus_47_strict_tools

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

Closes #31582

Internal copy of #31585 by @ly-wang19 (original authorship preserved on the commits) so CircleCI can run on it. All credit to the original author

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

From the original PR: sending a tool with strict: true to bedrock/us.anthropic.claude-opus-4-7 or claude-opus-4-8 on Bedrock Converse fails with 400 tools.0.custom.strict: Extra inputs are not permitted. With this change, strict is dropped from toolSpec for the Opus 4.7/4.8 family only, so the call succeeds; Sonnet 4.5/4.6, Opus <=4.6 and other Anthropic models keep forwarding strict as before (#29814 behavior preserved), and non-Anthropic families (Nova, Llama, GPT-OSS) are unchanged

Regression tests: tests/test_litellm/litellm_core_utils/prompt_templates/test_bedrock_converse_strict_tools_opus_47_48.py (18 passed locally); existing test_bedrock_tools_pt_strict_parameter still passes

Latest e2e QA run: 2026-07-02 02:32 UTC against commit 6bd1f9a, on a live proxy hitting real Bedrock (us-west-2, no mocks). strict: true tool calls to us.anthropic.claude-opus-4-8 and us.anthropic.claude-opus-4-7 returned 200 with real tool calls, us.anthropic.claude-sonnet-4-5-20250929-v1:0 still forwards "strict": true in its raw toolSpec payload (verified in --detailed_debug logs, so the gate is model-scoped rather than a blanket drop), and the same Opus 4.8 request against a pre-fix proxy reproduced the exact 400 tools.0.custom.strict: Extra inputs are not permitted

Type

🐛 Bug Fix

Changes

PR #29814 started forwarding strict into the Bedrock Converse toolSpec, gated on get_bedrock_base_model(model).startswith("anthropic"). That gate is too broad: Bedrock routes Opus 4.7/4.8 through an Anthropic-compatible validator that maps toolSpec to the native tool shape (the custom variant) and rejects the extra strict key. This replaces the gate in litellm_core_utils/prompt_templates/factory.py with bedrock_converse_supports_strict_tools in litellm/llms/bedrock/common_utils.py, which returns False for non-Anthropic Bedrock models and for the Opus 4.7/4.8 family, and True for every other Anthropic model on Bedrock

Following review feedback, the Opus 4.7/4.8 exclusion is not hardcoded in the source: the affected Bedrock entries in model_prices_and_context_window.json carry a bedrock_converse_supports_strict_tools: false flag, resolved through get_model_info with a local cost map fallback (the same approach as bedrock_output_config_effort_ceiling), so future models with the same restriction only need a JSON update


> [!NOTE]
> Low Risk
> Targeted Bedrock tool-payload gating with JSON flags and regression tests; behavior change is limited to omitting strict for flagged Opus 4.7/4.8 models.
>
> Overview
> Fixes Bedrock Converse 400 errors when tools include strict: true on Claude Opus 4.7/4.8, where the Converse validator rejects toolSpec.strict even though other Anthropic Bedrock models accept it.
>
> _bedrock_tools_pt no longer treats every Anthropic Bedrock model as strict-capable; it uses bedrock_converse_supports_strict_tools(model), which keeps strict for Sonnet and Opus ≤4.6 and omits it for Opus 4.7/4.8 and non-Anthropic families (unchanged).
>
> The new helper reads bedrock_converse_supports_strict_tools from the model cost map (with version-suffix normalization and local fallback), matching the pattern used for bedrock_output_config_effort_ceiling. Opus 4.7/4.8 regional entries are flagged false in model_prices_and_context_window.json, and the flag is wired through ModelInfo / get_model_info. Regression tests cover Opus 4.7/4.8 drop vs other models keep/drop behavior.
>
> Reviewed by Cursor Bugbot for commit 6bd1f9a. Bugbot is set up for automated code reviews on this repo. Configure here.

ly-wang19 added 2 commits July 2, 2026 00:06
Bedrock Converse routes Claude Opus 4.7/4.8 through an Anthropic-compatible
validator that maps toolSpec to the native tool shape and rejects the extra
`strict` key with `tools.N.custom.strict: Extra inputs are not permitted`,
even though Anthropic's native API accepts `strict` as a top-level tool field
for the same models. Sonnet 4.5/4.6 and Opus <=4.6 accept `toolSpec.strict`
unchanged.

The existing gate `get_bedrock_base_model(model).startswith("anthropic")`
(introduced in #29814 to forward `strict` for Claude on Bedrock Converse) is
too broad and regressed Opus 4.7/4.8 callers — see #31582.

Replace the inline check with a small `bedrock_converse_supports_strict_tools`
helper that excludes the Opus 4.7/4.8 family from strict forwarding. All
other Anthropic models on Bedrock keep the existing behavior.

Closes #31582.
The original regression test was added to
test_litellm_core_utils_prompt_templates_factory.py, which has
pre-existing ruff-format violations throughout (multi-line asserts that
fit on one line). The lint workflow runs `ruff format --check` on
changed files only, so touching that file surfaces those pre-existing
violations and fails CI for unrelated reasons.

Move the #31582 regression coverage into a new dedicated test file so
the format check stays green. Also collapses the helper's `not any(...)`
onto a single line to satisfy ruff format.

Covers: #31582
@CLAassistant

CLAassistant commented Jul 2, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ mateo-berri
❌ ly-wang19
You have signed the CLA already but the status is still pending? Let us recheck it.

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai


Generated by Claude Code

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a 400 error on Bedrock Converse when calling Claude Opus 4.7/4.8 with strict: true in a tool definition, caused by Bedrock's validator rejecting toolSpec.strict for those models even though other Anthropic models accept it.

  • Replaces the broad get_bedrock_base_model(model).startswith("anthropic") gate in factory.py with a new bedrock_converse_supports_strict_tools helper in bedrock/common_utils.py; the helper reads a bedrock_converse_supports_strict_tools: false flag from model_prices_and_context_window.json, following the same JSON-driven pattern already used by bedrock_output_config_effort_ceiling.
  • Adds the flag to all Opus 4.7/4.8 regional entries (anthropic, global, us, eu, au, jp) in both the primary and backup JSON files, and plumbs the field through ProviderSpecificModelInfo and _get_model_info_helper.
  • Includes 18 new regression tests covering the Opus 4.7/4.8 exclusion, other-Anthropic pass-through, and non-Anthropic exclusion paths — all using local data, no network calls.

Confidence Score: 5/5

Safe to merge — the change is narrowly scoped, follows an established pattern in the codebase, and is backed by a purpose-built regression test suite.

The fix correctly replaces a too-broad provider check with a JSON-driven capability flag, using the same two-phase lookup (model_info dict → local cost map via key) already in production for bedrock_output_config_effort_ceiling. All affected Opus 4.7/4.8 regional entries in both JSON files carry the new flag, and the new helper defaults to true for models not explicitly listed — preserving existing behavior for every other Anthropic model on Bedrock. Tests cover the exclusion, inclusion, and non-Anthropic paths without any network calls.

No files require special attention.

Important Files Changed

Filename Overview
litellm/llms/bedrock/common_utils.py Adds bedrock_converse_supports_strict_tools and its private helper; implementation mirrors the existing _get_bedrock_output_config_effort_ceiling pattern and is JSON-driven.
litellm/litellm_core_utils/prompt_templates/factory.py Replaces the get_bedrock_base_model(model).startswith("anthropic") gate with the new bedrock_converse_supports_strict_tools helper; call site is clean.
model_prices_and_context_window.json Adds bedrock_converse_supports_strict_tools: false to all Opus 4.7/4.8 regional entries; correct coverage across anthropic, global, us, eu, au, jp prefixes.
litellm/model_prices_and_context_window_backup.json Mirror of the main JSON changes; backup kept in sync.
litellm/types/utils.py Adds bedrock_converse_supports_strict_tools: Optional[bool] to ProviderSpecificModelInfo TypedDict; correct typing.
litellm/utils.py Plumbs bedrock_converse_supports_strict_tools from the JSON cost map into the _get_model_info_helper return dict; follows the same pattern as other capability flags.
tests/test_litellm/litellm_core_utils/prompt_templates/test_bedrock_converse_strict_tools_opus_47_48.py New regression suite; covers Opus 4.7/4.8 exclusion, other-Anthropic inclusion, and non-Anthropic exclusion; all tests use local data without network calls.
tests/test_litellm/test_utils.py Adds bedrock_converse_supports_strict_tools to the JSON schema validator; no change to existing assertions.

Reviews (4): Last reviewed commit: "chore: revert unrelated credential_migra..." | Re-trigger Greptile

Comment thread litellm/llms/bedrock/common_utils.py Outdated
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yucheng-berri

Copy link
Copy Markdown
Contributor

is the greptile comment legit?

@mateo-berri
mateo-berri marked this pull request as ready for review July 2, 2026 00:36
Replace the hardcoded Opus 4.7/4.8 pattern list with a
bedrock_converse_supports_strict_tools flag on the affected entries in
model_prices_and_context_window.json, resolved via get_model_info with a
local cost map fallback, so future models with the same restriction only
need a JSON update
@mateo-berri

Copy link
Copy Markdown
Contributor Author

@yucheng-berri yes, the P1 is legit. The repo already stores this kind of Bedrock capability info in model_prices_and_context_window.json (see bedrock_output_config_effort_ceiling, read via get_model_info in the same file), and there is a team rule in Greptile's context prohibiting hardcoded model flags. Addressed in 3652798: the Opus 4.7/4.8 entries now carry bedrock_converse_supports_strict_tools: false in the cost map and the helper resolves it through get_model_info with a local cost map fallback, so future models with the same restriction only need a JSON update


Generated by Claude Code

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai


Generated by Claude Code

@mateo-berri

Copy link
Copy Markdown
Contributor Author

@greptileai


Generated by Claude Code

@mateo-berri

Copy link
Copy Markdown
Contributor Author

bugbot run


Generated by Claude Code

@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 6bd1f9a. Configure here.

@mateo-berri
mateo-berri merged commit 85f9241 into litellm_internal_staging Jul 2, 2026
127 checks passed
@mateo-berri
mateo-berri deleted the litellm_fix_bedrock_opus_47_strict_tools branch July 2, 2026 02:08
seanturner83 added a commit to seanturner83/strix that referenced this pull request Jul 2, 2026
…1.91.0)

litellm 1.90.x forwards the OpenAI `strict` tool field into the Bedrock
Converse toolSpec for Anthropic models (PR BerriAI/litellm#29814, gated on
get_bedrock_base_model(model).startswith("anthropic")). Converse rejects it
for Opus 4.7/4.8: `tools.0.custom.strict: Extra inputs are not permitted`
-> every tool-calling scan 400s at warm-up. The openai-agents SDK stamps
strict on every FunctionTool (ensure_strict_json_schema), so it fires
universally.

UPSTREAM ALREADY FIXED THIS: BerriAI/litellm#31923 + #31943 (merged
2026-07-02, closing litellm#31582 which is this exact symptom) replace the
broad startswith("anthropic") gate with bedrock_converse_supports_strict_tools.
The fix ships in litellm 1.91.0. We pin 1.90.2 today, which predates it, so
this monkeypatch (AmazonConverseConfig._transform_request_helper strips
`strict`) bridges until we bump litellm.

REMOVE THIS FILE + its apply() call in models.py once litellm>=1.91.0 is the
floor. Idempotent, fail-open. Not an upstream candidate (upstream fixed it).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
seanturner83 added a commit to seanturner83/strix that referenced this pull request Jul 2, 2026
…1.91.0)

litellm 1.90.x forwards the OpenAI `strict` tool field into the Bedrock
Converse toolSpec for Anthropic models (PR BerriAI/litellm#29814, gated on
get_bedrock_base_model(model).startswith("anthropic")). Converse rejects it
for Opus 4.7/4.8: `tools.0.custom.strict: Extra inputs are not permitted`
-> every tool-calling scan 400s at warm-up. The openai-agents SDK stamps
strict on every FunctionTool (ensure_strict_json_schema), so it fires
universally.

UPSTREAM ALREADY FIXED THIS: BerriAI/litellm#31923 + #31943 (merged
2026-07-02, closing litellm#31582 which is this exact symptom) replace the
broad startswith("anthropic") gate with bedrock_converse_supports_strict_tools.
The fix ships in litellm 1.91.0. We pin 1.90.2 today, which predates it, so
this monkeypatch (AmazonConverseConfig._transform_request_helper strips
`strict`) bridges until we bump litellm.

REMOVE THIS FILE + its apply() call in models.py once litellm>=1.91.0 is the
floor. Idempotent, fail-open. Not an upstream candidate (upstream fixed it).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rodrigo-Palma pushed a commit to Rodrigo-Palma/litellm that referenced this pull request Jul 3, 2026
…#31582) (BerriAI#31923)

* fix(bedrock/converse): drop toolSpec.strict for Opus 4.7/4.8

Bedrock Converse routes Claude Opus 4.7/4.8 through an Anthropic-compatible
validator that maps toolSpec to the native tool shape and rejects the extra
`strict` key with `tools.N.custom.strict: Extra inputs are not permitted`,
even though Anthropic's native API accepts `strict` as a top-level tool field
for the same models. Sonnet 4.5/4.6 and Opus <=4.6 accept `toolSpec.strict`
unchanged.

The existing gate `get_bedrock_base_model(model).startswith("anthropic")`
(introduced in BerriAI#29814 to forward `strict` for Claude on Bedrock Converse) is
too broad and regressed Opus 4.7/4.8 callers — see BerriAI#31582.

Replace the inline check with a small `bedrock_converse_supports_strict_tools`
helper that excludes the Opus 4.7/4.8 family from strict forwarding. All
other Anthropic models on Bedrock keep the existing behavior.

Closes BerriAI#31582.

* fix(bedrock/converse): move strict-tools regression to a clean test file

The original regression test was added to
test_litellm_core_utils_prompt_templates_factory.py, which has
pre-existing ruff-format violations throughout (multi-line asserts that
fit on one line). The lint workflow runs `ruff format --check` on
changed files only, so touching that file surfaces those pre-existing
violations and fails CI for unrelated reasons.

Move the BerriAI#31582 regression coverage into a new dedicated test file so
the format check stays green. Also collapses the helper's `not any(...)`
onto a single line to satisfy ruff format.

Covers: BerriAI#31582

* refactor(bedrock/converse): drive strict-tools gate from model cost map

Replace the hardcoded Opus 4.7/4.8 pattern list with a
bedrock_converse_supports_strict_tools flag on the affected entries in
model_prices_and_context_window.json, resolved via get_model_info with a
local cost map fallback, so future models with the same restriction only
need a JSON update

* chore: revert unrelated credential_migration.py reformat

---------

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
yuneng-berri added a commit that referenced this pull request Jul 3, 2026
chore(release): backport #31923, #31929, #31393 to stable/1.90.x and cut 1.90.3
yuneng-berri added a commit that referenced this pull request Jul 4, 2026
chore(release): backport #31912/#31920/#31921 (+#31923/#31929 parity, #31635 prereq) onto patch-1.91.0rc1
eleboucher pushed a commit to eleboucher/homelab that referenced this pull request Jul 4, 2026
….3) (#1400)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/berriai/litellm](https://images.chainguard.dev/directory/image/wolfi-base/overview) ([source](https://github.com/BerriAI/litellm)) | patch | `v1.90.2` → `v1.90.3` |

---

### Release Notes

<details>
<summary>BerriAI/litellm (ghcr.io/berriai/litellm)</summary>

### [`v1.90.3`](https://github.com/BerriAI/litellm/releases/tag/v1.90.3)

[Compare Source](BerriAI/litellm@v1.90.3...v1.90.3)

##### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.3/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

##### What's Changed

- chore(release): backport [#&#8203;31923](BerriAI/litellm#31923), [#&#8203;31929](BerriAI/litellm#31929), [#&#8203;31393](BerriAI/litellm#31393) to stable/1.90.x and cut 1.90.3 by [@&#8203;mateo-berri](https://github.com/mateo-berri) in [#&#8203;32025](BerriAI/litellm#32025)

**Full Changelog**: <BerriAI/litellm@v1.90.2...v1.90.3>

### [`v1.90.3`](https://github.com/BerriAI/litellm/releases/tag/v1.90.3)

[Compare Source](BerriAI/litellm@v1.90.2...v1.90.3)

##### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.3/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

##### What's Changed

- chore(release): backport [#&#8203;31923](BerriAI/litellm#31923), [#&#8203;31929](BerriAI/litellm#31929), [#&#8203;31393](BerriAI/litellm#31393) to stable/1.90.x and cut 1.90.3 by [@&#8203;mateo-berri](https://github.com/mateo-berri) in [#&#8203;32025](BerriAI/litellm#32025)

**Full Changelog**: <BerriAI/litellm@v1.90.2...v1.90.3>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/1400
blake-hamm added a commit to blake-hamm/bhamm-lab that referenced this pull request Jul 4, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ghcr.io/berriai/litellm](https://images.chainguard.dev/directory/image/wolfi-base/overview) ([source](https://github.com/BerriAI/litellm)) | final | patch | `v1.90.2` → `v1.90.3` |

---

### Release Notes

<details>
<summary>BerriAI/litellm (ghcr.io/berriai/litellm)</summary>

### [`v1.90.3`](https://github.com/BerriAI/litellm/releases/tag/v1.90.3)

[Compare Source](BerriAI/litellm@v1.90.3...v1.90.3)

##### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.3/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

##### What's Changed

- chore(release): backport [#&#8203;31923](BerriAI/litellm#31923), [#&#8203;31929](BerriAI/litellm#31929), [#&#8203;31393](BerriAI/litellm#31393) to stable/1.90.x and cut 1.90.3 by [@&#8203;mateo-berri](https://github.com/mateo-berri) in [#&#8203;32025](BerriAI/litellm#32025)

**Full Changelog**: <BerriAI/litellm@v1.90.2...v1.90.3>

### [`v1.90.3`](https://github.com/BerriAI/litellm/releases/tag/v1.90.3)

[Compare Source](BerriAI/litellm@v1.90.2...v1.90.3)

##### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.3/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

##### What's Changed

- chore(release): backport [#&#8203;31923](BerriAI/litellm#31923), [#&#8203;31929](BerriAI/litellm#31929), [#&#8203;31393](BerriAI/litellm#31393) to stable/1.90.x and cut 1.90.3 by [@&#8203;mateo-berri](https://github.com/mateo-berri) in [#&#8203;32025](BerriAI/litellm#32025)

**Full Changelog**: <BerriAI/litellm@v1.90.2...v1.90.3>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDkuNSIsInVwZGF0ZWRJblZlciI6IjQzLjI0OS41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: Renovate Bot <renovate@bhamm-lab.com>
Reviewed-on: https://codeberg.org/blake-hamm/bhamm-lab/pulls/258
blake-hamm added a commit to blake-hamm/bhamm-lab that referenced this pull request Jul 4, 2026
…to v1.90.3 (#257)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [https://github.com/BerriAI/litellm.git](https://github.com/BerriAI/litellm) | patch | `v1.90.0` → `v1.90.3` |

---

### Release Notes

<details>
<summary>BerriAI/litellm (https://github.com/BerriAI/litellm.git)</summary>

### [`v1.90.3`](https://github.com/BerriAI/litellm/releases/tag/v1.90.3)

[Compare Source](BerriAI/litellm@v1.90.2...v1.90.3)

#### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.3/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.3
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

#### What's Changed

- chore(release): backport [#&#8203;31923](BerriAI/litellm#31923), [#&#8203;31929](BerriAI/litellm#31929), [#&#8203;31393](BerriAI/litellm#31393) to stable/1.90.x and cut 1.90.3 by [@&#8203;mateo-berri](https://github.com/mateo-berri) in [#&#8203;32025](BerriAI/litellm#32025)

**Full Changelog**: <BerriAI/litellm@v1.90.2...v1.90.3>

### [`v1.90.2`](https://github.com/BerriAI/litellm/releases/tag/v1.90.2)

[Compare Source](BerriAI/litellm@v1.90.1...v1.90.2)

#### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.2
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.2/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.2
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

#### What's Changed

- chore(release): backport [#&#8203;31519](BerriAI/litellm#31519), [#&#8203;31733](BerriAI/litellm#31733) to stable/1.90.x and cut 1.90.2 by [@&#8203;yuneng-berri](https://github.com/yuneng-berri) in [#&#8203;31782](BerriAI/litellm#31782)

**Full Changelog**: <BerriAI/litellm@v1.90.1...v1.90.2>

### [`v1.90.1`](https://github.com/BerriAI/litellm/releases/tag/v1.90.1)

[Compare Source](BerriAI/litellm@v1.90.0-rc.1...v1.90.1)

#### Verify Docker Image Signature

All LiteLLM Docker images are signed with [cosign](https://docs.sigstore.dev/cosign/overview/). Every release is signed with the same key introduced in [commit `0112e53`](BerriAI/litellm@0112e53).

**Verify using the pinned commit hash (recommended):**

A commit hash is cryptographically immutable, so this is the strongest way to ensure you are using the original signing key:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/0112e53046018d726492c814b3644b7d376029d0/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.1
```

**Verify using the release tag (convenience):**

Tags are protected in this repository and resolve to the same key. This option is easier to read but relies on tag protection rules:

```bash
cosign verify \
  --key https://raw.githubusercontent.com/BerriAI/litellm/v1.90.1/cosign.pub \
  ghcr.io/berriai/litellm:v1.90.1
```

Expected output:

```
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - The signatures were verified against the specified public key
```

***

#### What's Changed

- chore(release): backport [#&#8203;31036](BerriAI/litellm#31036), [#&#8203;31342](BerriAI/litellm#31342), [#&#8203;31653](BerriAI/litellm#31653) to stable/1.90.x and cut 1.90.1 (litellm-enterprise 0.1.43.post1) by [@&#8203;yuneng-berri](https://github.com/yuneng-berri) in [#&#8203;31667](BerriAI/litellm#31667)

**Full Changelog**: <BerriAI/litellm@v1.90.0...v1.90.1>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDkuNSIsInVwZGF0ZWRJblZlciI6IjQzLjI0OS41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Co-authored-by: Renovate Bot <renovate@bhamm-lab.com>
Reviewed-on: https://codeberg.org/blake-hamm/bhamm-lab/pulls/257
ap-anton-r-susilo pushed a commit to ap-anton-r-susilo/litellm that referenced this pull request Jul 6, 2026
…#31582) (BerriAI#31923)

* fix(bedrock/converse): drop toolSpec.strict for Opus 4.7/4.8

Bedrock Converse routes Claude Opus 4.7/4.8 through an Anthropic-compatible
validator that maps toolSpec to the native tool shape and rejects the extra
`strict` key with `tools.N.custom.strict: Extra inputs are not permitted`,
even though Anthropic's native API accepts `strict` as a top-level tool field
for the same models. Sonnet 4.5/4.6 and Opus <=4.6 accept `toolSpec.strict`
unchanged.

The existing gate `get_bedrock_base_model(model).startswith("anthropic")`
(introduced in BerriAI#29814 to forward `strict` for Claude on Bedrock Converse) is
too broad and regressed Opus 4.7/4.8 callers — see BerriAI#31582.

Replace the inline check with a small `bedrock_converse_supports_strict_tools`
helper that excludes the Opus 4.7/4.8 family from strict forwarding. All
other Anthropic models on Bedrock keep the existing behavior.

Closes BerriAI#31582.

* fix(bedrock/converse): move strict-tools regression to a clean test file

The original regression test was added to
test_litellm_core_utils_prompt_templates_factory.py, which has
pre-existing ruff-format violations throughout (multi-line asserts that
fit on one line). The lint workflow runs `ruff format --check` on
changed files only, so touching that file surfaces those pre-existing
violations and fails CI for unrelated reasons.

Move the BerriAI#31582 regression coverage into a new dedicated test file so
the format check stays green. Also collapses the helper's `not any(...)`
onto a single line to satisfy ruff format.

Covers: BerriAI#31582

* refactor(bedrock/converse): drive strict-tools gate from model cost map

Replace the hardcoded Opus 4.7/4.8 pattern list with a
bedrock_converse_supports_strict_tools flag on the affected entries in
model_prices_and_context_window.json, resolved via get_model_info with a
local cost map fallback, so future models with the same restriction only
need a JSON update

* chore: revert unrelated credential_migration.py reformat

---------

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
(cherry picked from commit 85f9241)
nickhac added a commit to nickhac/litellm that referenced this pull request Aug 3, 2026
…et 4.6 and Haiku 4.5

Bedrock Converse rejects toolSpec.strict for Claude Sonnet 4.6 and
Claude Haiku 4.5, causing a grammar-size error (>300MB compiled grammar)
that results in a 504 Gateway Timeout for callers.

The same fix was already applied for Opus 4.7/4.8 (BerriAI#31923) and Sonnet 4
(BerriAI#31943). This extends it to the missing model variants by setting
bedrock_converse_supports_strict_tools: false on all regional Bedrock
Converse entries for these two models.

Fixes BerriAI#34388

Co-authored-by: Hermes Agent <hermes-agent@nousresearch.com>
nickhac added a commit to nickhac/litellm that referenced this pull request Aug 8, 2026
…et 4.6 and Haiku 4.5

Bedrock Converse rejects toolSpec.strict for Claude Sonnet 4.6 and
Claude Haiku 4.5, causing a grammar-size error (>300MB compiled grammar)
that results in a 504 Gateway Timeout for callers.

The same fix was already applied for Opus 4.7/4.8 (BerriAI#31923) and Sonnet 4
(BerriAI#31943). This extends it to the missing model variants by setting
bedrock_converse_supports_strict_tools: false on all regional Bedrock
Converse entries for these two models.

Fixes BerriAI#34388

Co-authored-by: Hermes Agent <hermes-agent@nousresearch.com>
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.

[Bug]: Bedrock Claude Opus 4.7/4.8 reject tool calls with strict: true (tools.0.custom.strict: Extra inputs are not permitted)

4 participants