PHPackages                             hanwoolderink/ollama-php-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hanwoolderink/ollama-php-client

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hanwoolderink/ollama-php-client
===============================

Ollama php client

v1.0.2(1y ago)0801MITPHPPHP ^8.3

Since Jul 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/hanwoolderink88/ollama-php-client)[ Packagist](https://packagist.org/packages/hanwoolderink/ollama-php-client)[ RSS](/packages/hanwoolderink-ollama-php-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (5)Used By (1)

Ollama API PHP client
=====================

[](#ollama-api-php-client)

PHP client for the Ollama API. It provides a simple way to interact with the API.

See the [Ollama API documentation](https://github.com/ollama/ollama/blob/main/docs/api.md) for more information.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require hanwoolderink/ollama-php-client
```

Usage
-----

[](#usage)

Basic usage example:

```
use Hanwoolderink\Ollama\Ollama;
use Hanwoolderink\Ollama\Dtos\Message;

$ollama = new Ollama();

$response = $ollama->chat()->create(
  model: 'llama3.1:latest',
  message: new Message('Why is the sky blue?')
);

echo $response->message->content;
```

Stream example:

```
use Hanwoolderink\Ollama\Ollama;
use Hanwoolderink\Ollama\Dtos\Message;

$ollama = new Ollama();

$response = $ollama->chat()->stream(
    model: 'llama3.1:latest',
    messages: [
        new Message('Why does the sky appear more blue in the morning and more red in the evening?')
    ],
);

foreach ($response as $streamResponse) {
    // update storage, socket, etc.. This prints to cli
    $stream = fopen('php://stdout', 'w');
    fwrite($stream, $streamResponse->message->content);
    fclose($stream);
}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

612d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e21d68868f5e1e62a481d758b74625415ac0667d41ce3b58f90ce6e2632f99d?d=identicon)[hanw](/maintainers/hanw)

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/hanwoolderink-ollama-php-client/health.svg)

```
[![Health](https://phpackages.com/badges/hanwoolderink-ollama-php-client/health.svg)](https://phpackages.com/packages/hanwoolderink-ollama-php-client)
```

###  Alternatives

[illuminate/config

The Illuminate Config package.

10842.7M2.2k](/packages/illuminate-config)[illuminate/pagination

The Illuminate Pagination package.

10532.5M861](/packages/illuminate-pagination)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[illuminate/redis

The Illuminate Redis package.

8314.0M314](/packages/illuminate-redis)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[illuminate/cookie

The Illuminate Cookie package.

224.3M122](/packages/illuminate-cookie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
