Graphorin API reference v0.12.1
Graphorin API reference / @graphorin/embedder-transformersjs / / TransformersJsEmbedderOptions
Interface: TransformersJsEmbedderOptions
Defined in: packages/embedder-transformersjs/src/index.ts:33
Configuration accepted by createTransformersJsEmbedder.
Stable
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
cacheDir? | readonly | string | Optional cache directory. When unset, the embedder honours process.env.GRAPHORIN_CACHE_DIR, otherwise falls back to the Hugging Face default (os.homedir()/.cache/huggingface/hub). | packages/embedder-transformersjs/src/index.ts:47 |
device? | readonly | string | Override device ('cpu', 'webgpu', …). Default 'cpu'. | packages/embedder-transformersjs/src/index.ts:54 |
dim? | readonly | number | Optional dimensionality hint. When the caller knows the output dimension up-front, it is included in the canonical id without waiting for the first embed() call. | packages/embedder-transformersjs/src/index.ts:66 |
disableTaskPrefix? | readonly | boolean | Disable the automatic E5 query: / passage: prefixing (PS-10). The prefixes are applied by default for E5-family models (the multilingual-e5 default and any model whose id carries an e5 token), because the E5 model card requires them and omitting them measurably degrades retrieval. Set this to true only if your inputs are already prefixed or you use a non-standard E5 export. Toggling it changes the canonical configHash (and thus the embedder id), which triggers a re-embedding migration. | packages/embedder-transformersjs/src/index.ts:76 |
dtype? | readonly | string | Optional dtype hint (`'fp32' | 'fp16' |
model? | readonly | string | Default 'Xenova/multilingual-e5-base' (768-dim). | packages/embedder-transformersjs/src/index.ts:35 |
normalize? | readonly | boolean | Default true. | packages/embedder-transformersjs/src/index.ts:39 |
pipelineFactory? | readonly | PipelineFactory | Override the underlying pipeline factory - used by the test suite to inject a stub. Production callers should leave this unset so the package lazily loads @huggingface/transformers. | packages/embedder-transformersjs/src/index.ts:60 |
pooling? | readonly | Pooling | Default 'mean'. | packages/embedder-transformersjs/src/index.ts:37 |
revision? | readonly | string | Optional model revision pin ('main' if unset). | packages/embedder-transformersjs/src/index.ts:41 |