Skip to content

basalt / ai/src / OllamaProvider

Class: OllamaProvider ​

Defined in: ai/src/provider/ollama.ts:29

Local Ollama provider (/api/chat, stream: false). Needs no API key, so it's the zero-cost default for offline development and CI.

Implements ​

Constructors ​

Constructor ​

> new OllamaProvider(options?): OllamaProvider

Defined in: ai/src/provider/ollama.ts:35

Parameters ​

options? ​

OllamaProviderOptions = {}

Returns ​

OllamaProvider

Properties ​

model ​

> readonly model: string

Defined in: ai/src/provider/ollama.ts:31

Concrete model id in use, e.g. 'claude-sonnet-5'.

Implementation of ​

AIProvider.model


name ​

> readonly name: "ollama" = 'ollama'

Defined in: ai/src/provider/ollama.ts:30

Stable id, e.g. 'anthropic'.

Implementation of ​

AIProvider.name

Methods ​

generate() ​

> generate(options): Promise<string>

Defined in: ai/src/provider/ollama.ts:43

One-shot completion — returns the assistant's full text.

Parameters ​

options ​

GenerateOptions

Returns ​

Promise<string>

Implementation of ​

AIProvider.generate


stream() ​

> stream(options): AsyncIterable<string>

Defined in: ai/src/provider/ollama.ts:61

Streaming completion — yields chunks as they arrive.

Parameters ​

options ​

GenerateOptions

Returns ​

AsyncIterable<string>

Implementation of ​

AIProvider.stream

Released under the MIT License.