Core AI model zoo

Chatterbox TTS — zero-shot voice cloning, text→speech on iPhone (Core AI port notes)

Verified engineering notes from porting ResembleAI/chatterbox to Core AI. This is the zoo’s first zero-shot voice-cloning TTS and its first multi-network generative-audio pipeline proven end-to-end on iPhone: text goes in, a language model + a flow-matching decoder + a neural vocoder all run on the A19 GPU, ~2 s of compute yields 2.16 s of audio, no server.

The model is four networks + host DSP

net role Core AI form
T3 AR speech-token LM (Llama_520M, embeds-in) int8 stateful graph, KV cache
S3Gen encoder speech tokens → mel-conditioning mu (UpsampleConformer + proj) static graph (bucketed)
S3Gen estimator CFM flow-matching velocity UNet1D (CFG batch-2) fp16 static graph (bucketed)
HiFT vocoder: f0-predictor + HnNSF source + conv trunk f0-predictor graph + trunk graph + host STFT/iSTFT/source

The host (Swift) assembles all embeddings, runs the CFM Euler loop, and does the vocoder source + STFT/iSTFT (the FFT/rand ops don’t lower) — the Kokoro compute_har idiom, generalized.

Gates (all PASS, A19 GPU vs Mac/HF)

Findings worth keeping

Reproduce

cd coreai-models   # chatterbox installed in the venv (uv pip install chatterbox-tts)
V=.venv/bin/python; C=../coreai-models-community/conversion/chatterbox
$V $C/oracle_chatterbox.py                    # text+ref → wav + intermediates (reference)
$V $C/export_chatterbox_t3.py                 # T3 int8 embeds-in stateful graph
$V $C/export_chatterbox_s3gen.py              # encoder + CFM estimator + HiFT trunk
$V $C/export_chatterbox_hostdata.py           # embed tables, cond prefix, default-voice conditioning
# fp16 estimator + bucketed encoder@256 / estimator@512 / f0@256 / hift_trunk@256 + f0 ELU-swap:
#   see the session notes; all are export_to_coreai(...) with a padded static shape.

On-device: PipelinedBench env flags drive the headless gates — PB_CHATTERBOX (estimator), PB_CHATTERBOX_VOC (mel→wav), PB_CHATTERBOX_FULL (tokens→wav), PB_CHATTERBOX_T3 (T3 prefill+decode), PB_CHATTERBOX_SPEAK (text→wav end-to-end). Sideload the graphs + host-data (.bin) to Documents/models/; the run writes Documents/cbx_speak.f32 to pull back and play.

The nn.ELU→manual and reflection_pad fixes live in the export reconstructions; the CFG + sampling