Spring AI for Java Developers: Guides and Production Lessons

Spring AI brings LLM calls into ordinary Spring Boot code, and the hard parts show up at runtime: streaming to slow clients, context that drifts between calls, and token costs nobody planned for. These guides cover hands-on setup and the production pitfalls we hit.

All articles on this page are also collected in a Medium list you can save and follow.

Start here

Production pitfalls

Hands-on tutorials

Perspective

Frequently asked questions

What are Spring AI advisors?

Advisors intercept ChatClient requests and responses, so you can add conversation memory, retrieved context, logging or guardrails without changing every call site. See Spring AI Advisors Failed When Context Drifted.

How do you stream Spring AI responses in Spring Boot?

ChatClient’s stream() returns a reactive Flux that you can expose as Server-Sent Events. Plan for clients that read slowly or disconnect, so the server does not keep generating tokens nobody receives.

Can Spring AI use a local model?

Yes. Spring AI supports Ollama, so you can run an open model locally in Docker and call it through the same ChatClient API.

New articles are published on Medium first. Subscribe to the newsletter to get production lessons by email.