automatic-speech-recognition · audio · WASM (WebGPU when available) · ~172 MB
Distil-Whisper is Whisper with its decoder shrunk by distillation: it keeps the full Whisper encoder but runs far fewer decoder layers, so it writes the transcript in less wall-clock time at close accuracy (English-only). Same seq2seq model, same timestamps — just fewer passes per token. Record, drop a file, or pick a sample and watch the real-time factor.
| Model | distil-whisper/distil-small.en (distilled from whisper-small, English-only) |
|---|---|
| Task / pipeline | automatic-speech-recognition |
| Architecture | Whisper encoder-decoder transformer, knowledge-distilled: 12 encoder layers kept, decoder cut to 4 layers (whisper-small has 12). ~166M params, 80-bin log-Mel input → text tokens |
| Quantization | q8 (8-bit) ONNX — the *_quantized.onnx encoder + merged decoder |
| Backend | WebAssembly (WebGPU when a real adapter is present), honest fallback |
| Download | ~172 MB (encoder ~92 MB + merged decoder ~80 MB), cached after first load |
| License | MIT (Distil-Whisper, HuggingFace) |
| Web APIs | WebAssembly / WebGPU, Web Workers, Web Audio (decode + resample), MediaRecorder (mic) |
Choose audio — record from your mic, upload a file, or pick a sample. The page decodes it to 16 kHz mono (what Whisper models expect), draws the waveform, and transcribes it in a Web Worker. The headline number is speed: how much faster than real time it ran.
This context didn't grant mic access (common in headless / embedded views). Distil-Whisper still works — use a sample above or Upload audio. For live recording, open this in a normal browser tab and allow the microphone when prompted.
Two things distinguish Distil-Whisper from plain Whisper here. First, speed: the real-time factor (process time ÷ audio length) and the derived speed-up — the distilled 4-layer decoder does the same job in fewer passes. Second, it still emits timestamped segments like Whisper (seq2seq keeps that), unlike a CTC model. Everything below is measured on this device.
| Start | End | Segment |
|---|
Whisper is accurate but its decoder runs a full stack of layers for every token, which costs time on-device. Distil-Whisper trades a little breadth (English-only, distilled) for markedly faster wall-clock transcription — the same private, offline, no-upload capability, but snappier for captions and batch jobs.
One clip in, a transcript out — with the speed-up over real time front and centre.
Batch transcription: queue several clips and transcribe them all, timed.
Speed race: transcribe the same clip and watch the real-time factor climb.
Transcribe → an on-device LLM summarises what was said.
It's the exact same pipeline call as Whisper — only the model id changes:
import { pipeline } from "@huggingface/transformers";
const transcribe = await pipeline(
"automatic-speech-recognition",
"distil-whisper/distil-small.en", // distilled: fewer decoder layers, English-only
{ device: "wasm", dtype: "q8" }, // WebGPU when a real adapter exists
);
// audio = a 16 kHz mono Float32Array (decode with Web Audio, then resample)
const out = await transcribe(audio, {
return_timestamps: true, // segment-level timings — seq2seq keeps them
chunk_length_s: 20,
stride_length_s: 3,
});
// out.text → the transcript
// out.chunks → [{ text, timestamp: [start, end] }, …]
This page decodes the mic/file/sample to 16 kHz mono with the Web Audio API on the main thread, then transfers just the Float32 samples to a Web Worker where the pipeline runs — so the model never blocks the interface. It times the call and divides by the clip length for a real real-time factor. Because it's still Whisper under the hood, the API surface is identical — you swap the model id and get a faster, English-only transcriber.