Benchmarks

Kiln and transformers.js 4.3.2 in the same browser on the same machine, on the same inputs, both on WebGPU in fp32 unless noted (transformers.js runs the repos' ONNX exports, Kiln the original weights). Times are end to end, the median of three warm calls after one warm-up.

median speed-up
task / model pairs
0
pairs where transformers.js was faster end to end

Speed

How many times faster Kiln is (transformers.js's time over Kiln's, or Kiln's tokens per second over transformers.js's). The dashed line is parity. Hover or focus a bar for both timings.

All measurements

Where Kiln is slower

Accuracy

Speed only counts if the outputs are right. Each model was checked against transformers.js on the same inputs, and many against Python's transformers or an independent NumPy forward pass:

ModelChecked againstResult
LLMs (f32)transformers.js; a NumPy reference (Gemma 3)identical greedy tokens
BERT familyPython transformersscores equal to six decimals
Tokenizers, 31 repostransformers.js 4.3.2identical ids
Whispertransformers.jssame text, segments and word timestamps; features within 1.2e-7
ViT, DeiT, CLIPtransformers.js, same pixelsprobabilities within 2.2e-6
DETR, YOLOStransformers.js, same pixelssame detections, boxes within 2.3e-6
RMBG-1.4, SegFormer, Depth Anythingtransformers.js, same pixelsa few output bytes one level apart (at most 20 of 307,200)
OWLv2Python's documented output0.665 / 0.613 against 0.665 / 0.614, same boxes
Donut DocVQAtransformers.jssame answers to 8 questions on 5 pages
SmolVLMtransformers.js, same tilessame greedy replies in 17 runs
VITStransformers.js, noise off33,024 samples within 1.4e-4
LoRA adaptersNumPy, adapters mergedsame greedy tokens
Image preprocessingPIL + NumPyidentical pixel values

Some transformers.js exports differ from their models (Florence-2's attention scale, Kokoro's loudness, OWL models that fail to load in 4.3.2); the technical notes explain each case.

Setup