This guide covers how to generate text with theDocumentation 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.
aisdk/ollama provider. It works with any model installed on your Ollama server — the package treats model IDs as opaque values and ships no model inventory of its own. Use Ollama::model() to reference any identifier your server recognises.
Basic text generation
Choosing an API endpoint
Ollama exposes two OpenAI-compatible API surfaces. The default isOllamaApi::ChatCompletions (chat_completions). You can switch to the Responses API globally when creating the provider:
providerOptions():
chat_completions and responses. The Chat Completions endpoint supports vision, reasoning effort, and structured output. The Responses endpoint supports streaming and tool calling, but does not expose reasoning or structured-output controls.
Vision (image input)
Image input is supported on the Chat Completions endpoint only. Pass aMessage with mixed content using Content::text() and Content::image():
Reasoning effort
Reasoning effort is supported on the Chat Completions endpoint only. Pass aReasoning instance to the reasoning() method:
Structured output
Structured output is supported on the Chat Completions endpoint only. It works by passing a JSON schema through theresponse_format field.
Adapter capabilities
The adapter declares a fixed set of
ADAPTER_CAPABILITIES in OllamaTextModel: TextGeneration, Streaming, ToolCalling, StructuredOutput, Reasoning, TextInput, and ImageInput. These reflect what the adapter code supports, not what any particular model supports. The installed model on your Ollama server is still the authority on which features actually work at inference time.