Speech recognition
Whisper base
Turns speech into text in about 99 languages, with timestamps, language detection and translation into English; OpenAI's Whisper base (74 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 base, 74 million parameters trained on 680,000 hours of speech from the web; a middle ground: fast on the GPU, clearly better than tiny, still rough in many languages. 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.36 Mr. Quilter is the apostle of the middle classes, and we are glad to welcome his gospel. 6.36 – 11.28 Nor is Mr. Quilter's manner less interesting than his matter. 11.28 – 16.84 He tells us that at this festive season of the year, with Christmas and roast beef looming 16.84 – 23.80 before us, similarly he's drawn from eating and its results occur most readily to the mind. 23.80 – 29.40 He has graved doubts whether Sir Frederick Layton's work is really Greek after all, and 29.40 – 33.60 can discover in it but little of Rocky Ithaca. 33.60 – 39.80 Linels pictures are a sort of up guards and atom paintings, and Mason's exquisite 39.80 – 44.60 ittles are as national as a jingo poem. 44.60 – 45.10 Mr. Burr.
French
f16Google, FLEURS, CC BY 4.0, https://huggingface.co/datasets/google/fleurs
Detected language fr, on Metal: Les plages sont nombreuses, car Aocland est à cheval sur deux portes. Les plus populaires se trouvent dans 3 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 beaches are huge because Aocland is on both sides of the mountain. The most popular are in 3 zones.
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-base-int8.slab
80.2 MB · Hosted download
SHA-256 checksum
d1218a8b3ac3bee59f4a7e4a2dc8a88392bfacae1f22268a6f3d3807fb122298LICENSE-Whisper.txt
1 KB
SHA-256 checksum
b5d65a59060e68c4ff940e1eddfa6f94b2d68fdf58ed7f4dd57721c997e35e9dConversion details
- command
- hf download openai/whisper-base --revision e37978b90ca9030d5170a5c07aadb050351a65bb --local-dir whisper-base --include "*.json" --include model.safetensors python - whisper-base <<'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=6x8x64x448 --input self_v=6x8x448x64 --input mask=1x448 --input cross_k=6x8x64x1500 --input cross_v=6x8x1500x64 slab-load quantize encoder.slab whisper-base-int8.slab slab-load quantize step.slab step-int8.slab slab-load tokenizer whisper-base-int8.slab whisper-base/tokenizer.json --pad "<|endoftext|>" slab-load speech whisper-base-int8.slab whisper-base slab-load meta set whisper-base-int8.slab default_backend.macos=gpu slab-load meta set step-int8.slab default_backend.macos=gpu slab-load attach whisper-base-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-base-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 330 ms against 874 ms, the 8-minute recording in 13 s against 29 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
315.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: 13.2 s, 36x faster than real time. Peak memory after opening and one clip: 515 MB.
Mac with Apple M1 Max
Slab · CPU
macOS 26.6.2
855.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: 29.7 s, 16x faster than real time. Peak memory after opening and one clip: 544 MB.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · CPU
Android 17
2.33 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: 460 MB. A 45 s recording (the LibriSpeech example on this page): 8.0 s, 6x faster than real time.
Samsung Galaxy S23 Ultra (Snapdragon 8 Gen 2)
Slab · GPU
Android 17
1.93 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: 432 MB. A 45 s recording (the LibriSpeech example on this page): 9.8 s, 5x 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 127 of 146 LibriSpeech runs and the same text and language in 28 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 8.8% in English (1169 words). FLEURS: French 28%, Arabic 44%, Swahili 97%; language detected right in 10 of 10 Arabic, 10 of 10 French, 8 of 10 Swahili.
Before you choose this model
- Accuracy depends a lot on the language. In our sample the word error rate was French 29%, Arabic 43%, Swahili 97% (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 551 MB on the GPU and 575 MB on the CPU with the pack open.