Skip to content

chipslays/ollama-php

Repository files navigation

Ollama PHP

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

About

🦙 A lightweight PHP client for the Ollama API.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages