AWS Lambda with Amazon Bedrock response streaming

AWS Lambda → Amazon Bedrock

Create a Lambda function that invokes a Bedrock model with response streaming.

This sample project demonstrates how to write a Lambda function that exposes a function URL, uses the Bedrock InvokeModelWithResponseStreamCommand API, and streams the response back to the API client.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-bedrock-response-streaming

Deploy

sam deploy -g


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

sam delete

Created by:

Heeki Park

Heeki Park

Heeki Park is a Principal Solutions Architect at AWS and has been helping customers build serverless and cloud-native applications since joining AWS in 2016.

Follow on LinkedIn