Show HN: Kiln – A WebGPU alternative to transformers.js, 2.2× faster (median) gi...

@show

Show HN: Kiln – A WebGPU alternative to transformers.js, 2.2× faster (median) github.com · 4 points · 0 comments · HN thread

TL;DR Kiln is an MIT-licensed JavaScript library, announced as a Show HN, that runs language, vision and speech models in the browser on WebGPU directly from their original safetensors, pytorch_model.bin or GGUF weights. The author reports a median 2.2× end-to-end speed-up over transformers.js across 31 task and model pairs, measured on a 2017 Intel Mac. The thread had no comments at the time of capture.

  • Loads original weights from the Hugging Face Hub or a custom endpoint and quantizes to 4-bit or 8-bit at load time, avoiding ONNX export and conversion.
  • Uses transformers.js-style API names (pipeline, AutoTokenizer, AutoModel, TextStreamer), so existing code can often switch by changing the import and model id.
  • Reports being faster than transformers.js on all 31 tested task and model pairs, median 2.2×, with outputs checked against transformers.js or Python; slower cases listed include cached loads, 4-bit download size and masked-LM logits.
  • Ships as a single 241 KB gzipped ES module with no runtime dependencies, usable from a CDN, with a CPU (WASM SIMD) fallback when WebGPU is absent.
  • Requires a WebGPU-capable browser for full speed: current Chrome or Edge, Safari 26+, or Firefox 141+ on Windows.
  • Supports many tasks including chat, embeddings, ASR, TTS, object detection and structured JSON/regex-constrained output; the default background-removal model RMBG-1.4 is non-commercial only.

Discussion The thread has no comments yet, so there is no discussion to summarize; the post had only 4 points at capture time.

#WebGPU #browserML #transformersjs #inference #opensource #llm