Graphorin API reference v0.12.1
Graphorin API reference / @graphorin/reranker-transformersjs / / CrossEncoderRerankerOptions
Interface: CrossEncoderRerankerOptions<TRecord>
Defined in: packages/reranker-transformersjs/src/reranker.ts:34
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:52 |
cacheDir? | readonly | string | Optional cache directory. Honours GRAPHORIN_CACHE_DIR when unset. | packages/reranker-transformersjs/src/reranker.ts:44 |
device? | readonly | string | Override device ('cpu', 'webgpu', …). Default 'cpu'. | packages/reranker-transformersjs/src/reranker.ts:46 |
dtype? | readonly | RerankerDtype | Default: 'q8' on CPU, 'fp16' on non-CPU devices. | packages/reranker-transformersjs/src/reranker.ts:40 |
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:59 |
locale? | readonly | string | BCP 47 locale tag used to select the default model. Default 'en'. | packages/reranker-transformersjs/src/reranker.ts:38 |
model? | readonly | string | Override the auto-picked model. Default: derived from locale. | packages/reranker-transformersjs/src/reranker.ts:36 |
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:78 |
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:65 |
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:71 |
revision? | readonly | string | Optional revision pin ('main' if unset). | packages/reranker-transformersjs/src/reranker.ts:42 |