Skip to content
1 min read · 98 words

Type Alias: TransformersJsSessionOptions ​

ts
type TransformersJsSessionOptions = Record<string, unknown>;

Defined in: src/batteries/llm/transformers_js/types.ts:78

ONNX Runtime session options forwarded verbatim to transformers.js's session_options loader arg.

Remarks ​

A REACHABLE LEVER, never auto-applied by the battery (surface, don't impose). Kept structurally open (Record<string, unknown>) rather than aliasing onnxruntime-common's InferenceSession.SessionOptions directly: that type is not a peer of this battery, and a hard re-export of an external type breaks the bundler (the same reason the wire shapes above are local aliases). Useful keys for the WebGPU EP: preferredOutputLocation ('gpu-buffer' to keep outputs on GPU for IO-binding), graphOptimizationLevel, enableGraphCapture. Note freeDimensionOverrides cannot pin a KV-cached decoder's dynamic dims.