This repository contains pre-built examples to help customers get started with the Amazon Bedrock service.
- Introduction to Bedrock - Learn the basics of the Bedrock service
- Prompt Engineering - Tips for crafting effective prompts
- Bedrock Fine-tuning - Fine-tune Bedrock models for your specific use case
- Generative AI Solutions - Example use cases for generative AI
- Knowledge Bases - Build knowledge bases with Bedrock
- Retrival Augmented Generation (RAG) - Implementing RAG with Amazon Bedrock
- Agents - Generative AI agents with Bedrock
- Security and Governance - Secure your Bedrock applications
- Responsible AI - Use Bedrock responsibly and ethically
- Operational Tooling - Helpful samples to help operationalize your useage of Amazon Bedrock
- Multimodal - Working with multimodal data using Amazon Bedrock
To get started with the code examples, ensure you have access to Amazon Bedrock. Then clone this repo and navigate to one of the folders above. Detailed instructions are provided in each folder's README.
The AWS identity you assume from your environment (which is the Studio/notebook Execution Role from SageMaker, or could be a role or IAM User for self-managed notebooks or other use-cases), must have sufficient AWS IAM permissions to call the Amazon Bedrock service.
To grant Bedrock access to your identity, you can:
- Open the AWS IAM Console
- Find your Role (if using SageMaker or otherwise assuming an IAM Role), or else User
- Select Add Permissions > Create Inline Policy to attach new inline permissions, open the JSON editor and paste in the below example policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BedrockFullAccess",
"Effect": "Allow",
"Action": ["bedrock:*"],
"Resource": "*"
}
]
}
⚠️ Note: With Amazon SageMaker, your notebook execution role will typically be separate from the user or role that you log in to the AWS Console with. If you'd like to explore the AWS Console for Amazon Bedrock, you'll need to grant permissions to your Console user/role too.
For more information on the fine-grained action and resource permissions in Bedrock, check out the Bedrock Developer Guide.
We welcome community contributions! Please see CONTRIBUTING.md for guidelines.
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.