Spring / Spring AI interview questions
What AI model providers does Spring AI support?
Spring AI supports a wide set of AI providers out of the box, and the list grows with each release. Providers are included as separate Spring Boot starter dependencies so you only pull in what you need. All of them implement the same ChatModel (and optionally EmbeddingModel, ImageModel) interfaces, meaning swapping one for another is a pom.xml and application.properties change.
| Provider | Chat | Embeddings | Image Generation |
|---|---|---|---|
| OpenAI | ✓ | ✓ | ✓ (DALL-E) |
| Azure OpenAI | ✓ | ✓ | ✓ |
| Anthropic Claude | ✓ | – | – |
| Google Vertex AI / Gemini | ✓ | ✓ | ✓ (Imagen) |
| Amazon Bedrock | ✓ | ✓ | ✓ |
| Mistral AI | ✓ | ✓ | – |
| Ollama (local) | ✓ | ✓ | – |
| HuggingFace | ✓ | ✓ | – |
| Groq | ✓ | – | – |
Ollama is particularly notable for local development — it runs open-source models (Llama 3, Mistral, Phi-3) on your laptop without any API key or network call. This makes offline development and testing straightforward. To switch from OpenAI to Ollama you replace the spring-ai-openai-spring-boot-starter with spring-ai-ollama-spring-boot-starter and update a few properties; no application code needs to change.
More Related questions...