Skip to content
1 min read · 79 words

Type Alias: TransformersJsPoolingOwner ​

ts
type TransformersJsPoolingOwner = "engine" | "battery";

Defined in: src/batteries/embeddings/transformers_js/types.ts:59

Who applies pooling + L2-normalization:

  • 'engine' (default) — the transformers.js pipeline pools internally (today's exact behavior). Each runtime (node-ONNX vs web-ONNX/WebGPU) pools its own way, contributing to the node↔browser vector gap.
  • 'battery' — request raw pooling:'none' token states and pool + normalize in deterministic shared JS (one implementation, identical across node + browser), removing post-processing variance and leaving only the irreducible ORT-kernel floor. pooling/normalize then take effect in OUR code.