Awesome
LLM and AI-Infused Applications with Java and Spring AI
Samples showing how to build Java applications powered by Generative AI and Large Language Models (LLMs) using Spring AI.
Pre-Requisites
- Java 23
- Docker/Podman
Content
0. Use Cases
Project | Description |
---|---|
chatbot | Chatbot using LLMs via Ollama. |
question-answering | Question answering with documents (RAG) using LLMs via Ollama and PGVector. |
semantic-search | Semantic search using LLMs via Ollama and PGVector. |
structured-data-extraction | Structured data extraction using LLMs via Ollama. |
text-classification | Text classification using LLMs via Ollama. |
1. Chat Completion Models
Project | Description |
---|---|
chat-models-mistral-ai | Text generation with LLMs via Mistral AI. |
chat-models-ollama | Text generation with LLMs via Ollama. |
chat-models-openai | Text generation with LLMs via OpenAI. |
chat-models-multiple-providers | Text generation with LLMs via multiple providers. |
2. Prompts, Messages, and Templates and Multimodality
Project | Description |
---|---|
prompts-basics-ollama | Prompting using simple text with LLMs via Ollama. |
prompts-basics-openai | Prompting using simple text with LLMs via OpenAI. |
prompts-messages-ollama | Prompting using structured messages and roles with LLMs via Ollama. |
prompts-messages-openai | Prompting using structured messages and roles with LLMs via OpenAI. |
prompts-templates-ollama | Prompting using templates with LLMs via Ollama. |
prompts-templates-openai | Prompting using templates with LLMs via OpenAI. |
3. Structured Output
Project | Description |
---|---|
structured-output-ollama | Converting the LLM output to structured JSON and Java objects via Ollama. |
structured-output-openai | Converting the LLM output to structured JSON and Java objects via Open AI. |
4. Multimodality
Project | Description |
---|---|
multimodality-ollama | Multimodality to include various media in a prompt with LLMs via Ollama. |
multimodality-openai | Multimodality to include various media in a prompt with LLMs via OpenAI. |
5. Function Calling
Project | Description |
---|---|
function-calling-mistral-ai | Function calling with LLMs via Mistral AI. |
function-calling-ollama | Function calling with LLMs via Ollama. |
function-calling-openai | Function calling with LLMs via OpenAI. |
6. Embedding Models
Project | Description |
---|---|
embedding-models-mistral-ai | Vector transformation (embeddings) with LLMs via Mistral AI. |
embedding-models-ollama | Vector transformation (embeddings) with LLMs via Ollama. |
embedding-models-openai | Vector transformation (embeddings) with LLMs via OpenAI. |
embedding-models-transformers | Vector transformation (embeddings) with LLMs via ONNX Sentence Transformers. |
7. Data Ingestion
Project | Description |
---|---|
document-readers-json-ollama | Reading and vectorizing JSON documents with LLMs via Ollama. |
document-readers-markdown-ollama | Reading and vectorizing Markdown documents with LLMs via Ollama. |
document-readers-pdf-ollama | Reading and vectorizing PDF documents with LLMs via Ollama. |
document-readers-text-ollama | Reading and vectorizing text documents with LLMs via Ollama. |
document-readers-tika-ollama | Reading and vectorizing documents with LLMs and Tika via Ollama. |
document-transformers-metadata-ollama | Enrich documents with keywords and summary metadata for enhanced retrieval via Ollama. |
document-transformers-splitters-ollama | Divide documents into chunks to fit the LLM context window via Ollama. |
8. Vector Stores
Coming soon
9. Retrieval Augmented Generation (RAG)
Project | Description |
---|---|
rag-naive | Basic question answering with documents (RAG) using LLMs via Ollama and PGVector. |
rag-advanced | Advanced question answering with documents (RAG) using LLMs via Ollama and PGVector. |
10. Memory
Coming soon
11. Image Models
Project | Description |
---|---|
image-models-openai | Image generation with LLMs via OpenAI. |
12. Audio Models
Project | Description |
---|---|
audio-models-speech-openai | Speech generation with LLMs via OpenAI. |
audio-models-transcription-openai | Speech transcription with LLMs via OpenAI. |
13. Moderation Models
Coming soon
14. Observability
Project | Description |
---|---|
observability-models-mistral-ai | LLM Observability for Mistral AI. |
observability-models-ollama | LLM Observability for Ollama. |
observability-models-openai | LLM Observability for OpenAI. |
observability-vector-stores-pgvector | Vector Store Observability for PGVector. |
15. Evaluation
Coming soon
16. Agents
Coming soon
References and Additional Resources
Conferences
- Introducing Spring AI by Christian Tzolov and Mark Pollack (Spring I/O 2024)
- Spring AI Is All You Need by Christian Tzolov (GOTO Amsterdam 2024)
- Concerto for Java and AI - Building Production-Ready LLM Applications by Thomas Vitale (Spring I/O 2024)
Videos
- Building Intelligent Applications With Spring AI by Dan Vega (JetBrains Live Stream)
- Spring AI Series by Dan Vega
- Spring AI Series by Craig Walls
- Spring AI Series by Josh Long
Demos
- Airline Customer Support (Marcus Hellberg)
- Composer Assistant (Thomas Vitale)
- Document Assistant (Marcus Hellberg)
- Flight Booking (Christian Tzolov)