anything-llm
anything-llm copied to clipboard
Add AWS credential profile support for AWS Bedrock
Pull Request Type
- [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
- [x] I ran
yarn lintfrom 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
- Prepare AWS credentials by running
aws configure - Add the following configuration to the devcontainer.json.
{
"mounts": [
"source=${env:HOME}${env:USERPROFILE}/.aws,target=/root/.aws,type=bind"
],
"remoteUser": "root",
}
- Run the server and check the Bedrock invocation with each option.
With the change,
-
IAM Selected
-
Profile Selected