Inflect-Nano-v2 — LiteRT (.tflite) export
A LiteRT export of owensong/Inflect-Nano-v2,
a small English text-to-speech model. Upstream ships the canonical PyTorch model and a
verified ONNX package, but its docs/EXPORTS.md lists TFLite as "Not released" — this
repository fills that gap with a working, target-validated LiteRT conversion for on-device use
(Raspberry Pi 5 and similar).
The export mirrors the upstream two-stage decomposition (the same split as the official ONNX
duration + decode graphs):
| File | Stage | Precision | Size |
|---|---|---|---|
inflect_text_encoder.tflite |
text → acoustic distribution | fp32 | 3.5 MB |
inflect_decoder.tflite |
distribution + noise → waveform | fp32 | 12.6 MB |
inflect_text_encoder_fp16.tflite |
text → acoustic distribution | fp16 | 1.8 MB |
inflect_decoder_fp16.tflite |
distribution + noise → waveform | fp16 | 6.4 MB |
Why a separate LiteRT export
Light streaming TTS is often assumed to be non-convertible to LiteRT because of data-dependent output shapes. Exporting the decoder with a fixed chunk size (streaming already operates on fixed-size chunks) sidesteps that: each stage becomes a static graph. Measured on a Raspberry Pi 5: RTF ~0.11, ~225 ms per sentence, bit-exact against the PyTorch reference, streaming within a sentence.
Usage
These are the acoustic graphs only. The non-neural English text frontend (espeak-ng phonemizer,
GPL-3.0, run in-process) is not included here — it is not embedded in the graphs, same as the
upstream ONNX package. A runnable reference (say.py + frontend) ships with the
LiteRT reachy voice-robot sample,
which downloads these weights automatically.
from ai_edge_litert.interpreter import Interpreter
enc = Interpreter(model_path="inflect_text_encoder.tflite", num_threads=4)
dec = Interpreter(model_path="inflect_decoder.tflite", num_threads=4)
# see say.py in the sample for the full encoder -> duration expansion -> decoder pipeline
Attribution & license
- Model, weights, and architecture: © the Inflect-Nano-v2 authors, released under
Apache-2.0 at
owensong/Inflect-Nano-v2. - This repository redistributes a LiteRT conversion of those weights under the same
Apache-2.0 license (see
LICENSE). No model weights were retrained or altered beyond format conversion and fixed-shape graph export. - The text frontend (espeak-ng) is GPL-3.0 and is not part of this repository.