A lightweight PHP client for the Ollama API.
🦙 + 🐘 = ❤️
composer require ollama/php --prefer-distuse Ollama\Ollama;
$ollama = new Ollama;
$response = $ollama->chat()->send([
'model' => 'gemma4:12b',
'messages' => [
['role' => 'user', 'content' => 'Hello world!'],
],
]);
echo $response->message->content;There are many, many examples for each endpoint in the examples folder, come and explore!
MIT