Views
No views yet
| Variant | LLM | DiT | Total | Use case |
|---|---|---|---|---|
| This bundle (4-bit) | int4 (group_size=64) | int4 | ~1.1 GB | Smaller download / disk footprint |
| 8-bit | int8 (group_size=64) | int4 | ~1.4 GB | Perceptually cleaner audio, less text drift on long form |
| Component | Architecture | Size |
|---|---|---|
| LLM | Qwen2.5-0.5B (24L, 896d, 14Q/2KV heads) | 388 MB (4-bit) |
| DiT Flow Matching | 22-layer DiT (1024d, 16 heads, 10 ODE steps) | 186 MB (4-bit) |
| HiFi-GAN Vocoder | NSF + F0 predictor + ISTFT | 79 MB (fp32) |
| S3-Tokenizer-v3 | 12-layer Conformer + FSMN + FSQ (242M params) | 462 MB (bf16) |
| Total | ~1.1 GB |
Text ─┐
├─► LLM (Qwen2.5-0.5B int4) ─► Speech tokens (FSQ 6561)
Ref transcript ┘ │
▼
┌─► prompt_token ─┐
Reference WAV ─► S3-Tokenizer-v3 ├─► DiT Flow Matching ─► Mel
─► Matcha mel ─► prompt_feat ─┘ (cond + spk_emb) │
─► CAM++ ─► flow_embedding ▼
HiFi-GAN
│
▼
Audio (24 kHz)llm.safetensors — LLM weights (4-bit group-quantised)flow.safetensors — DiT flow matching decoder (4-bit DiT, fp32 input/output projections)hifigan.safetensors — HiFi-GAN vocoder (fp32, weight-norm folded)speech_tokenizer.safetensors — S3-Tokenizer-v3 reference encoder (bf16)config.json — Model configuration (quantisation bits, tokenizer + frame rates)vocab.json / merges.txt / tokenizer_config.json — Qwen2.5 BPE tokenizerw = g * v / ||v||)[out, in, kernel] to MLX [out, kernel, in]inference_zero_shot feeds the LLM concat(prompt_text, content_text) plus the reference's FSQ codes as autoregressive prefix; this bundle ships everything you need for that path.1import CosyVoiceTTS
2
3let model = try await CosyVoiceTTSModel.fromPretrained() // defaults to this 4-bit bundle
4
5let refAudio = try AudioFileLoader.load(
6 url: URL(fileURLWithPath: "ref.wav"), targetSampleRate: 16_000)
7let cacheDir = try HuggingFaceDownloader.getCacheDirectory(
8 for: "aufklarer/CosyVoice3-0.5B-MLX-4bit")
9let tokenizer = try SpeechTokenizerModel.fromSafetensors(
10 at: cacheDir.appendingPathComponent("speech_tokenizer.safetensors"))
11
12let profile = try model.extractVoiceProfile(
13 audio: refAudio, sampleRate: 16_000,
14 speechTokenizer: tokenizer,
15 referenceTranscript: "Transcript of the reference clip."
16)
17
18let audio = model.synthesize(
19 text: "Welcome to the demo.",
20 voiceProfile: profile,
21 language: "english"
22)1audio speak "Welcome to the demo." \
2 --engine cosyvoice \
3 --voice-sample ref.wav \
4 --cosy-reference-transcript "Transcript of ref.wav..." \
5 --output out.wav1@article{du2025cosyvoice3,
2 title={CosyVoice 3: Towards In-the-wild Speech Generation via Scaling-up and Post-training},
3 author={Du, Zhihao and others},
4 journal={arXiv preprint arXiv:2505.17589},
5 year={2025}
6}