Cache-aware
streaming multilingual speech recognition. A 0.6 B FastConformer-RNNT
encoder with a 128-slot
language prompt, exported to ONNX with
dynamic INT8 encoder
weights (per-channel QInt8). This is the
smallest, fastest, lowest-RAM CPU build — at a
modest, uneven quality cost (see below). For best quality across all languages, use the
FP16 build.
Resource profile (8.4 s utterance, ONNX Runtime CPU): encoder ~45 ms/chunk (RTF ~0.14),
peak RSS ~1.2 GB — roughly 1.9× faster and ~half the RAM of FP32 on CPU.
1import onnxruntime as ort
2
3so = ort.SessionOptions()
4enc = ort.InferenceSession("encoder.onnx", so, providers=["CPUExecutionProvider"])
5dec = ort.InferenceSession("decoder.onnx", so, providers=["CPUExecutionProvider"])
6joint = ort.InferenceSession("joint.onnx", so, providers=["CPUExecutionProvider"])
7
8# Pick the language prompt slot from languages.json, e.g. "en-US" -> 0, "ja-JP" -> 10.
9# Front end: 128-bin log-mel (n_fft=512, win=400, hop=160, preemph=0.97), 16 kHz mono.
10# Streaming contract (per chunk): feed 320 ms of audio + the carried encoder caches
11# (attention / conv / pre-cache), then run the RNN-T greedy loop over the 4 emitted frames.
Production streaming, cache management and RNN-T greedy decoding are handled by the
speech-android SDK.