Moonshine Tiny — LiteRT
Moonshine Tiny is a
27M-parameter encoder-decoder speech-recognition model from Moonshine AI
(formerly Useful Sensors), introduced in
Moonshine: Speech Recognition for Live Transcription and Voice Commands.
It transcribes English speech and is designed for fast on-device inference.
This repository packages the model for LiteRT:
a float32 model, an int8 model (dynamic-range-quantized decoder with a
float32 encoder), and ahead-of-time compiled variants for a range of MediaTek
and Qualcomm SoCs so the model can run on the device NPU.
Model description
Each .tflite file contains two signatures that together form the
transcription loop:
- The audio frontend is inside the graph: the model takes a raw 16 kHz
waveform in
[-1, 1] — no mel-spectrogram extraction is needed.
- The window is fixed at 5 seconds. Longer audio is transcribed in
consecutive 5 s windows; shorter audio is zero-padded.
- Decoding is greedy: start token
1, EOS token 2, at most 64 tokens per
window. The decoder re-scores the full token buffer each step (no KV
cache), so decode time grows with the number of emitted tokens.
- The tokenizer is not duplicated in this repository — load
tokenizer.json
from the base model repository (see the script below).
Files
How to use
1. Install dependencies
2. Save the script below as transcribe.py:
3. Run it on a 16 kHz mono wav file:
Android sample app
For an on-device Android demo that runs Moonshine (and other ASR models) with
hardware acceleration, see the LiteRT
speech recognition sample.
Performance
Measured on one 5 s window of continuous speech (11 output tokens), CPU
inference, median of 10 runs. The macOS and Raspberry Pi rows use the Python
Interpreter API as in the script above (XNNPack, 4 threads,
ai-edge-litert 2.1.6); the iPhone rows use the LiteRT CompiledModel C API
with the CPU accelerator at default threading:
RTF = processing time / audio duration (lower is better; below 1.0 is faster
than real time). Decode dominates and scales with the number of emitted
tokens, so dense speech takes proportionally longer than sparse speech. The
i8 model's int8 decoder makes it about 1.6x faster than f32 on the Pi 5's
Cortex-A76; on Apple silicon (M4 Max, iPhone 17 Pro) the two are equally
fast. The greedy decode is deterministic across platforms: the same window
produces bit-identical f32 token sequences on all three devices, the i8
model reproduces the f32 token sequence exactly on the dense test window on
both Apple devices, and its transcripts are identical between the M4 Max
and the Pi 5 on all 12 test clips.
Accuracy note
In a 12-clip spot check (LibriSpeech dev-clean samples plus two
public-domain clips), the f32 model transcribes clips of up to 5 s at
near-reference quality, and the i8 model matches it: the same overall word
error rate on the 12-clip harness (within chunking noise), word-level
divergence from the f32 transcripts of 2.5%, and encoder output that is
bit-identical to f32 because the encoder is not quantized. The encoder is kept in float32
deliberately — the convolutional audio frontend on the raw waveform does not
survive dynamic-range quantization (an earlier fully-quantized i8 upload
degraded badly for exactly this reason) — while the decoder, which dominates
latency, carries the int8 weights.
For the source model's quality, the
Moonshine paper reports that Moonshine
Tiny matches Whisper tiny.en word error rates across standard evaluation
datasets at about 5x less compute.
License and attribution
The original Moonshine Tiny model is released by Moonshine AI under the MIT
license; these converted artifacts inherit it. If you use this model, please
cite: