This sample repository has sample code to integrate AWS Lambda with Amazon Bedrock.
AWS Services used:
The following Lambda Language Runtimes are supported:
Language | Runtime Version | AWS SDK Version |
---|---|---|
.NET | v6.0 | 3.7.201.5 |
Java | v17 | 2.20.157 |
NodeJS | v18 | 3.428.0 |
Python | v3.11 | 1.28.57 |
Warning This application is not ready for production use. It was written for demonstration and educational purposes. Review the Security section of this README and consult with your security team before deploying this stack. No warranty is implied in this example.
- AWS SAM CLI
- Python 3 installed to build and deploy using AWS SAM
- Language specific runtimes for local testing
Clone this repository:
git clone git@github.com:ParnabBasak/lambda-bedrock-integration.git
This application can be used with a variety of LLMs via Amazon Bedrock. See Supported models in Amazon Bedrock for a complete list.
By default, this application uses Anthropic Claude v2 to generate responses. You can change that to other Amazon Bedrock supported FMs.
Important Before you can use these models with this application, you must request access in the Amazon Bedrock console. See the Model access section of the Bedrock User Guide for detailed instructions. By default, this application is configured to use Amazon Bedrock in the supported Region. Make sure you request model access in that Region (this does not have to be the same Region that you deploy this stack to).
The respective named sub directories have the detailed instructions to deploy the AWS SAM application. Navigate to your preferred language runtime and follow the instructions there.
cd ~/<Your Preferred Language Runtime>/lambda-bedrock-app/
This library is licensed under the MIT-0 License. See the LICENSE file.