Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/embedder-ollama

@graphorin/embedder-ollama

First-class opt-in alternative embedder for the Graphorin framework.

@graphorin/embedder-ollama wraps the local Ollama HTTP API to produce dense embeddings without the bundled-model overhead of @graphorin/embedder-transformersjs. The package ships known output dimensions for ten common Ollama embedding models out of the box (KNOWN_OLLAMA_MODEL_DIMS); any other model works too by passing an explicit dim:

ModelDimNotes
nomic-embed-text (default)768Multilingual; the de-facto Ollama default.
mxbai-embed-large1024Strong English; competitive with cloud peers.
snowflake-arctic-embed1024Strong English.
snowflake-arctic-embed21024Multilingual successor to arctic-embed.
bge-m31024Multilingual; same family also ships via the transformers.js adapter.
bge-large1024Strong English.
embeddinggemma768Multilingual (Google).
paraphrase-multilingual768Multilingual paraphrase family.
all-minilm384Compact English.
granite-embedding384Compact (IBM).

Multi-size models (e.g. tags whose dimension depends on the :0.6b / :4b / :8b variant) are deliberately omitted from the known-dims map so an ambiguous bind fails loudly instead of baking a wrong width.

Install

bash
pnpm add @graphorin/embedder-ollama

The package has no native peers. It uses the standard fetch API to talk to a running Ollama instance (default http://127.0.0.1:11434).

Quick start

ts
import { createOllamaEmbedder } from '@graphorin/embedder-ollama';

const embedder = createOllamaEmbedder({
  model: 'nomic-embed-text',
  baseUrl: 'http://127.0.0.1:11434',
});

const [vec] = await embedder.embed(['Loves espresso.']);
console.log(embedder.id(), embedder.dim(), vec.length);

Trust + privacy

The embedder itself performs no trust classification - it is a thin client for whatever baseUrl you give it, and it never talks to anything else. Point it at a loopback Ollama (http://127.0.0.1:11434, the default) and embeddings never leave the machine. Trust classification and sensitivity gating for LLM traffic live one layer up, in @graphorin/provider's LocalProviderTrust classifier; apply the same judgement before pointing this embedder at a remote host.

Versioning of embedder_id

The canonical id includes the Ollama model digest discovered via POST /api/show at construction time. A model upgrade in the same Ollama instance produces a different digest - and therefore a different embedder_id. The default lock-on-first policy in @graphorin/store-sqlite then fires the same migration path the existing transformersjs swap takes.

License

MIT © 2026 Oleksiy Stepurenko.


Project Graphorin · v0.7.0 · MIT License · © 2026 Oleksiy Stepurenko · https://github.com/o-stepper/graphorin

Modules

ModuleDescription
@graphorin/embedder-ollama - first-class opt-in alternative embedder for the Graphorin framework. Wraps the local Ollama HTTP API.
package.json-