Skip to content

Graphorin API reference v0.12.1


Graphorin API reference / @graphorin/provider / adapters/ollama

adapters/ollama

Direct adapter for the Ollama HTTP API. The adapter speaks the native Ollama streaming JSON protocol (POST /api/chat returning newline-delimited JSON objects). For operators who prefer the OpenAI-compatible variant exposed by recent Ollama releases, the generic openAICompatibleAdapter is the better choice - both adapters share the same LocalProviderTrust classifier and LocalProviderInsecureTransportError startup behaviour.

Interfaces

InterfaceDescription
OllamaAdapterOptionsOptions accepted by ollamaAdapter.
OllamaTimingsOllama server timings for one call, in milliseconds (audit 2026-07-16, item 8). The server reports them in nanoseconds on the terminal chunk; normalized here so model load, prompt processing and generation are distinguishable in events and traces. Surfaced under providerMetadata.ollama on the finish event / generate() response, and stamped onto the provider span by withTracing.

Variables

VariableDescription
DEFAULT_OLLAMA_BASE_URLDefault Ollama base URL.

Functions

FunctionDescription
ollamaAdapterBuild a Graphorin Provider backed by Ollama's native HTTP API. The adapter is fail-safe by default: public-cleartext URLs refuse to start with LocalProviderInsecureTransportError.