Spring AI with Docker Model Ru... Note
Spring

Spring AI with Docker Model Runner

Eddú Meléndez highlights Docker's release of Model Runner in Docker Desktop for Mac, offering a local Inference API compatible with the OpenAI API. This allows seamless integration with Spring AI, especially with the 1.0.0-M7 release. Models are distributed as OCI artifacts on Docker Hub under the ai namespace. Two options are provided for enabling the Model Runner, either directly or using Testcontainers. Required dependencies include Spring Web, OpenAI starter, and Testcontainers. Configuration involves setting the OpenAI client endpoint to point to the Model Runner. A chat controller example demonstrates basic interaction with the model through HTTP endpoints. Tool calling functionality is supported, illustrated with a stock price retrieval example. The post provides references to official documentation and a sample project. Docker Model Runner enables faster iteration, local development, and efficient AI application building. Future Testcontainers integration promises further simplified model management and testing.