Invoking Amazon Bedrock Models Using the Bedrock Runtime and AWS Lambda
Description
The Amazon Bedrock service includes a runtime that allows you to interact with the Amazon Titan models using APIs. The runtime is designed to be used with AWS Lambda functions, and it abstracts the complexity of invoking models, allowing you to focus on the model's input and output.
In this lab, you will deploy two AWS Lambda functions using AWS Serverless Application Model (AWS SAM) templates. Both functions will use the Amazon Bedrock runtime to interact with the Amazon Titan models. The first function will generate a text response using the Amazon Titan Text Model, and the second function will generate an image response using the Amazon Titan Image Generator Model.
The following AWS and AWS Community content was referenced to create this lab:
- Using Amazon Bedrock to generate images with Titan Image Generator models and AWS Lambda
- Amazon Bedrock Documentation
Learning objectives
Upon completion of this intermediate-level lab, you will be able to:
- Learn the prerequisites and limitations of the Amazon Bedrock runtime
- Deploy a Lambda function that generates a text response using the Amazon Titan Text Model
- Deploy a Lambda function that generates an image using the Amazon Titan Image Generator Model
Intended audience
- Candidates for the AWS Certified Machine Learning Specialty certification
- Cloud Architects
- Software Engineers
Prerequisites
Familiarity with the following will be beneficial but is not required:
- Amazon Bedrock
- AWS Lambda
- Amazon API Gateway
- AWS Serverless Application Model (AWS SAM)
The following content can be used to fulfill the prerequisites: