DEV.co
AI Frameworks · ThomasVitale

llm-apps-java-spring-ai

A collection of sample Spring AI applications demonstrating how to build Java-based generative AI systems using LLMs, embeddings, and RAG patterns. Covers chatbots, question-answering, semantic search, and structured data extraction with support for multiple model providers including OpenAI, Ollama, and Mistral AI.

Source: GitHub — github.com/ThomasVitale/llm-apps-java-spring-ai
756
GitHub stars
182
Forks
Java
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
RepositoryThomasVitale/llm-apps-java-spring-ai
OwnerThomasVitale
Primary languageJava
LicenseApache-2.0 — OSI-approved
Stars756
Forks182
Open issues6
Latest releaseUnknown
Last updated2026-07-07
Sourcehttps://github.com/ThomasVitale/llm-apps-java-spring-ai

What llm-apps-java-spring-ai is

Spring AI sample repository providing production-oriented patterns for LLM integration in Java/Spring Boot applications, including chat models, embeddings, multimodal inputs, tool calling, memory management, vector stores (PGVector), and RAG workflows with observability instrumentation.

Quickstart

Get the llm-apps-java-spring-ai source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/ThomasVitale/llm-apps-java-spring-ai.gitcd llm-apps-java-spring-ai# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Learning Spring AI Best Practices

Architects and senior engineers designing LLM-powered Java backends can use this as a reference for patterns, configuration, and integration approaches across multiple providers.

Rapid Prototyping of RAG Systems

Teams building question-answering or semantic search features can fork working examples (Ollama + PGVector) and adapt them, reducing time from concept to proof-of-concept.

Multi-Provider Abstraction Strategy

Organizations evaluating switching between OpenAI, Mistral AI, or Ollama can study the multi-provider examples to design vendor-neutral abstractions in their codebase.

Implementation considerations

  • Requires Java 25; verify team readiness and LTS support timeline before adopting latest Java versions in production.
  • Docker/Podman mandatory for local Ollama execution; ensure container infrastructure is available for development and testing.
  • PGVector setup required for RAG examples; adds PostgreSQL complexity and maintenance overhead; vector store abstraction layer design is critical.
  • Model provider credentials (OpenAI keys, Mistral tokens) must be injected securely via environment/vaults; samples show basic configuration only.
  • Memory patterns (JDBC, Vector Store, Spring Security) have different consistency/performance tradeoffs; choose based on session duration and scalability needs.

When to avoid it — and what to weigh

  • Production Deployment Without Customization — Samples are illustrative; using them verbatim in production risks skipping security hardening, error handling, rate limiting, and authentication logic.
  • Non-Java Tech Stack — Repository is Java/Spring Boot exclusive. Teams using Python, Node.js, or Go should evaluate language-specific alternatives.
  • No Formal SLA or Support Required — This is a community sample repository with no guaranteed support, patch timelines, or maintenance SLA. Teams needing production support should engage Pivotal or VMware.
  • Tightly-Coupled Vendor Lock-in — While multi-provider examples exist, choosing one provider heavily (e.g., OpenAI embedding + Ollama chat) may still create integration debt if provider changes later.

License & commercial use

Licensed under Apache License 2.0 (Apache-2.0), a permissive OSI-approved open-source license permitting commercial use, modification, and distribution with attribution and liability disclaimers.

Apache-2.0 permits commercial deployment of modified code. However, this is a sample repository, not a production framework. Commercial use requires your team to: (1) implement security hardening (auth, secrets, input validation), (2) assume full liability for production behavior, (3) ensure compliance with any third-party LLM provider terms of service, and (4) provide appropriate attribution. Consult legal if integrating into commercial products.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Samples do not appear to implement input validation, rate limiting, or output sanitization. API key handling relies on environment variables (shown in examples); no secrets rotation or vault integration demonstrated. JDBC chat memory and Spring Security memory options introduce session management responsibility. Tool calling could enable prompt injection if inputs are not validated. Review Spring Security integration examples before production use. No mention of data retention, PII handling, or audit logging.

Alternatives to consider

LangChain Python + LangServe

Mature Python ecosystem with stronger community, more examples, built-in observability, and simpler prototyping. Better if Python is your primary language or if you need production-ready multi-LLM workflows immediately.

Amazon Bedrock + Java SDK

Managed service reducing deployment complexity and vendor lock-in to a single major cloud. Better if already on AWS or if you want abstraction without operating your own vector store.

Semantic Kernel (C# / .NET)

Similar multi-provider abstraction and pattern library but for .NET ecosystem. Better if your enterprise standardizes on C# or if you prefer Microsoft/OpenAI alignment.

Software development agency

Build on llm-apps-java-spring-ai with DEV.co software developers

Explore the Spring AI samples, understand the patterns, and consult Devco's AI development team to design secure, production-ready implementations tailored to your infrastructure and compliance needs.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

llm-apps-java-spring-ai FAQ

Can I use these samples directly in production?
Not recommended without significant customization. Samples lack security hardening, error handling, rate limiting, monitoring, and compliance logic. Use them as reference architecture and adapt for your security and operational requirements.
Do I need to pay for Spring AI?
No, Spring AI is open-source and free. However, you pay for LLM usage (OpenAI, Mistral, etc.). Local Ollama is free but requires your own model hosting and compute.
What if I want to switch from OpenAI to Ollama mid-project?
Spring AI abstracts model providers, but embeddings and chat interface compatibility varies. Multi-provider examples show the approach, but test thoroughly and expect minor code adjustments, especially for structured output or tool calling.
Do I need Kubernetes or containers to deploy?
Samples use Docker/Podman. You can run Spring Boot on VMs or serverless (AWS Lambda, Google Cloud Run) but must manage model dependencies (Ollama container or external API calls). Containers simplify DevOps.

Software development & web development with DEV.co

DEV.co helps companies turn open-source tools like llm-apps-java-spring-ai into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your ai frameworks stack.

Ready to Build LLM-Powered Java Applications?

Explore the Spring AI samples, understand the patterns, and consult Devco's AI development team to design secure, production-ready implementations tailored to your infrastructure and compliance needs.