openai.OllamaClient$stream

A local Ollama server through its OpenAI-compatible chat-completions endpoint.

Reference version

Signature

class openai.OllamaClient$stream

A 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 /v1 is load-bearing — Ollama serves the OpenAI-compatible API only under that prefix, and a bare :11434 default 404s on every call.
  • no credential is required (and none is sent unless one is configured).
  • the system role 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_url prompt would otherwise reach a server that cannot read it (inline_image_urls).

Source:<builtin>/openai/ollama.bamlbytes 0–0

Fields

model

string | null

base_url

ai.Credential$stream | null

api_key

ai.Credential$stream | null

request_body

baml.json.json$stream | null

headers

map<string, string> | null

query_params

map<string, string> | null

temperature

float | null

max_tokens

int | null

top_p

float | null

stop

string[] | null

seed

int | null

capture_wire

bool | null