<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/spring-ai-tutorial-03---chat-with-ollama-ysighwswe" -->

---
title: Spring AI Tutorial : 03 - Chat with Ollama | daily.dev
description: A walkthrough of using Ollama, a tool for running LLMs locally, with a Spring Boot application via Spring AI. It covers installing Ollama, pulling models like...
canonical: https://daily.dev/posts/spring-ai-tutorial-03---chat-with-ollama-ysighwswe
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Spring AI Tutorial : 03 - Chat with Ollama | daily.dev
og:description: A walkthrough of using Ollama, a tool for running LLMs locally, with a Spring Boot application via Spring AI. It covers installing Ollama, pulling models like...
og:url: https://daily.dev/posts/spring-ai-tutorial-03---chat-with-ollama-ysighwswe
og:image: https://api.daily.dev/og/posts/YsiGhWSWE.png
og:image:alt: Spring AI Tutorial : 03 - Chat with Ollama
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Spring AI Tutorial : 03 - Chat with Ollama

**[SivaLabs \(YouTube\)](https://daily.dev/sources/sivalabs-youtube)** · 8 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of using Ollama, a tool for running LLMs locally, with a Spring Boot application via Spring AI. It covers installing Ollama, pulling models like Qwen 3 and GPT-OSS, chatting via the GUI and CLI, and then swapping the OpenAI starter dependency for the Ollama starter in a Spring AI project. The demo shows that no application code changes are needed—only the dependency and configuration change—since Spring AI provides a higher-level abstraction over different model providers. The video also notes that local models lag behind OpenAI or Anthropic in quality but are free and useful for learning, and previews the next episode covering Anthropic model integration.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=HLiZfHuiwsQ>

## Questions this post answers

### How do I switch a Spring AI application from OpenAI to a local Ollama model?

Replace the OpenAI starter dependency with the Ollama starter dependency (available via Spring Initializer) and update configuration to specify the local model name instead of an API key and base URL, since Ollama runs locally and needs no API key. The chat client code, controller, and API endpoint remain unchanged, because Spring AI abstracts the provider differences.

_Developers weighing local versus cloud LLM providers can find more Spring AI integration walkthroughs on daily.dev._

### Do local Ollama models perform as well as OpenAI or Anthropic models for coding tasks?

Local Ollama models such as Qwen 3 are not as capable as OpenAI or Anthropic models, but they are good enough to get started with and let developers experiment and learn without spending money, since all inference happens locally on the machine.

_Anyone deciding between local and hosted LLMs for coding tasks can track more comparisons on daily.dev._

## Similar posts on daily.dev

- [Integrating LLMs with Ollama and Spring AI](https://daily.dev/posts/integrating-llms-with-ollama-and-spring-ai-ftjw4akn6) · codecentric · 0 upvotes · 0 comments
- [Build Your Own Private, Self-Hosted AI Applications with Ollama & Laravel](https://daily.dev/posts/build-your-own-private-self-hosted-ai-applications-with-ollama-laravel-wwjzhlkid) · Tighten · 1 upvotes · 0 comments
- [Run a Local AI Model with Ollama in 15 Minutes](https://daily.dev/posts/run-a-local-ai-model-with-ollama-in-15-minutes-5wx17jt3x) · Machine Learning Mastery · 1 upvotes · 0 comments
- [Spring AI tutorial: Get started with Spring AI](https://daily.dev/posts/spring-ai-tutorial-get-started-with-spring-ai-phjfbwkwg) · InfoWorld · 0 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#java](https://daily.dev/tags/java), [#spring-boot](https://daily.dev/tags/spring-boot), [#ollama](https://daily.dev/tags/ollama), [#spring-ai](https://daily.dev/tags/spring-ai)

[View this post on daily.dev](https://daily.dev/posts/spring-ai-tutorial-03---chat-with-ollama-ysighwswe)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Spring AI Tutorial : 03 - Chat with Ollama","url":"https://daily.dev/posts/spring-ai-tutorial-03---chat-with-ollama-ysighwswe","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/spring-ai-tutorial-03---chat-with-ollama-ysighwswe"},"datePublished":"2026-09-27T07:26:42.322Z","dateModified":"2026-09-27T09:14:11.095Z","description":"A walkthrough of using Ollama, a tool for running LLMs locally, with a Spring Boot application via Spring AI. It covers installing Ollama, pulling models like...","image":"https://i.ytimg.com/vi/HLiZfHuiwsQ/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/HLiZfHuiwsQ/sddefault.jpg","isAccessibleForFree":true,"articleSection":"SivaLabs (YouTube)","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"SivaLabs (YouTube)","logo":"https://media.daily.dev/image/upload/s--8ATVo4an--/f_auto,q_auto/v1790493987/logos/sivalabs-youtube?_a=BAMAMicg0","url":"https://daily.dev/sources/sivalabs-youtube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/spring-ai-tutorial-03---chat-with-ollama-ysighwswe","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,java,spring-boot,ollama,spring-ai","timeRequired":"PT8M","video":{"@type":"VideoObject","name":"Spring AI Tutorial : 03 - Chat with Ollama","description":"A walkthrough of using Ollama, a tool for running LLMs locally, with a Spring Boot application via Spring AI. It covers installing Ollama, pulling models like...","thumbnailUrl":"https://i.ytimg.com/vi/HLiZfHuiwsQ/sddefault.jpg","uploadDate":"2026-09-27T07:26:42.322Z","duration":"PT8M","url":"https://api.daily.dev/r/YsiGhWSWE","embedUrl":"https://www.youtube.com/embed/HLiZfHuiwsQ"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"SivaLabs (YouTube)","item":"https://daily.dev/sources/sivalabs-youtube"},{"@type":"ListItem","position":3,"name":"Spring AI Tutorial : 03 - Chat with Ollama"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/spring-ai-tutorial-03---chat-with-ollama-ysighwswe#faq","mainEntity":[{"@type":"Question","name":"How do I switch a Spring AI application from OpenAI to a local Ollama model?","acceptedAnswer":{"@type":"Answer","text":"Replace the OpenAI starter dependency with the Ollama starter dependency (available via Spring Initializer) and update configuration to specify the local model name instead of an API key and base URL, since Ollama runs locally and needs no API key. The chat client code, controller, and API endpoint remain unchanged, because Spring AI abstracts the provider differences. Developers weighing local versus cloud LLM providers can find more Spring AI integration walkthroughs on daily.dev."}},{"@type":"Question","name":"Do local Ollama models perform as well as OpenAI or Anthropic models for coding tasks?","acceptedAnswer":{"@type":"Answer","text":"Local Ollama models such as Qwen 3 are not as capable as OpenAI or Anthropic models, but they are good enough to get started with and let developers experiment and learn without spending money, since all inference happens locally on the machine. Anyone deciding between local and hosted LLMs for coding tasks can track more comparisons on daily.dev."}}]}
```

