FluidInference/qwen3-tts-coreml
342
Qwen3-TTS CoreML
CoreML conversion of Qwen/Qwen3-TTS (0.6B) for on-device inference on Apple platforms.
Supports English and Chinese text-to-speech synthesis.
Models
Total: ~5.9 GB
Pipeline
Text tokens + Speaker embedding
↓
LM Prefill (KV cache initialization)
↓
LM Decode (CB0 codec tokens, temperature=0.9, top_k=50)
↓
Code Predictor Prefill + Decode (CB1-15 per frame)
↓
Audio Decoder (16 codebooks → 24kHz waveform)
↓
Silence trimming → Final audioKey Parameters
- Sample rate: 24,000 Hz
- Codebooks: 16 (CB0 from LM, CB1-15 from code predictor)
- Max codec tokens: 125 frames (~10s audio)
- Sampling: temperature=0.9, top_k=50 (both CB0 and CB1-15)
- EOS token ID: 2150 (in codec logit space)
Usage
import FluidAudioTTS
let manager = Qwen3TtsManager()
try await manager.loadFromDirectory(modelDir)
let wav = try await manager.synthesize(
text: "Hello world",
tokenIds: [9707, 1879, ...], // Pre-tokenized with Qwen3 processor
useSpeaker: true
)See FluidAudio for the full Swift framework.
Conversion
Converted using coremltools from the original PyTorch weights. Conversion scripts are in the mobius repository.
License
Apache-2.0, inherited from Qwen/Qwen3-TTS.
