v2026.9.6
All Bundles
Bundle Ollama local LLM client. Runs models (Llama, Mistral, Phi, etc.) locally via the Ollama server. Supports streaming completions, chat sessions, embeddings, and model management. Compile with -lib ollama.

EndPoint

Ollama enabled endpoint class

Operations

GetHost # function

Gets the Ollama server host URL. Defaults to http://localhost:11434.

function : GetHost() ~ String

Return

TypeDescription
Stringhost URL

GetLastError # function

Get the last error

function : GetLastError() ~ String

Return

TypeDescription
Stringlast error

ParseResponse # function

Parse a response body. Nil, with the last error set, when the body is not JSON. Every request in this library used to inline this and the error check that follows; one of the ten copies had its else-if bound to the wrong if, so an {"error": ...} reply -- the shape Ollama actually sends -- was swallowed and a non-JSON body dereferenced Nil.

function : ParseResponse(body:String) ~ JsonElement

Parameters

NameTypeDescription
bodyStringresponse text

Return

TypeDescription
JsonElementparsed element, or Nil

ReportError # function

Record the error a response carries, or that it carried nothing usable.

function : ReportError(json:JsonElement) ~ Nil

Parameters

NameTypeDescription
jsonJsonElementparsed response that lacked the expected field

SetHost # function

Sets the Ollama server host URL (e.g. "http://myserver:11434")

function : SetHost(host:String) ~ Nil

Parameters

NameTypeDescription
hostStringserver URL without trailing slash