Ollama PHP Library
A PHP client library for the Ollama API, covering chat and text completion (including streaming), model management and embeddings, for PHP 8.1 and above.
Ollama PHP Library is a PHP client for the Ollama local-LLM server API. It provides resources for completions and chat, including streamed responses, and for listing, creating, copying, deleting, pulling and pushing models, as well as retrieving currently running models.
It also exposes blob and embedding endpoints, and supports a tools parameter for function calling in chat requests, with the restriction that tools cannot be combined with streamed chat. It is installed through Composer and defaults to Ollama's local endpoint, with a configurable base URL for remote servers.