Download the PHP package f4php/ollaminator without Composer
On this page you can find all versions of the php package f4php/ollaminator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ollaminator
Ollaminator
Ollaminator is an Ollama client for F4, a lightweight PHP/PostgreSQL-based web development framework.
It provides a small, typed wrapper around the Ollama HTTP API for chat, single-prompt generation, embeddings, and model listing — returning readonly response objects instead of raw arrays.
Requirements
- PHP 8.3+ (uses typed class constants and named arguments)
- A running Ollama instance (defaults to
http://localhost:11434) - Guzzle 7 (installed as a dependency)
Installation
Configuration
Ollaminator reads two F4-wide config constants for its defaults:
Both are used as fall-through defaults, so in most applications you configure them once and never pass a host or model again.
Model is resolved per call in this order:
- A
model:argument passed to the individual call (chat/generate/embed). - The
model:argument passed to theClientconstructor. F4\Config::OLLAMINATOR_MODEL.
Host comes from F4\Config::OLLAMINATOR_URL and is the default baseUrl of ApiClient. Construct an ApiClient with an explicit baseUrl: to override it for a given client.
You can still override the model per-client or per-call, and the host per-client, whenever you need to.
Quick start
By default the client talks to Ollama on Config::OLLAMINATOR_URL (e.g. http://localhost:11434). Make sure the model you want is pulled first (e.g. ollama pull llama3.2).
Chat
Generate (single prompt)
Embeddings
List local models
Connecting to a non-default host
To reach a host other than Config::OLLAMINATOR_URL, pass a configured ApiClient to the Client constructor. Use named arguments, since $model is the first constructor parameter:
JSON / structured output
Ask the model to return valid JSON, optionally constrained by a JSON schema:
Pass format: 'json' for unstructured JSON mode.
Error handling
All errors extend F4\Ollaminator\Exception\OllamaException:
Documentation
- docs/AGENTS.md — complete API reference (every method, parameter, and response object) intended for AI agents and as a detailed developer reference.
License
MIT © Dennis Kreminsky