Creating Private AI Applications with Spring AI and GPT OSS

A tutorial for building private AI applications with Spring AI and gpt-oss, using Ollama for OpenAI API-compatible local model access.

Overview

In this article we build a Spring AI app with Ollama’s gpt‑oss, covering chat, memory, vector store, RAG and an immigration advisor.

With the emergence of gpt-oss , we can now expect decent quality even in private AI applications. Let's create a simple AI app with Spring AI once again. The versions we'll use are Spring Boot 3.5 and Spring AI 1.1.

We'll use Ollama as the foundation to utilize gpt-oss with OpenAI API compatibility.

Note that the content of this article can of course be used even for public AI (like OpenAI) applications.

Key Features

  • Ollama installation and server setup
  • gpt-oss model loading for chat
  • Embedding model loading
  • OpenAI API compatibility testing
  • Spring AI app template creation
  • ChatClient for Chat API access
  • HTTP log checking with Logbook

What Can You Use It For?

  • Building a private AI application
  • Learning Spring AI basics step by step
  • Creating an immigration advisor app
  • Running gpt-oss locally via Ollama
  • Testing OpenAI API-compatible endpoints

MCP Integration

No MCP (Model Context Protocol) server is listed for Creating Private AI Applications with Spring AI and GPT OSS yet. When one is available, its URL and setup guide appear here.

Know an official MCP server for Creating Private AI Applications with Spring AI and GPT OSS? Tell us

Affiliate Program

No affiliate program is listed for Creating Private AI Applications with Spring AI and GPT OSS yet. When one is available, its link and terms appear here.

Know an official affiliate program for Creating Private AI Applications with Spring AI and GPT OSS? Tell us

Frequently Asked Questions

The tutorial uses Spring Boot 3.5 and Spring AI 1.1.

Ollama is used as the foundation to utilize gpt-oss with OpenAI API compatibility.

The tutorial finally creates an immigration advisor app for Chronosia, a fictional country.

Alternatives and Related Tools

See More

Cuttlekit is a generative UI toolkit that connects LLMs to a browser so plain-language descriptions produce working interfaces.

Command AI. Automate everything. Run powerful AI workflows with slash commands — one interface, every model, zero friction.