{"id":14964698,"url":"https://github.com/ollama4j/ollama4j","last_synced_at":"2025-04-08T11:07:30.786Z","repository":{"id":203826045,"uuid":"710475189","full_name":"ollama4j/ollama4j","owner":"ollama4j","description":"A simple Java library for interacting with Ollama server.","archived":false,"fork":false,"pushed_at":"2025-03-25T17:01:08.000Z","size":1485,"stargazers_count":359,"open_issues_count":5,"forks_count":57,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-01T10:06:51.550Z","etag":null,"topics":["gen-ai","genai","generative-ai","gpt","java","language-model","large-language-models","llama","llama2","llama3","llm","meta-llama","ollama"],"latest_commit_sha":null,"homepage":"https://ollama4j.github.io/ollama4j","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/ollama4j.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-10-26T19:12:14.000Z","updated_at":"2025-03-31T17:19:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d1561ba-887d-4e7d-bb02-9ce107ae6f90","html_url":"https://github.com/ollama4j/ollama4j","commit_stats":{"total_commits":569,"total_committers":14,"mean_commits":"40.642857142857146","dds":0.5289982425307558,"last_synced_commit":"fffc8dc5266f99ab9996e61029dfda02ec5a1c41"},"previous_names":["amithkoujalgi/ollama4j","ollama4j/ollama4j"],"tags_count":100,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollama4j%2Follama4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollama4j%2Follama4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollama4j%2Follama4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollama4j%2Follama4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ollama4j","download_url":"https://codeload.github.com/ollama4j/ollama4j/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247813079,"owners_count":21000431,"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":["gen-ai","genai","generative-ai","gpt","java","language-model","large-language-models","llama","llama2","llama3","llm","meta-llama","ollama"],"created_at":"2024-09-24T13:33:39.758Z","updated_at":"2025-04-08T11:07:30.759Z","avatar_url":"https://github.com/ollama4j.png","language":"Java","funding_links":["https://www.buymeacoffee.com/amithkoujalgi"],"categories":["人工智能"],"sub_categories":[],"readme":"### Ollama4j\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src='https://raw.githubusercontent.com/ollama4j/ollama4j/65a9d526150da8fcd98e2af6a164f055572bf722/ollama4j.jpeg' width='100' alt=\"ollama4j-icon\"\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\nA Java library (wrapper/binding) for Ollama server.\n\nFind more details on the [website](https://ollama4j.github.io/ollama4j/).\n\n![GitHub stars](https://img.shields.io/github/stars/ollama4j/ollama4j)\n![GitHub forks](https://img.shields.io/github/forks/ollama4j/ollama4j)\n![GitHub watchers](https://img.shields.io/github/watchers/ollama4j/ollama4j)\n![Contributors](https://img.shields.io/github/contributors/ollama4j/ollama4j?style=social)\n![GitHub License](https://img.shields.io/github/license/ollama4j/ollama4j)\n\n\n[//]: # (![GitHub repo size]\u0026#40;https://img.shields.io/github/repo-size/ollama4j/ollama4j\u0026#41;)\n\n[//]: # (![GitHub top language]\u0026#40;https://img.shields.io/github/languages/top/ollama4j/ollama4j\u0026#41;)\n\n\n[//]: # (![JitPack Downloads This Month Badge]\u0026#40;https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.ollama4j%2Follama4j\u0026query=%24.month\u0026label=JitPack%20Downloads%20-%20This%20Month\u0026#41;)\n\n[//]: # (![JitPack Downloads This Week Badge]\u0026#40;https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fjitpack.io%2Fapi%2Fdownloads%2Fio.github.ollama4j%2Follama4j\u0026query=%24.week\u0026label=JitPack%20Downloads%20-%20This%20Week\u0026#41;)\n\n[//]: # (![JitPack Downloads Per Month Badge]\u0026#40;https://jitpack.io/v/ollama4j/ollama4j/month.svg\u0026#41;)\n\n[//]: # (![GitHub Downloads \u0026#40;all assets, all releases\u0026#41;]\u0026#40;https://img.shields.io/github/downloads/ollama4j/ollama4j/total?label=GitHub%20Package%20Downloads\u0026#41;)\n\n![GitHub last commit](https://img.shields.io/github/last-commit/ollama4j/ollama4j?color=green)\n[![codecov](https://codecov.io/gh/ollama4j/ollama4j/graph/badge.svg?token=U0TE7BGP8L)](https://codecov.io/gh/ollama4j/ollama4j)\n\n[![Run Unit and Integration Tests](https://github.com/ollama4j/ollama4j/actions/workflows/run-tests.yml/badge.svg)](https://github.com/ollama4j/ollama4j/actions/workflows/run-tests.yml)\n![Build Status](https://github.com/ollama4j/ollama4j/actions/workflows/maven-publish.yml/badge.svg)\n\n\n\u003c/div\u003e\n\n[//]: # (![Hits]\u0026#40;https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Follama4j%2Follama4j\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=hits\u0026edge_flat=false\u0026#41;)\n\n[//]: # (![GitHub language count]\u0026#40;https://img.shields.io/github/languages/count/ollama4j/ollama4j\u0026#41;)\n\n## Table of Contents\n\n- [How does it work?](#how-does-it-work)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [API Spec](https://ollama4j.github.io/ollama4j/category/apis---model-management)\n- [Examples](#examples)\n- [Javadoc](https://ollama4j.github.io/ollama4j/apidocs/)\n- [Development](#development)\n- [Contributions](#get-involved)\n- [References](#references)\n\n#### How does it work?\n\n```mermaid\n  flowchart LR\n    o4j[Ollama4j]\n    o[Ollama Server]\n    o4j --\u003e|Communicates with| o;\n    m[Models]\n    subgraph Ollama Deployment\n        direction TB\n        o --\u003e|Manages| m\n    end\n```\n\n#### Requirements\n\n![Java](https://img.shields.io/badge/Java-11_+-green.svg?style=for-the-badge\u0026labelColor=gray\u0026label=Java\u0026color=orange)\n\n\n\u003ca href=\"https://ollama.com/\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/v0.3.0-green.svg?style=for-the-badge\u0026labelColor=gray\u0026label=Ollama\u0026color=blue\" alt=\"\"/\u003e\n\u003c/a\u003e\n\n## Installation\n\n\u003e [!NOTE]\n\u003e We are now publishing the artifacts to both Maven Central and GitHub package repositories.\n\u003e\n\u003e Track the releases [here](https://github.com/ollama4j/ollama4j/releases) and update the dependency version\n\u003e according to your requirements.\n\n### For Maven\n\n#### Using [Maven Central](https://central.sonatype.com/)\n\n[![][ollama4j-mvn-releases-shield]][ollama4j-mvn-releases-link]\n\n[ollama4j-mvn-releases-link]: https://central.sonatype.com/artifact/io.github.ollama4j/ollama4j/overview\n\n[ollama4j-mvn-releases-shield]: https://img.shields.io/maven-central/v/io.github.ollama4j/ollama4j?display_name=release\u0026style=for-the-badge\u0026label=From%20Maven%20Central\n\nIn your Maven project, add this dependency:\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.ollama4j\u003c/groupId\u003e\n    \u003cartifactId\u003eollama4j\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.93\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Using GitHub's Maven Package Repository\n\n[![][ollama4j-releases-shield]][ollama4j-releases-link]\n\n[ollama4j-releases-link]: https://github.com/ollama4j/ollama4j/releases\n\n[ollama4j-releases-shield]: https://img.shields.io/github/v/release/ollama4j/ollama4j?display_name=release\u0026style=for-the-badge\u0026label=From%20GitHub%20Packages\n\n1. Add `GitHub Maven Packages` repository to your project's `pom.xml` or your `settings.xml`:\n\n```xml\n\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003egithub\u003c/id\u003e\n        \u003cname\u003eGitHub Apache Maven Packages\u003c/name\u003e\n        \u003curl\u003ehttps://maven.pkg.github.com/ollama4j/ollama4j\u003c/url\u003e\n        \u003creleases\u003e\n            \u003cenabled\u003etrue\u003c/enabled\u003e\n        \u003c/releases\u003e\n        \u003csnapshots\u003e\n            \u003cenabled\u003etrue\u003c/enabled\u003e\n        \u003c/snapshots\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\n2. Add `GitHub` server to settings.xml. (Usually available at ~/.m2/settings.xml)\n\n```xml\n\n\u003csettings xmlns=\"http://maven.apache.org/SETTINGS/1.0.0\"\n          xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n          xsi:schemaLocation=\"http://maven.apache.org/SETTINGS/1.0.0\n                      http://maven.apache.org/xsd/settings-1.0.0.xsd\"\u003e\n    \u003cservers\u003e\n        \u003cserver\u003e\n            \u003cid\u003egithub\u003c/id\u003e\n            \u003cusername\u003eYOUR-USERNAME\u003c/username\u003e\n            \u003cpassword\u003eYOUR-TOKEN\u003c/password\u003e\n        \u003c/server\u003e\n    \u003c/servers\u003e\n\u003c/settings\u003e\n```\n\n3. In your Maven project, add this dependency:\n\n```xml\n\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.ollama4j\u003c/groupId\u003e\n    \u003cartifactId\u003eollama4j\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.93\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### For Gradle\n\n1. Add the dependency\n\n```groovy\ndependencies {\n    implementation 'io.github.ollama4j:ollama4j:1.0.93'\n}\n```\n\n[//]: # (Latest release:)\n\n[//]: # ()\n\n[//]: # (![Maven Central]\u0026#40;https://img.shields.io/maven-central/v/io.github.ollama4j/ollama4j\u0026#41;)\n\n[//]: # ()\n\n[//]: # ([![][lib-shield]][lib])\n\n[lib]: https://central.sonatype.com/artifact/io.github.ollama4j/ollama4j\n\n[lib-shield]: https://img.shields.io/badge/ollama4j-get_latest_version-blue.svg?style=just-the-message\u0026labelColor=gray\n\n#### API Spec\n\n\u003e [!TIP]\n\u003e Find the full API specifications on the [website](https://ollama4j.github.io/ollama4j/).\n\n### Development\n\nMake sure you have `pre-commit` installed.\n\nWith `brew`:\n\n```shell\nbrew install pre-commit\n```\n\nWith `pip`:\n\n```shell\npip install pre-commit\n```\n\n#### Setup dev environment\n\n\u003e **Note**\n\u003e If you're on Windows, install [Chocolatey Package Manager for Windows](https://chocolatey.org/install) and then install `make` by running `choco install make`. Just a little tip - run the command with administrator privileges if installation faiils.\n\n```shell\nmake dev\n```\n\n#### Build\n\n```shell\nmake build\n```\n\n#### Run unit tests\n\n```shell\nmake unit-tests\n```\n\n#### Run integration tests\n\nMake sure you have Docker running as this uses [testcontainers](https://testcontainers.com/) to run the integration\ntests on Ollama Docker container.\n\n```shell\nmake integration-tests\n```\n\n### Releases\n\nNewer artifacts are published via GitHub Actions CI workflow when a new release is created from `main` branch.\n\n## Examples\n\nThe `ollama4j-examples` repository contains examples for using the Ollama4j library. You can explore\nit [here](https://github.com/ollama4j/ollama4j-examples).\n\n## ⭐ Give us a Star!\n\nIf you like or are using this project to build your own, please give us a star. It's a free way to show your support.\n\n## Who's using Ollama4j?\n\n| #  | Project Name      | Description                                                                                                                                                        | Link                                                                                                                                                                                          |\n|----|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 1  | Datafaker         | A library to generate fake data                                                                                                                                    | [GitHub](https://github.com/datafaker-net/datafaker-experimental/tree/main/ollama-api)                                                                                                        |\n| 2  | Vaadin Web UI     | UI-Tester for interactions with Ollama via ollama4j                                                                                                                | [GitHub](https://github.com/TEAMPB/ollama4j-vaadin-ui)                                                                                                                                        |\n| 3  | ollama-translator | A Minecraft 1.20.6 Spigot plugin that translates all messages into a specific target language via Ollama                                                           | [GitHub](https://github.com/liebki/ollama-translator)                                                                                                                                         |\n| 4  | AI Player         | A Minecraft mod that adds an intelligent \"second player\" to the game                                                                                               | [Website](https://modrinth.com/mod/ai-player), [GitHub](https://github.com/shasankp000/AI-Player), \u003cbr/\u003e [Reddit Thread](https://www.reddit.com/r/fabricmc/comments/1e65x5s/comment/ldr2vcf/) |\n| 5  | Ollama4j Web UI   | A web UI for Ollama written in Java using Spring Boot, Vaadin, and Ollama4j                                                                                        | [GitHub](https://github.com/ollama4j/ollama4j-web-ui)                                                                                                                                         |\n| 6  | JnsCLI            | A command-line tool for Jenkins that manages jobs, builds, and configurations, with AI-powered error analysis                                                      | [GitHub](https://github.com/mirum8/jnscli)                                                                                                                                                    |\n| 7  | Katie Backend     | An open-source AI-based question-answering platform for accessing private domain knowledge                                                                         | [GitHub](https://github.com/wyona/katie-backend)                                                                                                                                              |\n| 8  | TeleLlama3 Bot    | A question-answering Telegram bot                                                                                                                                  | [Repo](https://git.hiast.edu.sy/mohamadbashar.disoki/telellama3-bot)                                                                                                                          |\n| 9  | moqui-wechat      | A moqui-wechat component                                                                                                                                           | [GitHub](https://github.com/heguangyong/moqui-wechat)                                                                                                                                         |\n| 10 | B4X               | A set of simple and powerful RAD tool for Desktop and Server development                                                                                           | [Website](https://www.b4x.com/android/forum/threads/ollama4j-library-pnd_ollama4j-your-local-offline-llm-like-chatgpt.165003/)                                                                |\n| 11 | Research Article  | Article: `Large language model based mutations in genetic improvement` - published on National Library of Medicine (National Center for Biotechnology Information) | [Website](https://pmc.ncbi.nlm.nih.gov/articles/PMC11750896/)                                                                                                                                 |\n\n## Traction\n\n[![Star History Chart](https://api.star-history.com/svg?repos=ollama4j/ollama4j\u0026type=Date)](https://star-history.com/#ollama4j/ollama4j\u0026Date)\n\n## Get Involved\n\n\u003cdiv align=\"center\"\u003e\n\n\u003ca href=\"\"\u003e![Open Issues](https://img.shields.io/github/issues-raw/ollama4j/ollama4j)\u003c/a\u003e\n\u003ca href=\"\"\u003e![Closed Issues](https://img.shields.io/github/issues-closed-raw/ollama4j/ollama4j)\u003c/a\u003e\n\u003ca href=\"\"\u003e![Open PRs](https://img.shields.io/github/issues-pr-raw/ollama4j/ollama4j)\u003c/a\u003e\n\u003ca href=\"\"\u003e![Closed PRs](https://img.shields.io/github/issues-pr-closed-raw/ollama4j/ollama4j)\u003c/a\u003e\n\u003ca href=\"\"\u003e![Discussions](https://img.shields.io/github/discussions/ollama4j/ollama4j)\u003c/a\u003e\n\n\u003c/div\u003e\n\n\n[//]: # (![GitHub Issues or Pull Requests]\u0026#40;https://img.shields.io/github/issues-raw/ollama4j/ollama4j\u0026#41;)\n\n[//]: # (![GitHub Issues or Pull Requests]\u0026#40;https://img.shields.io/github/issues-closed-raw/ollama4j/ollama4j\u0026#41;)\n\n[//]: # (![GitHub Issues or Pull Requests]\u0026#40;https://img.shields.io/github/issues-pr-raw/ollama4j/ollama4j\u0026#41;)\n\n[//]: # (![GitHub Issues or Pull Requests]\u0026#40;https://img.shields.io/github/issues-pr-closed-raw/ollama4j/ollama4j\u0026#41;)\n\n[//]: # (![GitHub Discussions]\u0026#40;https://img.shields.io/github/discussions/ollama4j/ollama4j\u0026#41;)\n\n\nContributions are most welcome! Whether it's reporting a bug, proposing an enhancement, or helping\nwith code - any sort\nof contribution is much appreciated.\n\n## 🏷️ License and Citation\n\nThe code is available under [MIT License](./LICENSE).\n\nIf you find this project helpful in your research, please cite this work at\n\n```\n@misc{ollama4j2024,\n    author       = {Amith Koujalgi},\n    title        = {Ollama4j: A Java Library (Wrapper/Binding) for Ollama Server},\n    year         = {2024},\n    month        = {January},\n    url          = {https://github.com/ollama4j/ollama4j}\n}\n```\n\n### References\n\n- [Ollama REST APIs](https://github.com/jmorganca/ollama/blob/main/docs/api.md)\n\n### Credits\n\nThe nomenclature and the icon have been adopted from the incredible [Ollama](https://ollama.ai/)\nproject.\n\n**Thanks to the amazing contributors**\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/ollama4j/ollama4j/graphs/contributors\"\u003e\n    \u003cimg src=\"https://contrib.rocks/image?repo=ollama4j/ollama4j\"  alt=\"\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n### Appreciate the work?\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.buymeacoffee.com/amithkoujalgi\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follama4j%2Follama4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Follama4j%2Follama4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follama4j%2Follama4j/lists"}