Loom vs transformers.js
Same model, same prompt, same decoding, same tab. transformers.js is loaded here for comparison only — it is not a dependency of the engine.
What is being compared
| Loom | transformers.js | |
|---|---|---|
| model | Qwen2.5-0.5B-Instruct | Qwen2.5-0.5B-Instruct |
| format | GGUF Q4_K_M | ONNX q4f16 |
| size on disk | 469 MB | 483 MB |
| runtime | hand-written Rust → wasm, SIMD128 | ONNX Runtime Web, SIMD128 |
| threads | 1 | 1 (forced, for fairness) |
Not identical quantisations — no two runtimes share one. q4f16 is the closest ONNX build by size and bits per weight, which is the fairest match available rather than a perfect one.
Run
Run one, reload the page, then run the other. Two models at once is ~950 MB of wasm heap; on a machine that then swaps, the second number measures paging rather than the engine. Results survive the reload.
Results
| load | prefill | decode | tok/s |
|---|
Where the gap comes from
Filled in once both have run.