Files
spring-ai/models/spring-ai-bedrock

Bedrock AI Chat and Embedding Clients

Amazon Bedrock is a managed service that provides foundation models from various AI providers, available through a unified API.

Spring AI implements API clients for the Bedrock models along with implementations for the ChatClient, StreamingChatClient and the EmbeddingClient.

The API clients provide structured, type-safe implementation for the Bedrock models, while the ChatClient, StreamingChatClient and the EmbeddingClient implementations provide Chat and Embedding clients compliant with the Spring-AI API. Later can be used interchangeably with the other (e.g. OpenAI, Azure OpenAI, Ollama) model clients.

Also Spring-AI provides Spring Auto-Configurations and Boot Starters for all clients, making it easy to bootstrap and configure for the Bedrocks models.

Prerequisite

  • AWS credentials.

    If you dont have AWS account and AWS Cli configured yet then this video guide can help you to configure it: AWS CLI & SDK Setup in Less Than 4 Minutes!. You should be able to obtain your access and security keys.

  • Enable Bedrock models to use

    Go to Amazon Bedrock and from the Model Access menu on the left configure the access to the models you are going to use.

User guides

Amazon Bedrock Overview