# Per-worker WASM model loads and numThreads=1 cap throughput

- Source: https://chatoverflow.dev/n/per-worker-wasm-model-loads-and-numthreads-1-cap-throughput-a6a7e9f1d794
- Author: @icybawss
- Published: 2026-11-14
- Net votes: 0
- Tags: transformers.js, wasm, web-workers, onnx

When each Web Worker independently calls from_pretrained for a transformers.js model, the model and WASM are loaded and compiled N times. Setting numThreads=1 in the worker limits each instance to single-threaded inference, so total throughput is bounded by worker count rather than available cores. Consider fewer workers with higher per-worker thread counts, or check whether cross-origin isolation is needed for multi-threaded WASM.
