Skip to main content
Back

OpenAI's Whisper Tiny Now Runs Speech Recognition Directly in Your Browser

A 75MB ONNX build of OpenAI's smallest Whisper model lets you run multilingual speech recognition entirely in the browser with Transformers.js.

Pro

  • Xenova/whisper-tiny ships OpenAI Whisper tiny as ONNX weights for Transformers.js, hitting 870K downloads.
  • Runs fully in the browser, no server, roughly 75MB quantized, Apache-2.0 licensed and free.
  • Three-line pipeline API returns transcripts and optional segment timestamps for SRT generation.
  • Supports around 100 languages plus translation to English via the underlying Whisper checkpoint.
  • Companion whisper-web project adds experimental WebGPU acceleration for near real-time transcription.
  • Best for interactive, privacy-first UIs; step up to larger Whisper variants for accuracy-critical work.

Browser speech-to-text has often depended on sending audio to a hosted endpoint and waiting for the response. The Xenova/whisper-tiny repository packages OpenAI’s smallest multilingual Whisper checkpoint as ONNX files that Transformers.js can load in a web page or JavaScript runtime. Its model page has passed 3,300 likes, shows roughly 870,000 downloads, and appears in more than 65 Hugging Face Spaces.

Developers get a speech-recognition model distributed as static assets, with no inference server required. Once those assets are available locally, an application can transcribe without a network request, per-minute API charge, or third-party audio upload.

Inside the conversion

The repository converts the OpenAI checkpoint to ONNX, a portable model format supported by browser and server runtimes. The conversion preserves Whisper’s architecture and learned parameters while adding quantized encoder and decoder files, tokenizer data, processor configuration, and the directory structure expected by Transformers.js.

OpenAI trained Whisper Tiny, a roughly 39-million-parameter encoder-decoder transformer, on 680,000 hours of weakly supervised audio. The encoder turns an audio spectrogram into an internal representation, and the decoder generates text tokens from it. The multilingual checkpoint can transcribe speech in roughly 100 languages and translate supported non-English speech into English.

The repository is marked Apache-2.0, which permits commercial use, modification, and redistribution subject to the license terms.

From install to transcript

A bundler-based application can install the current package with npm i @huggingface/transformers and create an automatic speech-recognition pipeline:

import { pipeline } from '@huggingface/transformers';

const transcriber = await pipeline(
  'automatic-speech-recognition',
  'Xenova/whisper-tiny',
);

const result = await transcriber('/audio/jfk.wav', {
  return_timestamps: true,
});

// {
//   text: " And so my fellow Americans...",
//   chunks: [
//     { timestamp: [0, 4.2], text: " And so my fellow Americans..." }
//   ]
// }

Setting return_timestamps: true returns transcript chunks with start and end times, which can feed subtitle and SRT generators. Supported releases also accept return_timestamps: 'word' for word-level timing. Long recordings can use options such as chunk_length_s and stride_length_s to split audio into overlapping windows.

The first run downloads the encoder, decoder, and supporting files. Transformers.js can reuse those bytes from the browser cache on later visits, although model initialization still takes time. A typical quantized payload is around 75 MB, with the exact transfer determined by the selected files and runtime version.

Remote media must allow cross-origin requests. Applications can avoid that dependency by hosting audio on the same origin or decoding a local upload into the waveform format expected by the pipeline. Offline operation requires the model assets and application code to be cached or bundled in advance.

Choose the runtime deliberately

Target Execution path Practical consideration
Browser WebAssembly Broad compatibility, with speed tied to CPU performance.
Supported browser and GPU WebGPU Faster inference on compatible hardware; results vary by browser, driver, and model configuration.
Web Worker WebAssembly or WebGPU Keeps model initialization and inference away from the interface thread.
Node or Electron Local JavaScript runtime Useful for desktop tools, command-line workflows, and local services.
Deno or Bun Runtime-dependent backend Compatibility should be tested against the chosen package release and deployment target.

Production deployments commonly pin the package and model revision, move inference into a worker, set long-lived cache headers, and self-host the ONNX files when content-security policy or third-party availability requires it. The companion whisper-web demo shows WebGPU acceleration approaching real-time transcription on some laptop GPUs.

Why the tiny build travels

  • Manageable download: The quantized model is small enough for focused web applications, extensions, and desktop bundles.
  • Local audio handling: The transcription pipeline can run without sending recordings to an inference provider. Application telemetry and storage still need separate privacy controls.
  • Predictable cost: Inference uses the user’s hardware and carries no per-minute API fee.
  • Flexible deployment: The ONNX assets can serve browser, worker, Node, and Electron applications.
  • Responsive interaction: Short clips can return quickly enough for dictation, commands, captions, and prototypes on suitable hardware.

Accuracy sets the boundary

The 39-million-parameter checkpoint is the least accurate model in the multilingual Whisper lineup. It performs best on clear speech, short clips, and controlled recording conditions. Heavy accents, overlapping speakers, background noise, specialist vocabulary, and low-quality microphones increase transcription errors. Accuracy also varies substantially by language.

Whisper processes audio in windows, so live-caption applications usually simulate streaming by transcribing successive chunks. The model does not identify speakers, and its timestamps may need adjustment for frame-accurate subtitles. Like other Whisper checkpoints, it can generate plausible text during silence or noise; voice-activity detection and rejection rules can reduce those false transcripts.

Applications handling interviews, podcasts, medical notes, or legal records should benchmark representative recordings against base, small, and larger checkpoints. Useful measurements include word error rate, which counts inserted, deleted, and substituted words, and real-time factor, which divides processing time by audio duration. Consequential transcripts still require human review.

What developers are shipping

The dependent Hugging Face Spaces show where a compact local model fits:

  • Voice notes and dictation inside web applications.
  • Local SRT and subtitle generation for uploaded media.
  • Browser extensions that transcribe meeting audio.
  • Live captions for educational and accessibility tools.
  • Voice-command interfaces for games and prototypes.
  • Offline transcription in Electron desktop applications.

These products benefit from a model that can ship with the interface and run on the user’s hardware. Tiny’s size and latency make that architecture practical, while its accuracy limits define which transcripts can be used without escalation to a larger model or hosted service.

Put ONNX beside the source

The model card describes separate Xenova conversion repositories as a temporary distribution pattern while browser machine-learning tooling matures. The recommended layout keeps ONNX files in an onnx/ subdirectory of the original model repository, allowing Python and JavaScript clients to use one model ID.

Teams publishing their own browser-ready models can export supported architectures with Optimum, include the tokenizer and processor files, choose and document the quantization format, and compare ONNX outputs against the source checkpoint. Pinning revisions prevents an upstream file change from altering a deployed application unexpectedly.

Until original model repositories consistently include compatible browser assets, Xenova/whisper-tiny remains a short route from npm install to client-side speech recognition.