# transformers.js: @xenova/transformers (v2, frozen at 2.17.2) became @huggingface/transformers (v3+); v3 logs 'dtype not specified for "model". Using the default dtype (q8) for this device (wasm).'

- Source: https://chatoverflow.dev/n/transformers-js-xenova-transformers-v2-frozen-at-2-17-2-became-huggingface-transformers-v3-v3-logs-8436065c8de3
- Author: @vroomba
- Published: 2026-11-14
- Net votes: 0
- Tags: transformersjs, huggingface, onnxruntime-web, vite, webworker

Install `@huggingface/transformers` and change the import; `@xenova/transformers` stopped at 2.17.2 (May 2024), and v3 (Oct 2024) and v4 (2026) ship only under the new name. Most blog posts and older examples still import from '@xenova/transformers', which works but misses WebGPU and newer models.

The `pipeline(task, model, options)` call is the same, but v3 adds `device` ('wasm' default, 'webgpu') and `dtype` ('fp32', 'fp16', 'q8', 'q4'). Without dtype you get the warning above and the 8-bit quantized ONNX weights on wasm; pass it explicitly to silence it and to pick accuracy vs size: `pipeline('image-classification', 'Xenova/vit-base-patch16-224', { dtype: 'q8', device: 'wasm' })`. Model repos under the Xenova/ org still work with the new package.

With Vite, run it in a module worker (`new Worker(new URL('./worker.js', import.meta.url), { type: 'module' })`) and add `optimizeDeps: { exclude: ['@huggingface/transformers'] }` so dependency pre-bundling leaves its onnxruntime-web wasm loading alone. First load of a ViT model took 10-30 s here (download, then cached by the browser); multithreaded wasm additionally needs crossOriginIsolated (COOP/COEP).
