{"id":15010354,"url":"https://github.com/vollcheck/ollama-clj","last_synced_at":"2026-02-26T03:54:39.798Z","repository":{"id":224777463,"uuid":"755464277","full_name":"vollcheck/ollama-clj","owner":"vollcheck","description":"Ollama Clojure library","archived":false,"fork":false,"pushed_at":"2024-07-04T20:35:16.000Z","size":38,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T18:48:12.354Z","etag":null,"topics":["clojure","gpt","ollama"],"latest_commit_sha":null,"homepage":"","language":"Clojure","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/vollcheck.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-02-10T09:40:22.000Z","updated_at":"2025-02-18T21:01:03.000Z","dependencies_parsed_at":"2024-10-12T10:20:43.455Z","dependency_job_id":"85d6a135-b4ca-4629-b6e1-fdc0ada0ec9a","html_url":"https://github.com/vollcheck/ollama-clj","commit_stats":null,"previous_names":["vollcheck/ollama-clj"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vollcheck/ollama-clj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vollcheck%2Follama-clj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vollcheck%2Follama-clj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vollcheck%2Follama-clj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vollcheck%2Follama-clj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vollcheck","download_url":"https://codeload.github.com/vollcheck/ollama-clj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vollcheck%2Follama-clj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29848654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"online","status_checked_at":"2026-02-26T02:00:06.774Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["clojure","gpt","ollama"],"created_at":"2024-09-24T19:33:40.447Z","updated_at":"2026-02-26T03:54:39.783Z","avatar_url":"https://github.com/vollcheck.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ollama-clj\n\n## NOTE: Work in progress!\n\nUse [`ollama`](https://ollama.com) within Clojure project.\n\n## Usage\n\n```clojure\n(require '[ollama-clj.core :as o])\n\n(def client (o/-\u003eClient \"http://localhost:11434\"))\n\n(def messages\n  [{:role \"user\"\n    :content \"Why is the sky blue?\"}])\n\n(-\u003e (o/chat client \"mistral\" messages)\n    :message\n    :content)\n```\n\nor with streaming option:\n\n```clojure\n(require '[ollama-clj.core :as o])\n\n(def client (o/-\u003eClient \"http://localhost:11434\"))\n\n(def messages\n  [{:role \"user\"\n    :content \"Why is the sky blue?\"}])\n\n                                               ;; note the streaming flag!\n(doseq [part (o/chat client \"mistral\" messages {:stream true})]\n  (print (-\u003e part :message :content)))\n```\n\nFor more usages reach out to `examples/` directory.\n\n### Internals\n\n### Implement your own client\n\nIf you want to gain control over the way of executing `ollama` calls, you can implement your own client simply by using record and protocol like so:\n\n```clojure\n(defrecord MyClient [url]\n  o/BaseClient\n  (request [_this method endpoint opts]\n    :perform-request)\n\n  (stream [_this method endpoint opts]\n    :perform-streaming)\n\n  (request-stream [this method endpoint {:keys [stream?] :as opts}]\n    (if stream?\n      (.stream this method endpoint opts)\n      (.request this method endpoint opts))))\n```\n\n## References\n\n- https://ollama.com\n- https://github.com/ollama/ollama-python - Python library for ollama (big inspiration for this project)\n- https://github.com/clj-commons/manifold/blob/master/doc/stream.md - aleph/manifold streaming docs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvollcheck%2Follama-clj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvollcheck%2Follama-clj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvollcheck%2Follama-clj/lists"}