Graphorin API reference v0.12.1
Graphorin API reference / @graphorin/embedder-ollama / / OllamaEmbedder
Class: OllamaEmbedder
Defined in: packages/embedder-ollama/src/index.ts:134
EmbedderProvider implementation that talks to the Ollama HTTP API.
Stable
Implements
Constructors
Constructor
new OllamaEmbedder(options): OllamaEmbedder;Defined in: packages/embedder-ollama/src/index.ts:148
Parameters
| Parameter | Type |
|---|---|
options | OllamaEmbedderOptions |
Returns
OllamaEmbedder
Methods
configHash()
configHash(): string;Defined in: packages/embedder-ollama/src/index.ts:209
Deterministic hash over the embedder's full configuration - including the discovered digest. A model upgrade in the same Ollama instance changes the digest (and therefore the hash), so lock-on-first correctly fires a migration path instead of silently reusing the same embedder_id.
Returns
string
Implementation of
dim()
dim(): number;Defined in: packages/embedder-ollama/src/index.ts:191
Output dimension - the explicit dim option, the resolved width from the first embed(), or a known-family default. PS-11: throws for an unknown model with no dim hint instead of returning 0 (which the store would persist and use to create a float[0] vec0 table, silently breaking vector search). Pass dim for any model not in KNOWN_OLLAMA_MODEL_DIMS, or call embed() once first to resolve it.
Returns
number
Implementation of
embed()
embed(texts, opts?): Promise<readonly Float32Array<ArrayBufferLike>[]>;Defined in: packages/embedder-ollama/src/index.ts:219
Compute embeddings for a batch of texts. Returns one vector per text.
Parameters
| Parameter | Type |
|---|---|
texts | readonly string[] |
opts | EmbedOptions |
Returns
Promise<readonly Float32Array<ArrayBufferLike>[]>
Implementation of
id()
id(): string;Defined in: packages/embedder-ollama/src/index.ts:177
The canonical embedder id - 'ollama:<model>@<dim-or-digest>'.
Returns
string