Search by

aisdk / ollama

aisdk

Official Ollama provider for the PHP AI SDK.

Package info

github.com/phpaisdk/ollama

pkg:composer/aisdk/ollama

Fund package maintenance!

Open Collective

Statistics

Installs: 249

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 1

v0.11.0 2026-10-31 02:58 UTC

This package is auto-updated.

Last update: 2026-11-03 18:57:23 UTC


README

Run local models with the framework-agnostic PHP AI SDK. Supports text generation, streaming, tools, structured output, and embeddings.

Installation

composer require aisdk/ollama
ollama pull qwen3.8

Start Ollama locally. The default endpoint is http://localhost:11434/v1; set OLLAMA_BASE_URL to use another server.

Usage

use AiSdk\Generate;
use AiSdk\Ollama;

$result = Generate::text('Explain closures in PHP in one sentence.')
    ->model(Ollama::model('qwen3.8'))
    ->run();

echo $result->text;

Documentation

Read the documentation for configuration, supported features, and more examples.

Contributing ยท Support

License

The MIT License (MIT). See LICENSE for details.