Status: [UNTESTED] Endpoints found: http://localhost:8080/ai/chat?message=Hello%20from%20Spring%20AI http://localhost:8080/ai/chat http://localhost:8080/ai/chat/stream?message=Tell%20me%20a%20short%20story http://localhost:8080/ai/chat/stream http://localhost:8080/ai/chat/memory?sessionId=$SESSION&message=My%20name%20is%20Tiago Source: https://github.com/tiagouzl/spring-ai-ollama-demo # Spring AI + Ollama Demo · with Spring AI Alibaba (DashScope) ![Java](https://img.shields.io/badge/Java-21-ED8B00?logo=openjdk&logoColor=white) ![Spring Boot](https://img.shields.io/badge/Spring_Boot-3.4-6DB33F?logo=spring&logoColor=white) ![Ollama](https://img.shields.io/badge/Ollama-granite4.1:3b-000000) [![Build](https://img.shields.io/github/actions/workflow/status/tiagouzl/spring-ai-ollama-demo/ci.yml?branch=main&label=CI)](https://github.com/tiagouzl/spring-ai-ollama-demo/actions) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) A Spring Boot 3 application that integrates Spring AI with a local LLM served by Ollama — and optionally with Alibaba DashScope (Qwen) via Spring AI Alibaba — fully offline by default, cloud-ready when you set `DASHSCOPE_API_KEY`. It started as a small demo to get `ChatClient` running against a local model and kept growing one feature at a time — streaming, memory, tools, RAG, then a security/observability pass once the happy-path stuff worked. If you want the blow-by-blow of what changed and why, `ANALISE.md` has every round documented. --- ## Highlights Spring Boot 3.4 + Spring AI 1.0.1 + Spring AI Alibaba 1.0.0.4, built around the fluent `ChatClient` API. Runs 100% local and free by default via Ollama — no API key needed — and flips to Alibaba DashScope (Qwen) when `DASHSCOPE_API_KEY` is set, with automatic fallback to Ollama when it isn't. Endpoints cover the usual patterns: streaming (SSE via `ChatClient.stream()`), multi-turn chat with per-conversation memory, function calling / tool use with `@Tool`, structured (typed) output via `ChatClient.entity()`, and RAG with `SimpleVectorStore` + `TokenTextSplitter` chunking + `nomic-embed-text` embeddings — no external vector DB required. On the operational side: Bean Validation on all POST bodies, structured `ApiError` responses that never leak internals, explicit HTTP timeouts on the Ollama client, Actuator + Prometheus observability, JDBC-