{"id":39130137,"url":"https://github.com/shortthirdman/springai-multillm-integration","last_synced_at":"2026-01-17T21:16:07.908Z","repository":{"id":315296130,"uuid":"1058886870","full_name":"shortthirdman/springai-multillm-integration","owner":"shortthirdman","description":"Spring AI Multi-LLM Integration - Gemini, OpenAI, Ollama","archived":false,"fork":false,"pushed_at":"2025-09-17T18:47:27.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-17T20:58:06.487Z","etag":null,"topics":["spring-ai-anthropic-claude","spring-ai-gemini","spring-ai-ollama","spring-ai-openai","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shortthirdman.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-17T17:24:16.000Z","updated_at":"2025-09-17T18:47:30.000Z","dependencies_parsed_at":"2025-09-17T20:58:15.058Z","dependency_job_id":"6ffaa83e-852f-4398-be86-e4b9b863b6ee","html_url":"https://github.com/shortthirdman/springai-multillm-integration","commit_stats":null,"previous_names":["shortthirdman/springai-multillm-integration"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/shortthirdman/springai-multillm-integration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shortthirdman%2Fspringai-multillm-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shortthirdman%2Fspringai-multillm-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shortthirdman%2Fspringai-multillm-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shortthirdman%2Fspringai-multillm-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shortthirdman","download_url":"https://codeload.github.com/shortthirdman/springai-multillm-integration/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shortthirdman%2Fspringai-multillm-integration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28518617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T18:55:29.170Z","status":"ssl_error","status_checked_at":"2026-01-17T18:55:03.375Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["spring-ai-anthropic-claude","spring-ai-gemini","spring-ai-ollama","spring-ai-openai","spring-boot"],"created_at":"2026-01-17T21:16:06.865Z","updated_at":"2026-01-17T21:16:07.901Z","avatar_url":"https://github.com/shortthirdman.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring AI Multi-LLM Integration\n\n\n---\n\n### Reference Documentation\nFor further reference, please consider the following sections:\n\n* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)\n* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.5.5/maven-plugin)\n* [Create an OCI image](https://docs.spring.io/spring-boot/3.5.5/maven-plugin/build-image.html)\n* [GraalVM Native Image Support](https://docs.spring.io/spring-boot/3.5.5/reference/packaging/native-image/introducing-graalvm-native-images.html)\n* [Spring Boot DevTools](https://docs.spring.io/spring-boot/3.5.5/reference/using/devtools.html)\n* [Spring Configuration Processor](https://docs.spring.io/spring-boot/3.5.5/specification/configuration-metadata/annotation-processor.html)\n* [Spring Web](https://docs.spring.io/spring-boot/3.5.5/reference/web/servlet.html)\n* [Ollama](https://docs.spring.io/spring-ai/reference/api/chat/ollama-chat.html)\n* [OpenAI](https://docs.spring.io/spring-ai/reference/api/chat/openai-chat.html)\n\n---\n\n### Guides\nThe following guides illustrate how to use some features concretely:\n\n* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)\n* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)\n* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)\n\n---\n\n### Additional Links\nThese additional references should also help you:\n\n* [Configure AOT settings in Build Plugin](https://docs.spring.io/spring-boot/3.5.5/how-to/aot.html)\n\n---\n\n## GraalVM Native Support\n\nThis project has been configured to let you generate either a lightweight container or a native executable.\nIt is also possible to run your tests in a native image.\n\n---\n\n### Lightweight Container with Cloud Native Buildpacks\nIf you're already familiar with Spring Boot container images support, this is the easiest way to get started.\nDocker should be installed and configured on your machine prior to creating the image.\n\nMake sure to set your environment variables:\n\n```shell\nexport OPENAI_API_KEY=\"your-openai-api-key\"\nexport GEMINI_API_KEY=\"your-gemini-api-key\"\nexport ANTHROPIC_API_KEY=\"your-anthropic-api-key\"\nexport MISTRAL_API_KEY=\"your-mistral-api-key\"\n```\n\nTo create the image, run the following goal:\n\n```\n$ ./mvnw spring-boot:build-image -Pnative\n```\n\nThen, you can run the app like any other container:\n\n```\n$ docker run --rm -p 8080:8080 multillm-integration:0.0.1-SNAPSHOT\n```\n\n---\n\n### Executable with Native Build Tools\nUse this option if you want to explore more options such as running your tests in a native image.\nThe GraalVM `native-image` compiler should be installed and configured on your machine.\n\nNOTE: GraalVM 22.3+ is required.\n\nTo create the executable, run the following goal:\n\n```\n$ ./mvnw native:compile -Pnative\n```\n\nThen, you can run the app as follows:\n```\n$ target/multillm-integration\n```\n\nYou can also run your existing tests suite in a native image.\nThis is an efficient way to validate the compatibility of your application.\n\nTo run your existing tests in a native image, run the following goal:\n\n```\n$ ./mvnw test -PnativeTest\n```\n\n---\n\n### Maven Parent overrides\n\nDue to Maven's design, elements are inherited from the parent POM to the project POM.\nWhile most of the inheritance is fine, it also inherits unwanted elements like `\u003clicense\u003e` and `\u003cdevelopers\u003e` from the parent.\nTo prevent this, the project POM contains empty overrides for these elements.\nIf you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.\n\n---\n\n### References\n\n- [Integrate Multiple LLMs with Spring AI: OpenAI, Ollama and Gemini](https://medium.com/javarevisited/integrate-multiple-llms-with-spring-ai-openai-ollama-and-gemini-40d382136ce1)\n\n---\n\n### Testing OpenAI\n\n```http request\nhttp GET localhost:8100/chat \\\n  message==\"What model are you? Please provide your name, version, and key capabilities.\" \\\n  llm==openai\n```\n\n**_Expected Sample Response_**\n\n```json\n{\n    \"llm\": \"openai\",\n    \"originalMessage\": \"What model are you? Please provide your name, version, and key capabilities.\",\n    \"response\": \"I am ChatGPT, based on the GPT-4 architecture developed by OpenAI. My version includes improvements in understanding and generating human-like text, enabling me to assist with a wide range of tasks such as answering questions, providing explanations, composing creative writing, and more. I can understand context, handle complex prompts, and generate coherent and relevant responses across various topics.\",\n    \"timestamp\": 1753268746222\n}\n\n```\n\n---\n\n### Testing Ollama\n\n```http request\nhttp GET localhost:8100/chat \\\n  message==\"What model are you? Please tell me your name, version, and what you're good at.\" \\\n  llm==ollama\n```\n\n**_Expected Sample Response_**\n\n```json\n{\n    \"llm\": \"ollama\",\n    \"originalMessage\": \"What model are you? Please tell me your name, version, and what you're good at.\",\n    \"response\": \" I am a model of the Chat Model developed by Mistral AI. My primary function is to assist with various tasks by providing information, answering questions, and engaging in conversation. I strive to provide precise, helpful, and courteous responses.\\n\\nWhile I don't have a personal name, you can think of me as your digital assistant designed to make your interactions more enjoyable and productive. My capabilities include but are not limited to: answering questions, providing explanations, discussing a wide range of topics, assisting with scheduling and organization, offering recommendations, and much more.\\n\\nIn terms of my version, I am part of the latest generation of models, continually learning and improving from the data it encounters during interactions like this one.\",\n    \"timestamp\": 1753268772790\n}\n```\n\n---\n\n### Testing Gemini\n\n```http request\nhttp GET localhost:8100/chat \\\n  message==\"Please identify yourself. What model are you, what version, and what are your strengths?\" \\\n  llm==gemini\n```\n\n**_Expected Sample Response_**\n\n```json\n{\n    \"llm\": \"gemini\",\n    \"originalMessage\": \"Please identify yourself. What model are you, what version, and what are your strengths?\",\n    \"response\": \"I am a large language model, trained by Google.\\n\\n**Model \u0026 Version:**\\nUnlike traditional software with specific version numbers, large language models like me are continuously updated and refined. There isn't a single, publicly accessible \\\"version number\\\" in the way you might think of software like....\",\n    \"timestamp\": 1753268800297\n}\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshortthirdman%2Fspringai-multillm-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshortthirdman%2Fspringai-multillm-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshortthirdman%2Fspringai-multillm-integration/lists"}