AWS Lambda and Amazon Bedrock Response Streaming with Rust

AWS Lambda → Amazon Bedrock

Create a Lambda function URL that streams a response from an Amazon Bedrock LLM.

This pattern exposes a public Lambda Function URL (FURL) endpoint where requests can be made.
When a request is made to the FURL, the Lambda function initiates a streaming request to Amazon Bedrock
using the ConverseStream API. This allows the response from the LLM in Bedrock to start streaming back
to the Lambda function as soon as generation begins, without waiting for the entire response to be ready.

< 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-rust-cdk

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk destroy.

Created by:

Phil Callister

Phil Callister

I'm an Enterprise Solutions Architect at AWS, with a focus on Financial Services. As a passionate builder, I enjoy helping customers create innovative solutions to achieve their business objectives.

Follow on LinkedIn