ollama / php
A lightweight PHP client for the Ollama API.
1.0.5
2026-07-01 06:39 UTC
Requires
- php: ^8.4
- guzzlehttp/guzzle: ^7.12
Requires (Dev)
- pestphp/pest: ^3.0 || ^4.0
- symfony/var-dumper: ^8.1
README
A lightweight PHP client for the Ollama API.
🦙 + 🐘 = ❤️
Installation
composer require ollama/php --prefer-dist
Quick Start
use Ollama\Ollama; $ollama = new Ollama; $response = $ollama->chat()->send([ 'model' => 'gemma4:12b', 'messages' => [ ['role' => 'user', 'content' => 'Hello world!'], ], ]); echo $response->message->content;
Examples 👀
There are many, many examples for each endpoint in the examples folder, come and explore!
License
MIT