DEV Community

Alkademy
Alkademy

Posted on • Originally published at munonye.com

Run Local LLMs with Ollama + Spring Boot REST API (2026)

Canonical URL: Republished from munonye.com. Full code on GitHub.

This Ollama Spring Boot tutorial runs local LLMs with no OpenAI bill — ideal for development and air-gapped environments. Part of AI Developer Tutorials.

Install Ollama

curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.2
ollama serve
Enter fullscreen mode Exit fullscreen mode

Spring configuration

Replace OpenAI starter with:

<dependency>
  <groupId>org.springframework.ai</groupId>
  <artifactId>spring-ai-ollama-spring-boot-starter</artifactId>
</dependency>
Enter fullscreen mode Exit fullscreen mode
spring.ai.ollama.base-url=http://localhost:11434
spring.ai.ollama.chat.options.model=llama3.2
Enter fullscreen mode Exit fullscreen mode

Your M7-A ChatController works unchanged.

Next: Angular signals for chat state (M10-B)


Full tutorial: Run Local LLMs with Ollama + Spring Boot REST API (2026)

Kindson MunonyeGitHub · LinkedIn · About

Top comments (0)