Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/reranker-transformersjs / CrossEncoderRerankerOptions
Interface: CrossEncoderRerankerOptions<TRecord>
Defined in: packages/reranker-transformersjs/src/reranker.ts:33
Options accepted by createCrossEncoderReranker.
Stable
Type Parameters
| Type Parameter | Default type |
|---|---|
TRecord extends MemoryRecord | MemoryRecord |
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
batchSize? | readonly | number | Maximum batch size sent to the cross-encoder per inference call. Default 32. Larger batches improve throughput at the cost of resident memory. | packages/reranker-transformersjs/src/reranker.ts:51 |
cacheDir? | readonly | string | Optional cache directory. Honours GRAPHORIN_CACHE_DIR when unset. | packages/reranker-transformersjs/src/reranker.ts:43 |
device? | readonly | string | Override device ('cpu', 'webgpu', …). Default 'cpu'. | packages/reranker-transformersjs/src/reranker.ts:45 |
dtype? | readonly | RerankerDtype | Default 'fp16'. | packages/reranker-transformersjs/src/reranker.ts:39 |
idleEvictionMs? | readonly | number | Optional idle-eviction timeout in milliseconds. When the reranker does not score a pair within this window, the loaded pipeline is dropped so the OS can reclaim the underlying ONNX session. Default undefined (eviction disabled). | packages/reranker-transformersjs/src/reranker.ts:58 |
locale? | readonly | string | BCP 47 locale tag used to select the default model. Default 'en'. | packages/reranker-transformersjs/src/reranker.ts:37 |
model? | readonly | string | Override the auto-picked model. Default: derived from locale. | packages/reranker-transformersjs/src/reranker.ts:35 |
now? | readonly | () => number | Internal Override the wall-clock provider. Used by tests so the idle-eviction timer can be exercised deterministically. | packages/reranker-transformersjs/src/reranker.ts:77 |
passageExtractor? | readonly | PassageExtractor<TRecord> | Optional passage extractor — replaces the default heuristic that walks text → summary → value → label → id. Useful when a custom MemoryRecord schema attaches the canonical text elsewhere. | packages/reranker-transformersjs/src/reranker.ts:64 |
pipelineFactory? | readonly | CrossEncoderPipelineFactory | Inject a pipelineFactory. Used by tests to stub the underlying @huggingface/transformers pipeline. Production callers leave this unset so the package lazily loads the peer. | packages/reranker-transformersjs/src/reranker.ts:70 |
revision? | readonly | string | Optional revision pin ('main' if unset). | packages/reranker-transformersjs/src/reranker.ts:41 |