{"id":25874794,"url":"https://github.com/ThomasVitale/llm-apps-java-spring-ai","last_synced_at":"2025-03-02T09:29:46.835Z","repository":{"id":217209890,"uuid":"743107776","full_name":"ThomasVitale/llm-apps-java-spring-ai","owner":"ThomasVitale","description":"Samples showing how to build Java applications powered by Generative AI and LLMs using Spring AI and Spring Boot.","archived":false,"fork":false,"pushed_at":"2025-02-15T09:13:52.000Z","size":1242,"stargazers_count":436,"open_issues_count":2,"forks_count":81,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-02-24T10:12:10.574Z","etag":null,"topics":["embeddings","generative-ai","large-language-models","llm","ollama","openai","rag","spring-ai"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThomasVitale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-14T11:04:15.000Z","updated_at":"2025-02-24T07:07:18.000Z","dependencies_parsed_at":"2024-02-08T14:48:08.555Z","dependency_job_id":"e1374e84-9f2d-40ba-96ad-abeee647f2d4","html_url":"https://github.com/ThomasVitale/llm-apps-java-spring-ai","commit_stats":{"total_commits":99,"total_committers":1,"mean_commits":99.0,"dds":0.0,"last_synced_commit":"5a023cda129918617dffa609232fd96168210a1f"},"previous_names":["thomasvitale/llm-apps-java-spring-ai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasVitale%2Fllm-apps-java-spring-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasVitale%2Fllm-apps-java-spring-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasVitale%2Fllm-apps-java-spring-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasVitale%2Fllm-apps-java-spring-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThomasVitale","download_url":"https://codeload.github.com/ThomasVitale/llm-apps-java-spring-ai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241486186,"owners_count":19970625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embeddings","generative-ai","large-language-models","llm","ollama","openai","rag","spring-ai"],"created_at":"2025-03-02T09:29:44.983Z","updated_at":"2025-03-02T09:29:46.828Z","avatar_url":"https://github.com/ThomasVitale.png","language":"Java","readme":"# LLM and AI-Infused Applications with Java \u0026 Spring AI\n\nSamples showing how to build Java applications powered by Generative AI and Large Language Models (LLMs) using [Spring AI](https://docs.spring.io/spring-ai/reference/).\n\n## 🛠️ Pre-Requisites\n\n* Java 23\n* Podman/Docker\n\n## 💡 Use Cases\n\n* 🤖 **[Chatbot](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/use-cases/chatbot)**\n  Chatbot using LLMs via Ollama.\n\n* ❓ **[Question Answering](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/use-cases/question-answering)**\n  Question answering with documents (RAG) using LLMs via Ollama and PGVector.\n\n* 🔍 **[Semantic Search](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/use-cases/semantic-search)**\n  Semantic search using LLMs via Ollama and PGVector.\n\n* 📊 **[Structured Data Extraction](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/use-cases/structured-data-extraction)**  \n  Structured data extraction using LLMs via Ollama.\n\n* 🏷️ **[Text Classification](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/use-cases/text-classification)**\n  Text classification using LLMs via Ollama.\n\n## 🧠 Models\n\n### 💬 Chat Models\n\nChat completion with LLMs via different model providers:\n\n* **[Mistral AI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/models/chat/chat-mistral-ai)**\n* **[Ollama](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/models/chat/chat-ollama)**\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/models/chat/chat-openai)**\n* **[Multiple Providers](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/models/chat/chat-multiple-providers)**\n\n### 🔤 Embedding Models\n\nVector transformation (embeddings) with LLMs via different model providers:\n\n* **[Mistral AI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/models/embedding/embedding-mistral-ai)**\n* **[Ollama](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/models/embedding/embedding-ollama)**\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/models/embedding/embedding-openai)**\n* **[ONNX Transformers](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/models/embedding/embedding-transformers)**\n\n### 🎨 Image Models\n\nImage generation with LLMs via different model providers:\n\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/models/image/image-openai)**\n\n### 🎵 Audio Models\n\nSpeech generation with LLMs via different model providers:\n\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/models/audio/speech-to-text-openai)**\n\nSpeech transcription with LLMs via different model providers:\n\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/models/audio/text-to-speech-openai)**\n\n### 🛡️ Moderation Models\n\n_Coming soon_\n\n## 📐 Patterns\n\n### 📝 Prompts, Messages, and Templates\n\nPrompting using simple text:\n\n* **[Ollama](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/prompts/prompts-basics-ollama)**\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/prompts/prompts-basics-openai)**\n\nPrompting using structured messages and roles:\n\n* **[Ollama](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/prompts/prompts-messages-ollama)**\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/prompts/prompts-messages-openai)**\n\nPrompting using templates:\n\n* **[Ollama](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/prompts/prompts-templates-ollama)**\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/prompts/prompts-templates-openai)**\n\n### 📊 Structured Output\n\nConverting LLM output to structured JSON and Java objects:\n\n* **[Ollama](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/structured-output/structured-output-ollama)**\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/structured-output/structured-output-openai)**\n\n### 🎯 Multimodality\n\nIncluding various media in prompts with LLMs:\n\n* **[Mistral AI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/multimodality/multimodality-mistral-ai)**\n* **[Ollama](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/multimodality/multimodality-ollama)**\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/multimodality/multimodality-openai)**\n\n### ⚙️ Tool Calling\n\nTool calling with LLMs via different model providers:\n\n* **[Mistral AI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/tool-calling/tool-calling-mistral-ai)**\n* **[Ollama](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/tool-calling/tool-calling-ollama)**\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/patterns/tool-calling/tool-calling-openai)**\n\n### 🧠 Memory\n\n_Coming soon_\n\n## 📥 Data Ingestion\n\n### 📚 Document Readers\n\nReading and vectorizing documents with LLMs via Ollama:\n\n* **[JSON](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/data-ingestion/document-readers/document-readers-json-ollama)**\n* **[Markdown](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/data-ingestion/document-readers/document-readers-markdown-ollama)**\n* **[PDF](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/data-ingestion/document-readers/document-readers-text-ollama)**\n* **[Text](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/data-ingestion/document-readers/document-readers-text-ollama)**\n* **[Tika](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/data-ingestion/document-readers/document-readers-tika-ollama)**\n\n### 🔄 Document Transformers\n\nDocument transformation with LLMs via Ollama:\n\n* **[Metadata](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/data-ingestion/document-transformers/document-transformers-metadata-ollama)**  \n  Enrich documents with keywords and summary metadata for enhanced retrieval.\n* **[Splitters](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/data-ingestion/document-transformers/document-transformers-splitters-ollama)**  \n  Divide documents into chunks to fit the LLM context window.\n\n## 🔢 Vector Stores\n\n_Coming soon_\n\n## 🔄 Retrieval Augmented Generation (RAG)\n\nQuestion answering with documents using different RAG flows (with Ollama and PGVector):\n\n### ➡️ Sequential RAG\n\n* **[Naive](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/rag/rag-sequential/rag-naive)**\n* **[Advanced](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/rag/rag-sequential/rag-advanced)**\n\n### 🌳 Branching RAG\n\n* **[Branching](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/rag/rag-branching)**\n\n## 📊 Observability\n\n### 🧠 LLM Observability\n\nLLM Observability for different model providers:\n\n* **[Mistral AI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/observability/observability-models-mistral-ai)**\n* **[Ollama](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/observability/observability-models-ollama)**\n* **[OpenAI](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/observability/observability-models-openai)**\n\n### 🔢 Vector Store Observability\n\nVector Store Observability for different vector stores:\n\n* **[PGVector](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/observability/observability-vector-stores-pgvector)**\n\n## ⚙️ Model Context Protocol\n\nIntegrations with MCP Servers for providing contexts to LLMs.\n\n* **[Brave Search API](https://github.com/ThomasVitale/llm-apps-java-spring-ai/tree/main/mcp/mcp-clients/mcp-brave)**\n\n## 📋 Evaluation\n\n_Coming soon_\n\n## 🤖 Agents\n\n_Coming soon_\n\n## 📚 References and Additional Resources\n\n* [Spring AI Reference Documentation](https://docs.spring.io/spring-ai/reference/index.html)\n\n### 🎤 Conferences\n\n* [Introducing Spring AI by Christian Tzolov and Mark Pollack (Spring I/O 2024)](https://www.youtube.com/watch?v=umKbaXsiCOY)\n* [Spring AI Is All You Need by Christian Tzolov (GOTO Amsterdam 2024)](https://www.youtube.com/watch?v=vuhMti8B5H0)\n* [Concerto for Java and AI - Building Production-Ready LLM Applications by Thomas Vitale (GOTO Copenhagen 2024)](https://www.youtube.com/watch?v=la4kc57F6jU)\n\n### 🎥 Videos\n\n* [Building Intelligent Applications With Spring AI by Dan Vega (JetBrains Live Stream)](https://www.youtube.com/watch?v=x6KmUyPWy2Q)\n* [Spring AI Series by Dan Vega](https://www.youtube.com/playlist?list=PLZV0a2jwt22uoDm3LNDFvN6i2cAVU_HTH)\n* [Spring AI Series by Craig Walls](https://www.youtube.com/playlist?list=PLH5OU4wXVJc9aECkMUVPCi8g3pzs8pZ3E)\n* [Spring AI Series by Josh Long](https://www.youtube.com/playlist?list=PLgGXSWYM2FpMXvYb681axdH5JSLEPPyrz)\n\n### 🎮 Demos\n\n* [Airline Customer Support (Marcus Hellberg)](https://github.com/marcushellberg/java-ai-playground/tree/spring-ai)\n* [Composer Assistant (Thomas Vitale)](https://github.com/ThomasVitale/concerto-for-java-and-ai)\n* [Document Assistant (Marcus Hellberg)](https://github.com/marcushellberg/docs-assistant)\n* [Flight Booking (Christian Tzolov)](https://github.com/tzolov/playground-flight-booking)\n\n### 📚 Workshops\n\n* [Spring AI - Zero to Hero (Adib Saikali, Christian Tzolov)](https://github.com/asaikali/spring-ai-zero-to-hero/tree/main)\n* [AI Applications with Java and Spring AI (Thomas Vitale)](https://github.com/ThomasVitale/java-ai-workshop)\n","funding_links":[],"categories":["Code \u0026 Examples"],"sub_categories":["Comprehensive Example Collections","Code Examples"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FThomasVitale%2Fllm-apps-java-spring-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FThomasVitale%2Fllm-apps-java-spring-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FThomasVitale%2Fllm-apps-java-spring-ai/lists"}