[KongchangAI]
· 2 min read· 1,199 words

DeepSeek + Spring AI in Practice: Building an Offline AI Family Doctor App from Scratch

DeepSeek + Spring AI in Practice: Building an Offline AI Family Doctor App from Scratch

Build an offline AI family doctor app with DeepSeek, Ollama, and Spring AI in a Java backend project.

This Bilibili hands-on course uses an offline AI medical assistant as its project vehicle, teaching how to locally deploy the DeepSeek model via Ollama, integrate it into a Spring Boot 3 application using Spring AI, and persist conversation data with MySQL. The offline approach addresses healthcare data privacy compliance, while Spring AI's abstraction layer significantly reduces the engineering complexity of integrating local models for Java developers. The course uses a backend-only approach, making it accessible to Java developers without frontend experience, covering model deployment, role customization via System Prompts, and application scaffolding.

Why Build an Offline AI Medical Application

Local deployment of large language models has become a hot topic in the developer community, but most people's experimentation still stops at testing and tinkering — few are actually mining its commercial value. This hands-on course from Bilibili creator "芬杰影院" takes a more pragmatic direction: building an offline AI family doctor application using DeepSeekAd paired with Spring AI.

The value of offline deployment goes beyond just "running without an internet connection." It directly addresses data security and privacy concerns — in a medical context, conversation data never leaves the local machine, eliminating the need to upload anything to the cloud. It also opens up new possibilities for regions and industries with limited network access. For healthcare, where data compliance requirements are exceptionally strict, local deployment fits the industry's pain points perfectly.

Project overview flow diagram

One of the core ideas the course emphasizes is this: don't limit yourself to building a single feature in isolation. Instead, think about problems from both a business architecture and a technical architecture perspective. In other words, the goal isn't just to learn "how to call a model" — it's how to take an AI capability and turn it into a fully runnable, maintainable application.

Tech Stack and Core Tools

The entire project revolves around several key technical components, forming a fairly complete technology chain for local AI applications:

  • Ollama: Local deployment tool for pulling and running the DeepSeek model
  • DeepSeek reasoning model: The core intelligence of the application, handling inference tasks
  • Spring Boot 3 + Spring AI: Bridges the local model with Java code and provides the overall application framework
  • MySQL: Persistent storage for conversation data

Beyond the core stack, the course also covers a set of practical auxiliary tools, including the browser UI plugin Page Assist, the desktop client Chatbox AI, and Cherry Studio. These tools let you quickly validate model behavior before writing any code — they're standard companions for the local deployment phase.

Spring Boot and Spring AI architecture

The technology version choices are worth noting — the project is built on OpenJDK 21 and Maven, keeping pace with mainstream trends in the Java ecosystem. For developers who want to put "hands-on experience with local LLM applications" on their resume, this tech combination offers both novelty and credibility for enterprise deployment.

Spring AI is Spring's official AI integration framework, playing a role similar to LangChain in the Python ecosystem — but designed for Java/Spring developers. It abstracts away the API differences between various AI providers (OpenAI, Anthropic, Ollama, etc.) through a unified interface, so developers write against a single API and switching underlying models requires minimal changes. For this project, Spring AI's core value lies in its native support for Ollama as a local model backend — meaning development patterns originally designed for cloud-based LLMs can be transplanted to local deployment scenarios with almost no modification. Spring AI also includes built-in components like ChatMemory and Prompt Templates, eliminating a large amount of repetitive boilerplate code.

Ollama is currently one of the most popular local LLM runtimes — think of it as "Docker for local models." It packages models into a standard format and provides a unified REST API, so developers don't need to worry about CUDA drivers, quantization formats, or other low-level details. A single command is all it takes to pull and run mainstream open-source models like DeepSeek, Llama, and Qwen.

Core Feature Breakdown

The course breaks the family doctor application into several progressively layered functional modules:

Local Model Deployment and Role Customization

The first step is getting the DeepSeek model running via Ollama, then using Ollama's scripting and API capabilities to customize the model's role — essentially "conditioning" a general-purpose LLM into a family doctor persona focused on medical Q&A. This step defines the application's personality and response style.

In the LLM world, "role customization" is fundamentally about using a System Prompt to constrain the model's behavioral boundaries and response style. Ollama provides a Modelfile mechanism that lets developers pre-embed system prompts, set inference parameters like temperature, and bake these configurations into a new derived model. Compared to passing a system prompt dynamically with each request, this approach has two advantages: it reduces repetitive configuration at the application layer, and it allows you to preview and test the role directly in the Ollama management interface at a lower validation cost. In a medical context, system prompts typically need to explicitly limit the model to "only answer health-related questions" and "not substitute for professional medical diagnosis" — requirements that serve both functional needs and legal risk mitigation.

Building the Application Skeleton with Spring Boot + Spring AI

Through the Spring AI abstraction layer, the locally running model is integrated into a standard Spring Boot application. This is the most critical engineering step in the entire project — where model capability is formally transformed into a service that business logic can call.

Conversation Data Persistence

All chat history between the user and the AI is written to a MySQL database. For a medical assistant, retaining past consultation records is both a functional requirement and a data foundation for improving model performance down the line.

Step-by-step deployment walkthrough

The entire project uses a backend-only development approach, with no frontend work involved. This tradeoff is actually quite smart — it allows Java developers without frontend experience to complete the full workflow and keeps the focus squarely on model integration and backend architecture.

Who Is This For, and What Prerequisites Do You Need?

This course is positioned at the beginner-to-intermediate level, but it's not zero-barrier. According to the author, you'll ideally have the following going in:

  • Some Java background, with basic familiarity with Spring, MyBatis, and Spring Boot
  • Familiarity with MySQL and relational databases
  • Basic command-line and scripting skills (the deployment phase uses the terminal)

Even if you're shaky on some of these, the course promises to walk you through writing backend code, installing middleware, and completing server deployment step by step. The overall pace is incremental — each module is taught and then immediately practiced, with features built up iteratively. A complete project source code package is also included, making it easy to understand the architectural design in detail.

Skills you'll gain from the course

A Realistic Take

From a content positioning standpoint, this is a typical "technical training course" pitch — heavy on selling points like career competitiveness, professional advancement, and landing a job at a top tech company. These claims deserve some skepticism. Knowing how to build a local LLM application end-to-end is genuinely valuable, but equating it directly to "getting into a big tech company" or "becoming a software architect" is clearly marketing language.

Setting aside the promotional rhetoric, the technical choices here are solid: the DeepSeek + Ollama + Spring AI combination represents the mainstream path for Java developers integrating local LLMs today, and the family doctor scenario is specific enough to work well as an end-to-end practice project. For developers looking to level up from "calling an API" to "shipping a complete AI application," this kind of hands-on project is a worthwhile path to take.

#DeepSeek Spring AI#Ollama local deployment#Spring Boot AI application#offline AI medical assistant#local LLM Java#Spring AI tutorial#DeepSeek Java integration
Share:

Related articles