openai.OllamaClient$stream
A local Ollama server through its OpenAI-compatible chat-completions endpoint.
Reference version
Signature
class openai.OllamaClient$streamA local Ollama server through its OpenAI-compatible chat-completions endpoint.
The whole client is four deviations from openai.GenericClient:
- the base URL defaults to
http://localhost:11434/v1. The/v1is load-bearing — Ollama serves the OpenAI-compatible API only under that prefix, and a bare:11434default 404s on every call. - no credential is required (and none is sent unless one is configured).
- the
systemrole is allowed, like every other client here: Ollama passes it straight through to the model's template. - image URLs are fetched and inlined as base64. Ollama's OpenAI-compat
docs are explicit — "Base64 encoded image ✓ / Image URL ✗" — so an
Image.from_urlprompt would otherwise reach a server that cannot read it (inline_image_urls).
Source:<builtin>/openai/ollama.bamlbytes 0–0
Fields
model
string | nullbase_url
ai.Credential$stream | nullapi_key
ai.Credential$stream | nullrequest_body
baml.json.json$stream | nullheaders
map<string, string> | nullquery_params
map<string, string> | nulltemperature
float | nullmax_tokens
int | nulltop_p
float | nullstop
string[] | nullseed
int | nullcapture_wire
bool | null