The PHP AI SDK Ollama provider connects your PHP application to any model running on a local or remote Ollama server. It supports the full generation surface — text, streaming, embeddings, and experimental image generation — through a clean, framework-agnostic interface that works with any PSR-18 HTTP client.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/ollama/llms.txt
Use this file to discover all available pages before exploring further.
Installation
Install via Composer and get the provider running in under a minute
Quickstart
Generate your first response from a local Ollama model
Guides
Explore text generation, streaming, embeddings, and image generation
API Reference
Full reference for the Ollama facade, provider, models, and types
What’s included
Text Generation
Chat Completions and Responses API support, with vision, tool calling, reasoning, and structured output
Streaming
Real-time server-sent event streaming for any installed text model
Embeddings
Native batch embeddings via Ollama’s
/api/embed endpoint with dimension controlImage Generation
Experimental image generation through Ollama’s OpenAI-compatible endpoint
Model Discovery
List installed models and inspect their capabilities from the live server
Configuration
Base URL, native URL, API key, and per-request API endpoint overrides
Getting started
No API key is required for a local Ollama server. The provider defaults to
http://localhost:11434/v1. See Configuration if your server runs elsewhere or requires authentication.