Speech recognition
Whisper tiny
Turns speech into text in about 99 languages, with timestamps, language detection and translation into English; OpenAI's Whisper tiny (39 million parameters), offline.
About this model
Whisper listens to speech and writes it down: give the session a recording and it returns the text, the language spoken and the text cut into timed segments. It knows about 99 languages, detects which one is spoken, and can also write English text from speech in another language. Recordings of any length work: Slab reads them in 30-second windows, each picking up where the last complete segment ended.
This is OpenAI's Whisper tiny, 39 million parameters trained on 680,000 hours of speech from the web; the smallest and fastest; English is usable, most other languages are rough (see Accuracy). The pack holds everything: the audio settings, the encoder, the decoder (attached in the same file) and the tokenizer. The app passes sound and gets text.
Slab follows openai-whisper's own transcription loop with greedy decoding: the same language detection, timestamp rules, silence skipping and 30-second windows. In our checks it gives the same text and timestamps as openai-whisper with the same settings.
What you can build
- Voice notes and dictation to text without a network connection
- Subtitles and captions with timestamps
- Minutes of meetings or interviews kept on the device
- Search inside recordings
- Read speech in French, Spanish, German and other widely spoken languages as English text
English, 45 seconds, with timestamps
f16LibriSpeech (Panayotov et al., from LibriVox public-domain audiobooks), CC BY 4.0, https://huggingface.co/datasets/hf-internal-testing/librispeech_asr_dummy
Detected language en, on Metal. Segments: 0.00 – 6.56 Mr. Quilter is the apostle of the middle classes, and we are glad to welcome his gospel. 6.56 – 11.24 Nor is Mr. Quilter's manner less interesting than his matter. 11.24 – 16.88 He tells us that at this festive season of the year, with Christmas and roast beef looming 16.88 – 23.76 before us, similarly drawn from eating and its results occur most readily to the mind. 23.76 – 29.44 He has grave doubts whether Sir Frederick Latins' work is really Greek after all, and 29.44 – 33.72 can discover in it but little of rocky ithaka. 33.72 – 40.32 Lennel's pictures are a sort of upguards and atom paintings and Mason's exquisite itels 40.32 – 44.64 are as national as a jingo poem. 44.64 – 45.04 Mr. Birch.
French
f16Google, FLEURS, CC BY 4.0, https://huggingface.co/datasets/google/fleurs
Detected language fr, on Metal: Les plages sont nombreuses car a au client d'état cheval sur deux ports. Les plus populaires se trouvent dans trois zones. The speaker's text: Les plages sont nombreuses, car Auckland est à cheval sur deux ports. Les plus populaires se trouvent dans trois zones.
French speech as English text
f16Google, FLEURS, CC BY 4.0, https://huggingface.co/datasets/google/fleurs
translate=True, on Metal: The shoulders are wide, because the upper body is full of support. The most popular is the 3rd.
Arabic
f16Google, FLEURS, CC BY 4.0, https://huggingface.co/datasets/google/fleurs
Detected language ar, on Metal: دشكلات في المهيد الأطلاص اليوم عشر عاصفة مسمي لموسي من العاصر الأطلاصية العاصفة شبه الاستوائية الجري The speaker's text: تشكلت في المحيط الأطلسي اليوم عاشر عاصفة مُسماة لموسم الأعاصير الأطلسية، العاصفة شبه الاستوائية جيري.
Variants & downloads
Choose the build for your appModel files are hosted on Google Drive. Large files may open a confirmation page before downloading.
Small
SlabWeights stored as int8 in blocks of 64, decoded to FP32 when loading: a smaller download, the same memory and speed. Word error rates within a few tenths of FP16; the exact words differ from upstream more often (see Accuracy).
Platforms: macos · android
whisper-tiny-int8.slab
43.8 MB · Hosted download
SHA-256 checksum
d42c7819278de005cae9e620b6c143f9f8e816a54bf3735f871d3be6700c5950LICENSE-Whisper.txt
1 KB
SHA-256 checksum
b5d65a59060e68c4ff940e1eddfa6f94b2d68fdf58ed7f4dd57721c997e35e9dConversion details
- command
- hf download openai/whisper-tiny --revision 169d4a4341b33bc18d8881c4b69c2e104e1cc0af --local-dir whisper-tiny --include "*.json" --include model.safetensors python - whisper-tiny <<'EOF' # Two graphs for decoding with a key/value cache. The encoder also gives # each decoder layer's cross-attention keys (transposed) and values; a step # takes one token, its position, the cache and an additive mask, and gives # the next token's logits and this token's keys and values. import sys, torch from transformers import WhisperForConditionalGeneration torch.set_grad_enabled(False) m = WhisperForConditionalGeneration.from_pretrained(sys.argv[1], attn_implementation="eager", dtype=torch.float32).eval() c = m.config; H = c.decoder_attention_heads; D = c.d_model; Dh = D // H; T = c.max_target_positions; L = c.decoder_layers class Enc(torch.nn.Module): def forward(self, input_features): h = self.m.model.encoder(input_features).last_hidden_state[0] a = [l.encoder_attn for l in self.m.model.decoder.layers] return (torch.stack([x.k_proj(h).view(-1, H, Dh).permute(1, 2, 0) for x in a]), torch.stack([x.v_proj(h).view(-1, H, Dh).transpose(0, 1) for x in a])) class Step(torch.nn.Module): def forward(self, input_ids, position_ids, self_k, self_v, mask, cross_k, cross_v): d = self.m.model.decoder x = d.embed_tokens(input_ids)[0] + d.embed_positions.weight[position_ids[0]] nk, nv = [], [] for i, l in enumerate(d.layers): a = l.self_attn; y = l.self_attn_layer_norm(x) q = (a.q_proj(y) * a.scaling).view(H, 1, Dh); k = a.k_proj(y).view(H, Dh, 1); v = a.v_proj(y).view(H, 1, Dh) nk.append(k); nv.append(v) p = torch.softmax(torch.cat([q @ self_k[i] + mask, q @ k], -1), -1) x = x + a.out_proj((p[:, :, :T] @ self_v[i] + p[:, :, T:] * v).reshape(1, D)) a = l.encoder_attn; y = l.encoder_attn_layer_norm(x) q = (a.q_proj(y) * a.scaling).view(H, 1, Dh) x = x + a.out_proj((torch.softmax(q @ cross_k[i], -1) @ cross_v[i]).reshape(1, D)) x = x + l.fc2(l.activation_fn(l.fc1(l.final_layer_norm(x)))) x = d.layer_norm(x) return (d.embed_tokens.weight @ x.t()).reshape(1, -1), torch.stack(nk), torch.stack(nv) enc = Enc(); enc.m = m; step = Step(); step.m = m torch.onnx.export(enc, (torch.zeros(1, c.num_mel_bins, 3000),), "encoder.onnx", input_names=["input_features"], output_names=["cross_k", "cross_v"], opset_version=17, dynamo=False) z = torch.zeros torch.onnx.export(step, (z(1, 1, dtype=torch.long), z(1, 1, dtype=torch.long), z(L, H, Dh, T), z(L, H, T, Dh), z(1, T), z(L, H, Dh, 1500), z(L, H, 1500, Dh)), "step.onnx", input_names=["input_ids", "position_ids", "self_k", "self_v", "mask", "cross_k", "cross_v"], output_names=["logits", "new_k", "new_v"], opset_version=17, dynamo=False) EOF slab-load convert encoder.onnx encoder.slab --input input_features=1x80x3000 slab-load convert step.onnx step.slab --input input_ids=1x1 --input position_ids=1x1 --input self_k=4x6x64x448 --input self_v=4x6x448x64 --input mask=1x448 --input cross_k=4x6x64x1500 --input cross_v=4x6x1500x64 slab-load quantize encoder.slab whisper-tiny-int8.slab slab-load quantize step.slab step-int8.slab slab-load tokenizer whisper-tiny-int8.slab whisper-tiny/tokenizer.json --pad "<|endoftext|>" slab-load speech whisper-tiny-int8.slab whisper-tiny slab-load meta set whisper-tiny-int8.slab default_backend.macos=gpu slab-load meta set step-int8.slab default_backend.macos=gpu slab-load attach whisper-tiny-int8.slab decoder step-int8.slab
Integration examples
Python
python
import slab
cfg = slab.Config(cache_dir="/tmp/slab_cache", license=open("license.slablic.txt").read())
asr = slab.Session(cfg, "whisper-tiny-f16.slab")
out = asr.run(slab.Input(audio=slab.Audio.open("speech.wav"))) # language detected
print(out.language, out.text)
for s in out.segments:
print(f"{s.start:6.2f} {s.end:6.2f} {s.text}")
# French speech as English text
out = asr.run(slab.Input(audio=slab.Audio.open("french.wav"), language="fr", translate=True))
print(out.text)
Device & backend compatibility
Pack default: macos / GPU. Faster than the CPU: the 5.86 s clip in 249 ms against 467 ms, the 8-minute recording in 11 s against 14 s. The encoder and decoder both use the GPU.
| Platform | Engine | Status | Precision |
|---|---|---|---|
| apple | CPU CPU | Supported Measured on macOS. | f32 |
| apple | Metal GPU | Supported Measured on macOS. The default. | f32 |
| apple | Apple Neural Engine NPU | Not supported The decoder takes token ids (int64), which Slab's Neural Engine path does not accept. | — |
| android | CPU CPU | Supported Measured on a Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2, Adreno 740), Android 17. | f32 |
| android | Vulkan GPU | Supported Measured on a Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2, Adreno 740), Android 17. | f32 |
Performance
Results depend on the device, runtime, and test conditions. Each measurement keeps its own context.
Mac with Apple M1 Max
Slab · GPU
macOS 26.6.2
265.0 ms
Measured time · scope below
Session.run on the clip, timestamps on: median of 5 warm runs (log-Mel, encoder, decoding and text included). An 8-minute recording: 11.0 s, 44x faster than real time. Peak memory after opening and one clip: 320 MB.
Mac with Apple M1 Max
Slab · CPU
macOS 26.6.2
470.0 ms
Measured time · scope below
Session.run on the clip, timestamps on: median of 5 warm runs (log-Mel, encoder, decoding and text included). An 8-minute recording: 14.4 s, 33x faster than real time. Peak memory after opening and one clip: 325 MB.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · CPU
Android 17
1.10 s
Measured time · scope below
Session.run on the clip, timestamps on: median of 5 warm runs (log-Mel, encoder, decoding and text included). open_ms: opening the session. Peak memory (resident) after the runs: 275 MB. A 45 s recording (the LibriSpeech example on this page): 3.1 s, 15x faster than real time.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · GPU
Android 17
1.21 s
Measured time · scope below
Session.run on the clip, timestamps on: median of 5 warm runs (log-Mel, encoder, decoding and text included). open_ms: opening the session with the GPU programs already in the cache folder (the first open on a device compiles them, about 0.3 s more). Peak memory (resident) after the runs: 257 MB. A 45 s recording (the LibriSpeech example on this page): 6.5 s, 7x faster than real time.
Accuracy checks
macos · GPU · int8
openai-whisper 20250625 with the same weights (greedy decoding: temperature 0, no fallback, no conditioning on previous text, FP32) on the 73 LibriSpeech clips (with and without timestamps) and the 30 FLEURS recordings (transcribed and translated)
The same text, segments, timestamps and language in 112 of 146 LibriSpeech runs and the same text and language in 24 of 60 FLEURS runs: int8 weights move some words and timestamps (see the error rates).
macos · GPU · int8
The human transcripts: the 73 LibriSpeech clips (Whisper's English text normalizer) and the 30 FLEURS recordings (lowercase, punctuation removed)
Word error rate 11.8% in English (1169 words). FLEURS: French 49%, Arabic 61%, Swahili 102%; language detected right in 9 of 10 Arabic, 10 of 10 French, 5 of 10 Swahili.
Before you choose this model
- Accuracy depends a lot on the language. In our sample the word error rate was French 50%, Arabic 61%, Swahili 100% (see Accuracy); low-resource languages are often unusable at this size.
- Translation writes English only, and only works for languages the model knows well: Arabic into English failed in our test for all three sizes.
- Slab decodes greedily and does not retry at higher temperatures as openai-whisper does by default; on hard audio the text can repeat a phrase.
- Like every Whisper, it can write text that was never said on music, noise or long silences; windows it judges silent are skipped.
- Audio.open reads WAV files; decode other formats in the app and pass samples with Audio.from_samples. Any sample rate and channel count; Slab mixes to mono and resamples to 16 kHz.
- Runs on the GPU or CPU: the decoder takes token ids, which Slab's Neural Engine path does not accept.
- Memory: about 341 MB on the GPU and 320 MB on the CPU with the pack open.