Kokoro-82M — Apple Neural Engine (NeuRT)

Kokoro-82M converted for the Apple Neural Engine and packaged as a NeuRT bundle. Served through the RunAnywhere SDK's SYNTHESIZE primitive (tts_ops) on iOS and macOS.

  • Base model: hexgrad/Kokoro-82M
  • Sample rate: 24 kHz · Voice: af_heart (one voice in this bundle)
  • Buckets: 96 phonemes, 216 frames — static shapes, as the ANE requires

Shape: three graphs, two host seams

Graph Role
duration phonemes + style → per-phoneme durations
decode aligned features → mel
gen mel + harmonic source → waveform

Two steps are not expressible as ANE ops and run on the host: the duration→alignment expansion, and the harmonic source generator. A byte-level G2P lexicon (178k entries) and a 114-phoneme vocab ship alongside, so no Python phonemizer is needed at runtime.

The harmonic seam has one trap worth stating, because it produces fluent, wrong audio: the phase accumulator is x - floor(x), not fmod(x, 1). torch's % is remainder (always non-negative); C's fmod keeps the dividend's sign, and Kokoro's F0 goes negative (min −3.99). Using fmod yields speech that sounds plausible but is 2π out of phase on every negative-F0 frame — complex-plane error 1.56 versus 1.1e-4 once corrected.

Kokoro also declares float32 in, float16 out. Writing fp16 into fp32 buffers runs cleanly and produces audio correlating 0.0035 with the reference.

Measured, on an M4 Max

Five gold utterances, mel distance (lower is better):

this bundle 0.2832 – 0.3159
14.0 – 26.0× realtime no NaNs, durations exact

Calibration on the same metric and audio: fp16 round-trip 0.0012, one-sample shift 0.0025, ×1.02 amplitude 0.0178, upstream Kokoro's own real-op CustomSTFT against its complex path 0.289, and two different utterances 2.63 – 2.71. Tolerance is 0.60. So this sits at upstream's own STFT floor — roughly 9× below "different utterance" — which is the vocoder's floor rather than conversion loss.

Use

let audio = try await RunAnywhere.tts.synthesize("Hello from the Neural Engine")

Requires RunAnywhere SDK ≥ 0.20.33, the release that fills NeuRT's tts_ops slot.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for runanywhere/Kokoro-82M_ANE

Quantized
(63)
this model