[PR #2951] [CLOSED] Add AWS credential profile support for AWS Bedrock #4183

Closed
opened 2026-02-22 18:35:18 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/2951
Author: @heiwais25
Created: 1/8/2025
Status: Closed

Base: masterHead: 2864-support-aws-credential-profile


📝 Commits (1)

  • a456ed7 Add AWS credential profile support for AWS Bedrock

📊 Changes

8 files changed (+227 additions, -139 deletions)

View changed files

📝 frontend/src/components/LLMSelection/AwsBedrockLLMOptions/index.jsx (+118 -84)
📝 frontend/src/pages/GeneralSettings/LLMPreference/index.jsx (+1 -6)
📝 server/models/systemSettings.js (+1 -0)
📝 server/utils/AiProviders/bedrock/index.js (+47 -23)
📝 server/utils/agents/aibitat/providers/ai-provider.js (+17 -5)
📝 server/utils/agents/aibitat/providers/bedrock.js (+16 -12)
📝 server/utils/agents/index.js (+20 -8)
📝 server/utils/helpers/updateENV.js (+7 -1)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

Resolves #2864

What is in this change?

Support using AWS Credentials profile to avoid passing the static AWS Access Key and Secret Key manually.
It will also allow the easy integration with using IAM Role when the server is running on AWS EC2.

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated → I'll work on this in separate PR since it can be larger change.
  • I have tested my code functionality
  • Docker build succeeds locally - Ran with each option (IAM, Session, and Profile)

Test Details

  1. Prepare AWS credentials by running aws configure
  2. Add the following configuration to the devcontainer.json.
{
  "mounts": [
    "source=${env:HOME}${env:USERPROFILE}/.aws,target=/root/.aws,type=bind"
  ],
  "remoteUser": "root",
}
  1. Run the server and check the Bedrock invocation with each option.

With the change,

  • IAM Selected
    iam-credentials

  • Profile Selected
    profile-credentials


🔄 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/2951 **Author:** [@heiwais25](https://github.com/heiwais25) **Created:** 1/8/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `2864-support-aws-credential-profile` --- ### 📝 Commits (1) - [`a456ed7`](https://github.com/Mintplex-Labs/anything-llm/commit/a456ed76038c756e290acbb1c74a38c10ccae232) Add AWS credential profile support for AWS Bedrock ### 📊 Changes **8 files changed** (+227 additions, -139 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/LLMSelection/AwsBedrockLLMOptions/index.jsx` (+118 -84) 📝 `frontend/src/pages/GeneralSettings/LLMPreference/index.jsx` (+1 -6) 📝 `server/models/systemSettings.js` (+1 -0) 📝 `server/utils/AiProviders/bedrock/index.js` (+47 -23) 📝 `server/utils/agents/aibitat/providers/ai-provider.js` (+17 -5) 📝 `server/utils/agents/aibitat/providers/bedrock.js` (+16 -12) 📝 `server/utils/agents/index.js` (+20 -8) 📝 `server/utils/helpers/updateENV.js` (+7 -1) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues Resolves #2864 ### What is in this change? Support using AWS Credentials profile to avoid passing the static AWS Access Key and Secret Key manually. It will also allow the easy integration with using IAM Role when the server is running on AWS EC2. ### Additional Information - Lanchain Reference code: https://v03.api.js.langchain.com/classes/_langchain_aws.ChatBedrockConverse.html - https://docs.aws.amazon.com/sdkref/latest/guide/file-format.html ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [ ] Relevant documentation has been updated → I'll work on this in separate PR since it can be larger change. - [x] I have tested my code functionality - [x] Docker build succeeds locally - Ran with each option (IAM, Session, and Profile) **Test Details** 1. Prepare AWS credentials by running `aws configure` 2. Add the following configuration to the devcontainer.json. ```json { "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aws,target=/root/.aws,type=bind" ], "remoteUser": "root", } ``` 3. Run the server and check the Bedrock invocation with each option. With the change, - IAM Selected <img width="745" alt="iam-credentials" src="https://github.com/user-attachments/assets/24164a74-cdc2-4310-b7b4-da8f47e8ad18" /> - Profile Selected <img width="499" alt="profile-credentials" src="https://github.com/user-attachments/assets/bdfe9e0d-b033-4083-aad8-8380d497761b" /> --- <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-02-22 18:35:18 -05:00
yindo closed this issue 2026-02-22 18:35:19 -05:00
yindo changed title from [PR #2951] Add AWS credential profile support for AWS Bedrock to [PR #2951] [CLOSED] Add AWS credential profile support for AWS Bedrock 2026-06-05 15:17:15 -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#4183