← All models

automatic-speech-recognition · audio · WASM (WebGPU when available) · ~172 MB

Distil-Whisper — the same Whisper, distilled to run faster

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.

At a glance

Modeldistil-whisper/distil-small.en (distilled from whisper-small, English-only)
Task / pipelineautomatic-speech-recognition
ArchitectureWhisper 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
Quantizationq8 (8-bit) ONNX — the *_quantized.onnx encoder + merged decoder
BackendWebAssembly (WebGPU when a real adapter is present), honest fallback
Download~172 MB (encoder ~92 MB + merged decoder ~80 MB), cached after first load
LicenseMIT (Distil-Whisper, HuggingFace)
Web APIsWebAssembly / WebGPU, Web Workers, Web Audio (decode + resample), MediaRecorder (mic)

Run it

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.

or a sample:
JFK — inaugural (11s)

Transcript

Transcribe a clip to see the text here.

See inside — speed & the timestamped segments

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.

Transcribe a clip to see its speed profile and segments.

Why it matters

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.

Use cases

Basics

One clip in, a transcript out — with the speed-up over real time front and centre.

Practical

Batch transcription: queue several clips and transcribe them all, timed.

Wild

Speed race: transcribe the same clip and watch the real-time factor climb.

Multi-model

Transcribe → an on-device LLM summarises what was said.

How the API works

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.

References