Home

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

Content

0. Use Cases

ProjectDescription
chatbotChatbot using LLMs via Ollama.
question-answeringQuestion answering with documents (RAG) using LLMs via Ollama and PGVector.
semantic-searchSemantic search using LLMs via Ollama and PGVector.
structured-data-extractionStructured data extraction using LLMs via Ollama.
text-classificationText classification using LLMs via Ollama.

1. Chat Completion Models

ProjectDescription
chat-models-mistral-aiText generation with LLMs via Mistral AI.
chat-models-ollamaText generation with LLMs via Ollama.
chat-models-openaiText generation with LLMs via OpenAI.
chat-models-multiple-providersText generation with LLMs via multiple providers.

2. Prompts, Messages, and Templates and Multimodality

ProjectDescription
prompts-basics-ollamaPrompting using simple text with LLMs via Ollama.
prompts-basics-openaiPrompting using simple text with LLMs via OpenAI.
prompts-messages-ollamaPrompting using structured messages and roles with LLMs via Ollama.
prompts-messages-openaiPrompting using structured messages and roles with LLMs via OpenAI.
prompts-templates-ollamaPrompting using templates with LLMs via Ollama.
prompts-templates-openaiPrompting using templates with LLMs via OpenAI.

3. Structured Output

ProjectDescription
structured-output-ollamaConverting the LLM output to structured JSON and Java objects via Ollama.
structured-output-openaiConverting the LLM output to structured JSON and Java objects via Open AI.

4. Multimodality

ProjectDescription
multimodality-ollamaMultimodality to include various media in a prompt with LLMs via Ollama.
multimodality-openaiMultimodality to include various media in a prompt with LLMs via OpenAI.

5. Function Calling

ProjectDescription
function-calling-mistral-aiFunction calling with LLMs via Mistral AI.
function-calling-ollamaFunction calling with LLMs via Ollama.
function-calling-openaiFunction calling with LLMs via OpenAI.

6. Embedding Models

ProjectDescription
embedding-models-mistral-aiVector transformation (embeddings) with LLMs via Mistral AI.
embedding-models-ollamaVector transformation (embeddings) with LLMs via Ollama.
embedding-models-openaiVector transformation (embeddings) with LLMs via OpenAI.
embedding-models-transformersVector transformation (embeddings) with LLMs via ONNX Sentence Transformers.

7. Data Ingestion

ProjectDescription
document-readers-json-ollamaReading and vectorizing JSON documents with LLMs via Ollama.
document-readers-markdown-ollamaReading and vectorizing Markdown documents with LLMs via Ollama.
document-readers-pdf-ollamaReading and vectorizing PDF documents with LLMs via Ollama.
document-readers-text-ollamaReading and vectorizing text documents with LLMs via Ollama.
document-readers-tika-ollamaReading and vectorizing documents with LLMs and Tika via Ollama.
document-transformers-metadata-ollamaEnrich documents with keywords and summary metadata for enhanced retrieval via Ollama.
document-transformers-splitters-ollamaDivide documents into chunks to fit the LLM context window via Ollama.

8. Vector Stores

Coming soon

9. Retrieval Augmented Generation (RAG)

ProjectDescription
rag-naiveBasic question answering with documents (RAG) using LLMs via Ollama and PGVector.
rag-advancedAdvanced question answering with documents (RAG) using LLMs via Ollama and PGVector.

10. Memory

Coming soon

11. Image Models

ProjectDescription
image-models-openaiImage generation with LLMs via OpenAI.

12. Audio Models

ProjectDescription
audio-models-speech-openaiSpeech generation with LLMs via OpenAI.
audio-models-transcription-openaiSpeech transcription with LLMs via OpenAI.

13. Moderation Models

Coming soon

14. Observability

ProjectDescription
observability-models-mistral-aiLLM Observability for Mistral AI.
observability-models-ollamaLLM Observability for Ollama.
observability-models-openaiLLM Observability for OpenAI.
observability-vector-stores-pgvectorVector Store Observability for PGVector.

15. Evaluation

Coming soon

16. Agents

Coming soon

References and Additional Resources

Conferences

Videos

Demos

Workshops