[PR #5472] [MERGED] fix: omit temperature param for Bedrock Claude Opus 4.7 #5454

Closed
opened 2026-06-05 15:21:24 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/5472
Author: @angelplusultra
Created: 4/20/2026
Status: Merged
Merged: 4/21/2026
Merged by: @timothycarambat

Base: masterHead: 5461-bug-temperature-deprecated-on-claude-opus-47


📝 Commits (3)

  • 6fdcb7d addconditionally pass temperature based on aws bedrock model id
  • 34aabe1 move to config
  • 70c5d86 Merge branch 'master' into 5461-bug-temperature-deprecated-on-claude-opus-47

📊 Changes

1 file changed (+26 additions, -2 deletions)

View changed files

📝 server/utils/AiProviders/bedrock/index.js (+26 -2)

📄 Description

Pull Request Type

  • feat (New feature)
  • 🐛 fix (Bug fix)
  • ♻️ refactor (Code refactoring without changing behavior)
  • 💄 style (UI style changes)
  • 🔨 chore (Build, CI, maintenance)
  • 📝 docs (Documentation updates)

Relevant Issues

resolves #5461

Description

AWS Bedrock rejects requests to anthropic.claude-opus-4-7 when temperature is included in inferenceConfig — the parameter is deprecated for that model and the call fails validation.

This PR introduces a module-level MODELS_THAT_REJECT_TEMPERATURE list in server/utils/AiProviders/bedrock/index.js and conditionally omits temperature from the Converse API payload in both call sites that build it:

  • getChatCompletion (non-streaming)
  • streamGetChatCompletion (streaming)

All other Bedrock models continue to receive temperature ?? this.defaultTemp exactly as before, so behavior is unchanged outside of the explicitly listed models. The agent-mode Bedrock provider (server/utils/agents/aibitat/providers/bedrock.js) never sent temperature in the first place, so no changes were needed there.

Visuals (if applicable)

N/A

Additional Information

If Bedrock later adds other models that reject temperature, extend the MODELS_THAT_REJECT_TEMPERATURE array at the top of bedrock/index.js — no other code changes required.

Developer Validations

  • I ran `yarn lint` from the root of the repo & committed changes
  • Relevant documentation has been updated (if applicable)
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/5472 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 4/20/2026 **Status:** ✅ Merged **Merged:** 4/21/2026 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `5461-bug-temperature-deprecated-on-claude-opus-47` --- ### 📝 Commits (3) - [`6fdcb7d`](https://github.com/Mintplex-Labs/anything-llm/commit/6fdcb7d7e56e999dd45377f0cbca5b7e1c90a8aa) addconditionally pass temperature based on aws bedrock model id - [`34aabe1`](https://github.com/Mintplex-Labs/anything-llm/commit/34aabe15585ef7f3ca54a2f85976629dd68680ea) move to config - [`70c5d86`](https://github.com/Mintplex-Labs/anything-llm/commit/70c5d868cc60286582a8ec7c389fdc61d412eb97) Merge branch 'master' into 5461-bug-temperature-deprecated-on-claude-opus-47 ### 📊 Changes **1 file changed** (+26 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `server/utils/AiProviders/bedrock/index.js` (+26 -2) </details> ### 📄 Description ### Pull Request Type - [ ] ✨ feat (New feature) - [x] 🐛 fix (Bug fix) - [ ] ♻️ refactor (Code refactoring without changing behavior) - [ ] 💄 style (UI style changes) - [ ] 🔨 chore (Build, CI, maintenance) - [ ] 📝 docs (Documentation updates) ### Relevant Issues resolves #5461 ### Description AWS Bedrock rejects requests to `anthropic.claude-opus-4-7` when `temperature` is included in `inferenceConfig` — the parameter is deprecated for that model and the call fails validation. This PR introduces a module-level `MODELS_THAT_REJECT_TEMPERATURE` list in `server/utils/AiProviders/bedrock/index.js` and conditionally omits `temperature` from the Converse API payload in both call sites that build it: - `getChatCompletion` (non-streaming) - `streamGetChatCompletion` (streaming) All other Bedrock models continue to receive `temperature ?? this.defaultTemp` exactly as before, so behavior is unchanged outside of the explicitly listed models. The agent-mode Bedrock provider (`server/utils/agents/aibitat/providers/bedrock.js`) never sent `temperature` in the first place, so no changes were needed there. ### Visuals (if applicable) N/A ### Additional Information If Bedrock later adds other models that reject `temperature`, extend the `MODELS_THAT_REJECT_TEMPERATURE` array at the top of `bedrock/index.js` — no other code changes required. ### Developer Validations - [x] I ran \`yarn lint\` from the root of the repo & committed changes - [x] Relevant documentation has been updated (if applicable) - [ ] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 15:21:24 -04:00
yindo closed this issue 2026-06-05 15:21:24 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#5454