AWS Bedrock with Spring AI: Moving from Local Models to the Cloud A developer's guide demonstrates how to integrate AWS Bedrock with Spring AI, moving from local model inference to managed cloud-based AI. The article explains the architectural shift, configuration steps, and the benefits of using Spring AI's abstractions for provider-agnostic development. In the previous parts of this series, we explored how to build AI-powered applications with Spring AI and run models locally. Local inference is great for experimentation, development, privacy-focused use cases, and understanding how LLM applications work. But production AI systems often need more. They need access to powerful foundation models, managed infrastructure, scalability, reliability, and the ability to switch between models without managing GPU servers yourself. This is where AWS Bedrock comes in. In this article, we'll explore how to integrate AWS Bedrock with Spring AI and move from local AI inference to a managed cloud-based architecture. AWS Bedrock is a fully managed AWS service that provides access to foundation models from multiple AI providers through AWS infrastructure. Instead of downloading and running a model locally, your application sends requests to AWS Bedrock. The architecture changes from this: Spring Boot Application ↓ Spring AI ↓ Local Model Runtime Ollama / Local LLM To this: Spring Boot Application ↓ Spring AI ↓ AWS Bedrock API ↓ Foundation Model Your application no longer needs to manage the underlying AI infrastructure. AWS handles the model hosting, scaling, availability, and infrastructure required to run inference. Local models are incredibly useful, but they come with limitations. For example: AWS Bedrock solves many of these infrastructure challenges. With Bedrock, you can focus more on your application instead of managing model servers. Your architecture becomes more like this: Client ↓ Spring Boot API ↓ Spring AI ↓ AWS Bedrock ↓ Foundation Model This makes it easier to build cloud-native AI applications. Spring AI provides abstractions for working with different AI providers. Your application interacts with high-level APIs such as ChatClient instead of manually writing HTTP requests for every model provider. For example: String response = chatClient.prompt .user "Explain AWS Bedrock in simple terms" .call .content ; The application code can remain relatively similar even when the underlying AI provider changes. For example, you might start with: Spring AI → Ollama → Local Model And later move to: Spring AI → AWS Bedrock → Cloud Model This abstraction is one of the major advantages of using Spring AI. Your business logic should ideally depend on AI capabilities rather than being tightly coupled to a specific provider. Before your Spring Boot application can communicate with AWS Bedrock, you need access to AWS and the required permissions. At a high level, the process looks like this: AWS Account ↓ Enable Model Access ↓ Configure IAM Permissions ↓ Configure AWS Region ↓ Spring Boot Application ↓ Spring AI + AWS Bedrock The exact models available can vary depending on your AWS region and account configuration. You also need appropriate AWS credentials and permissions for invoking models. For local development, credentials can be provided through the AWS credential provider chain, environment variables, profiles, or other supported AWS authentication mechanisms. A typical environment configuration might look like this: AWS ACCESS KEY ID=your-access-key AWS SECRET ACCESS KEY=your-secret-key AWS REGION=your-region However, in production, avoid hardcoding credentials in your application configuration. Prefer IAM roles and managed identity mechanisms whenever possible. Spring AI provides integrations for AWS Bedrock models. The dependency you use depends on the specific Spring AI version and Bedrock model integration you want to work with. For example, your Maven configuration may include a Spring AI AWS Bedrock starter: