v2026.5.3
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.

Completion

Ollama model interactions

Inherits: EndPoint
prompt := "What number is this?";
file := System.IO.Filesystem.File->New("../gemini/thirteen.png");
Completion->Generate("llava", prompt, file)->PrintLine();

Operations

Generate # function

Generates a response from the model given an input

function : Generate(model:String, prompt:String) ~ String

Parameters

NameTypeDescription
modelStringmodel name (i.e. llama3, llava)
promptStringprompt

Return

TypeDescription
Stringquery response

Example

response := Completion->Generate("llama3", "What is the capital of France?");
response->PrintLine();

Generate # function

Generates a response from the model given an input with options

function : Generate(model:String, prompt:String, options:Options) ~ String

Parameters

NameTypeDescription
modelStringmodel name (i.e. llama3, llava)
promptStringprompt
optionsOptionsgeneration options (temperature, top_p, etc.)

Return

TypeDescription
Stringquery response

Example

opts := Options->New()->SetTemperature(0.3)->SetTopP(0.85);
response := Completion->Generate("llama3", "Summarize quantum entanglement briefly.", opts);
response->PrintLine();

Generate # function

Generates a response from the model given an input

function : Generate(model:String, prompt:String, format:String) ~ String

Parameters

NameTypeDescription
modelStringmodel name (i.e. llama3, llava)
promptStringprompt
formatStringoutput format

Return

TypeDescription
Stringquery response

Generate # function

Generates a response from the model given an input

function : Generate(model:String, prompt:String, format:String, options:Options) ~ String

Parameters

NameTypeDescription
modelStringmodel name (i.e. llama3, llava)
promptStringprompt
formatStringoutput format
optionsOptionsgeneration options (temperature, top_p, etc.)

Return

TypeDescription
Stringquery response

Generate # function

Generates a response from the model given an input

function : Generate(model:String, prompt:String, image:File) ~ String

Parameters

NameTypeDescription
modelStringmodel name (i.e. llama3, llava)
promptStringprompt
imageFileimage file

Return

TypeDescription
Stringquery response

Example

image := System.IO.Filesystem.File->New("photo.png");
response := Completion->Generate("llava", "Describe what you see in this image.", image);
response->PrintLine();

Generate # function

Generates a response from the model given an input

function : Generate(model:String, prompt:String, images:File[]) ~ String

Parameters

NameTypeDescription
modelStringmodel name (i.e. llama3, llava)
promptStringprompt
imagesFile[]image images

Return

TypeDescription
Stringquery response