{"id":25089655,"url":"https://github.com/piomin/spring-ai-showcase","last_synced_at":"2025-04-15T19:40:53.792Z","repository":{"id":274607407,"uuid":"923466543","full_name":"piomin/spring-ai-showcase","owner":"piomin","description":"Sample Spring AI Application with several use cases","archived":false,"fork":false,"pushed_at":"2025-03-25T16:22:23.000Z","size":4138,"stargazers_count":25,"open_issues_count":0,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T00:51:51.644Z","etag":null,"topics":["llm","mistral-ai","multimodal-large-language-models","multimodality","ollama","openai","pinecone","rag","retrieval-augmented-generation","spring-ai","spring-boot","stock-api","vector-store"],"latest_commit_sha":null,"homepage":"https://piotrminkowski.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/piomin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-01-28T09:50:38.000Z","updated_at":"2025-03-28T04:43:59.000Z","dependencies_parsed_at":"2025-02-21T10:26:59.221Z","dependency_job_id":"54e78219-da62-4a70-b62b-4be18f87769b","html_url":"https://github.com/piomin/spring-ai-showcase","commit_stats":null,"previous_names":["piomin/spring-ai-showcase"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piomin%2Fspring-ai-showcase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piomin%2Fspring-ai-showcase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piomin%2Fspring-ai-showcase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piomin%2Fspring-ai-showcase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piomin","download_url":"https://codeload.github.com/piomin/spring-ai-showcase/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249140325,"owners_count":21219273,"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":["llm","mistral-ai","multimodal-large-language-models","multimodality","ollama","openai","pinecone","rag","retrieval-augmented-generation","spring-ai","spring-boot","stock-api","vector-store"],"created_at":"2025-02-07T11:18:19.005Z","updated_at":"2025-04-15T19:40:53.786Z","avatar_url":"https://github.com/piomin.png","language":"Java","funding_links":[],"categories":["Code \u0026 Examples"],"sub_categories":["Comprehensive Example Collections"],"readme":"# Spring AI Showcase Demo Project [![Twitter](https://img.shields.io/twitter/follow/piotr_minkowski.svg?style=social\u0026logo=twitter\u0026label=Follow%20Me)](https://twitter.com/piotr_minkowski)\n\n[![CircleCI](https://circleci.com/gh/piomin/spring-ai-showcase.svg?style=svg)](https://circleci.com/gh/piomin/spring-ai-showcase)\n\n[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-black.svg)](https://sonarcloud.io/dashboard?id=piomin_spring-ai-showcase)\n[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=piomin_spring-ai-showcase\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=piomin_spring-ai-showcase)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=piomin_spring-ai-showcase\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=piomin_spring-ai-showcase)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=piomin_spring-ai-showcase\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=piomin_spring-ai-showcase)\n\nThis project demonstrates the integration of AI capabilities within a Spring Boot application, utilizing the [Spring AI](https://github.com/spring-projects/spring-ai) framework.\n\n-----\n\n## Table of Contents\n\n- [Architecture](#architecture)\n- [Running the Application](#running-the-application)\n- [Articles](#articles)\n\n## Architecture\n\nCurrently, there are four `@RestController`s that show Spring AI features:\n\n`pl.piomin.services.controller.PersonController` - prompt template, chat memory, and structured output based on a simple example that asks AI model to generate some persons\n\n`pl.piomin.services.controller.WalletController` - function calling that calculates a value of our wallet stored in local database in conjunction with the latest stock prices\n\n`pl.piomin.services.controller.StockController` - RAG with a Pinecone vector store and OpenAI based on stock prices API\n\n`pl.piomin.services.controller.ImageController` - image model and multimodality\n\nThe architecture is designed to be modular and scalable, focusing on demonstrating how AI features can be incorporated into Spring-based applications.\n\n## Running the Application\n\nFollow these steps to run the application locally. \n```bash\ngit clone https://github.com/piomin/spring-ai-showcase.git\ncd spring-ai-showcase\n```\n\nBy default, this sample Spring AI app connects to OpenAI. So, before running the app you must set a token:\n```shell\nexport OPEN_AI_TOKEN=\u003cYOUR_API_TOKEN\u003e\nmvn spring-boot:run\n```\n\nTo enable integration with Mistral, we should activate the `mistral-ai` profile: \n```shell\nexport MISTRAL_AI_TOKEN=\u003cYOUR_API_TOKEN\u003e\nmvn spring-boot:run -Pmistral-ai\n```\n\nTo enable integration with Ollama, we should activate the `ollama-ai` profile:\n```shell\nmvn spring-boot:run -Pollama-ai\n```\n\nBefore that, we must run the model on Ollama, e.g.:\n```shell\nollama run llava\n```\n\nTo enable integration with Azure OpenAI, we should activate the `azure-ai` profile and activate the Spring Boot `azure-ai` profile:\n```shell\nmvn spring-boot:run -Pazure-ai -Dspring-boot.run.profiles=azure-ai\n```\n\nYou should also export the Azure OpenAI credentials:\n```shell\nexport AZURE_OPENAI_API_KEY=\u003cYOUR_AZURE_OPENAI_API_KEY\u003e\n```\n\nFor scenarios with a vector store (`StockController`, `ImageController`) you need to export the following ENV:\n```shell\nexport PINECONE_TOKEN=\u003cYOUR_PINECONE_TOKEN\u003e\n```\n\nFor scenarios with a stock API (`StockController`, `WalletController`) you need to export the following ENV:\n```shell\nexport STOCK_API_KEY=\u003cYOUR_STOCK_API_KEY\u003e\n```\n\nMore details in the articles.\n\n# Articles\n1. Getting started with Spring AI **Chat Model** and easily switch between different AI providers including **OpenAI**, **Mistral AI** and **Ollama**. The example is available in the branch [master](https://github.com/piomin/spring-ai-showcase/tree/master). A detailed guide may be found in the following article: [Getting Started with Spring AI and Chat Model](https://piotrminkowski.com/2025/01/28/getting-started-with-spring-ai-and-chat-model)\n2. Getting started with Spring AI **Function Calling** for OpenAI chat models. The example is available in the branch [master](https://github.com/piomin/spring-ai-showcase/tree/master). A detailed guide may be found in the following article: [Getting Started with Spring AI Function Calling](https://piotrminkowski.com/2025/01/30/getting-started-with-spring-ai-function-calling)\n3. Using **RAG** (Retrieval Augmented Generation) and **Vector Store** with Spring AI. The example is available in the branch [master](https://github.com/piomin/spring-ai-showcase/tree/master). A detailed guide may be found in the following article: [Using RAG and Vector Store with Spring AI](https://piotrminkowski.com/2025/02/24/using-rag-and-vector-store-with-spring-ai/)\n4. Using **Multimodality** feature and **Image Model** with Spring AI and OpenAI. The example is available in the branch [master](https://github.com/piomin/spring-ai-showcase/tree/master). A detailed guide may be found in the following article: [Spring AI with Multimodality and Images](https://piotrminkowski.com/2025/03/04/spring-ai-with-multimodality-and-images/)\n5. Running multiple models with **Ollama** and integration through Spring AI. The example is available in the branch [master](https://github.com/piomin/spring-ai-showcase/tree/master). A detailed guide may be found in the following article: [Using Ollama with Spring AI](https://piotrminkowski.com/2025/03/10/using-ollama-with-spring-ai/)\n6. Getting started with Spring AI **Tool Calling** for OpenAI/MistralAI chat models. The example is available in the branch [master](https://github.com/piomin/spring-ai-showcase/tree/master). A detailed guide may be found in the following article: [Tool Calling with Spring AI](https://piotrminkowski.com/2025/03/13/tool-calling-with-spring-ai/)\n7. Integrate Spring AI with **Azure OpenAI** for chat models, image generation, tool calling and RAG. The example is available in the branch [master](https://github.com/piomin/spring-ai-showcase/tree/master). A detailed guide may be found in the following article: [Spring AI with Azure OpenAI](https://piotrminkowski.com/2025/03/25/spring-ai-with-azure-openai/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiomin%2Fspring-ai-showcase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiomin%2Fspring-ai-showcase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiomin%2Fspring-ai-showcase/lists"}