run_basic.py # fast way to try model, basic configuration
run.py # inference with fp16, trt flow part and torch.compile (take time for compiling)
run_fast.py # inference with fp16, trt flow part, trt llm (take time for converting)
run_offline.py # inference in offline mode with long text
run_instruct.py # inference exaples with instructions
benchmark_llm.py # benchmark llm module in different configurations
Any questions you can discuss with author in Telegram
TTFB - latency to first chunk of speech
RTF - inference time / output speech duration
| RTX 3090 + Ryzen 7 3700x + WSL | Configuration | TTFB | RTF |
|---|---|---|---|
| run_basic.py | stream + basic | 1.767 sec | 0.930 |
| run.py | stream + fp16 + TRT Flow + torch.compile | 0.797 sec | 0.442 |
| run_fast.py | stream + fp16 + TRT Flow + TRT LLM | 0.470 sec | 0.245 |
| run_offline.py | offline + fp16 + TRT Flow + TRT LLM | - | 0.1 |
| RTX 5060ti + Ryzen 9 7900 + Linux | Configuration | TTFB | RTF |
|---|---|---|---|
| run_basic.py | stream + basic | 0.719 sec | 0.548 |
| run.py | stream + fp16 + TRT Flow + torch.compile | 0.358 sec | 0.215 |
| run_fast.py | stream + fp16 + TRT Flow + TRT LLM | 0.376 sec | 0.203 |
| run_offline.py | offline + fp16 + TRT Flow + TRT LLM | - | 0.127 |
Use + before stressed letter. + will be auto converted to \u0301.
Added auto_stress (default False) parameter with silero-stress for Russian language. But it works strange when you have stress mark in every word.
For better performance, only mark stress in homographs and mispronounced words.
uv add git+https://github.com/Brakanier/FastCosyVoice.git
Clone the repo
git clone https://github.com/Brakanier/FastCosyVoice.git
uv sync
Original way:
Install Conda: please see https://docs.conda.io/en/latest/miniconda.html
Create Conda env:
conda create -n cosyvoice -y python=3.10
conda activate cosyvoice
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
# If you encounter sox compatibility issues
# ubuntu
sudo apt-get install sox libsox-dev
# centos
sudo yum install sox sox-devel
Fun-CosyVoice 3.0: Demos; Paper; Modelscope; Huggingface; CV3-Eval
CosyVoice 2.0: Demos; Paper; Modelscope; HuggingFace
CosyVoice 1.0: Demos; Paper; Modelscope; HuggingFace
Fun-CosyVoice 3.0 is an advanced text-to-speech (TTS) system based on large language models (LLM), surpassing its predecessor (CosyVoice 2.0) in content consistency, speaker similarity, and prosody naturalness. It is designed for zero-shot multilingual speech synthesis in the wild.
2025/12
2025/08
2025/07
2025/05
2024/12
2024/09
2024/08
2024/07
| Model | Open-Source | Model Size | test-zh CER (%) β | test-zh Speaker Similarity (%) β | test-en WER (%) β | test-en Speaker Similarity (%) β | test-hard CER (%) β | test-hard Speaker Similarity (%) β |
|---|---|---|---|---|---|---|---|---|
| Human | - | - | 1.26 | 75.5 | 2.14 | 73.4 | - | - |
| Seed-TTS | β | - | 1.12 | 79.6 | 2.25 | 76.2 | 7.59 | 77.6 |
| MiniMax-Speech | β | - | 0.83 | 78.3 | 1.65 | 69.2 | - | - |
| F5-TTS | β | 0.3B | 1.52 | 74.1 | 2.00 | 64.7 | 8.67 | 71.3 |
| Spark TTS | β | 0.5B | 1.2 | 66.0 | 1.98 | 57.3 | - | - |
| CosyVoice2 | β | 0.5B | 1.45 | 75.7 | 2.57 | 65.9 | 6.83 | 72.4 |
| FireRedTTS2 | β | 1.5B | 1.14 | 73.2 | 1.95 | 66.5 | - | - |
| Index-TTS2 | β | 1.5B | 1.03 | 76.5 | 2.23 | 70.6 | 7.12 | 75.5 |
| VibeVoice-1.5B | β | 1.5B | 1.16 | 74.4 | 3.04 | 68.9 | - | - |
| VibeVoice-Realtime | β | 0.5B | - | - | 2.05 | 63.3 | - | - |
| HiggsAudio-v2 | β | 3B | 1.50 | 74.0 | 2.44 | 67.7 | - | - |
| VoxCPM | β | 0.5B | 0.93 | 77.2 | 1.85 | 72.9 | 8.87 | 73.0 |
| GLM-TTS | β | 1.5B | 1.03 | 76.1 | - | - | - | - |
| GLM-TTS RL | β | 1.5B | 0.89 | 76.4 | - | - | - | - |
| Fun-CosyVoice3-0.5B-2512 | β | 0.5B | 1.21 | 78.0 | 2.24 | 71.8 | 6.71 | 75.8 |
| Fun-CosyVoice3-0.5B-2512_RL | β | 0.5B | 0.81 | 77.4 | 1.68 | 69.5 | 5.44 | 75.0 |
We strongly recommend that you download our pretrained Fun-CosyVoice3-0.5B CosyVoice2-0.5B CosyVoice-300M CosyVoice-300M-SFT CosyVoice-300M-Instruct model and CosyVoice-ttsfrd resource.
# modelscope SDK model download
from modelscope import snapshot_download
snapshot_download('FunAudioLLM/Fun-CosyVoice3-0.5B-2512', local_dir='pretrained_models/Fun-CosyVoice3-0.5B')
snapshot_download('iic/CosyVoice2-0.5B', local_dir='pretrained_models/CosyVoice2-0.5B')
snapshot_download('iic/CosyVoice-300M', local_dir='pretrained_models/CosyVoice-300M')
snapshot_download('iic/CosyVoice-300M-SFT', local_dir='pretrained_models/CosyVoice-300M-SFT')
snapshot_download('iic/CosyVoice-300M-Instruct', local_dir='pretrained_models/CosyVoice-300M-Instruct')
snapshot_download('iic/CosyVoice-ttsfrd', local_dir='pretrained_models/CosyVoice-ttsfrd')
# for oversea users, huggingface SDK model download
from huggingface_hub import snapshot_download
snapshot_download('FunAudioLLM/Fun-CosyVoice3-0.5B-2512', local_dir='pretrained_models/Fun-CosyVoice3-0.5B')
snapshot_download('FunAudioLLM/CosyVoice2-0.5B', local_dir='pretrained_models/CosyVoice2-0.5B')
snapshot_download('FunAudioLLM/CosyVoice-300M', local_dir='pretrained_models/CosyVoice-300M')
snapshot_download('FunAudioLLM/CosyVoice-300M-SFT', local_dir='pretrained_models/CosyVoice-300M-SFT')
snapshot_download('FunAudioLLM/CosyVoice-300M-Instruct', local_dir='pretrained_models/CosyVoice-300M-Instruct')
snapshot_download('FunAudioLLM/CosyVoice-ttsfrd', local_dir='pretrained_models/CosyVoice-ttsfrd')
Optionally, you can unzip ttsfrd resource and install ttsfrd package for better text normalization performance.
Notice that this step is not necessary. If you do not install ttsfrd package, we will use wetext by default.
cd pretrained_models/CosyVoice-ttsfrd/
unzip resource.zip -d .
pip install ttsfrd_dependency-0.1-py3-none-any.whl
pip install ttsfrd-0.4.2-cp310-cp310-linux_x86_64.whl
We strongly recommend using Fun-CosyVoice3-0.5B for better performance.
Follow the code in example.py for detailed usage of each model.
python example.py
uv run python cosyvoice/bin/export_onnx_optimized.py \
--model_dir pretrained_models/Fun-CosyVoice3-0.5B \
--fp16 --trt
If you want to use vllm for inference, please install vllm==v0.9.0. Older vllm version do not support CosyVoice2 inference.
Notice that vllm==v0.9.0 has a lot of specific requirements, for example torch==2.7.0. You can create a new env to in case your hardward do not support vllm and old env is corrupted.
conda create -n cosyvoice_vllm --clone cosyvoice
conda activate cosyvoice_vllm
pip install vllm==v0.9.0 transformers==4.51.3 numpy==1.26.4 -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
python vllm_example.py
You can use our web demo page to get familiar with CosyVoice quickly.
Please see the demo website for details.
# change iic/CosyVoice-300M-SFT for sft inference, or iic/CosyVoice-300M-Instruct for instruct inference
python3 webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M
For advanced users, we have provided training and inference scripts in examples/libritts/cosyvoice/run.sh.
Optionally, if you want service deployment, You can run the following steps.
cd runtime/python
docker build -t cosyvoice:v1.0 .
# change iic/CosyVoice-300M to iic/CosyVoice-300M-Instruct if you want to use instruct inference
# for grpc usage
docker run -d --runtime=nvidia -p 50000:50000 cosyvoice:v1.0 /bin/bash -c "cd /opt/CosyVoice/CosyVoice/runtime/python/grpc && python3 server.py --port 50000 --max_conc 4 --model_dir iic/CosyVoice-300M && sleep infinity"
cd grpc && python3 client.py --port 50000 --mode <sft|zero_shot|cross_lingual|instruct>
# for fastapi usage
docker run -d --runtime=nvidia -p 50000:50000 cosyvoice:v1.0 /bin/bash -c "cd /opt/CosyVoice/CosyVoice/runtime/python/fastapi && python3 server.py --port 50000 --model_dir iic/CosyVoice-300M && sleep infinity"
cd fastapi && python3 client.py --port 50000 --mode <sft|zero_shot|cross_lingual|instruct>
Using TensorRT-LLM to accelerate cosyvoice2 llm could give 4x acceleration comparing with huggingface transformers implementation. To quick start:
cd runtime/triton_trtllm
docker compose up -d
For more details, you could check here
You can directly discuss on Github Issues or Original Github Issues.
@article{du2024cosyvoice,
title={Cosyvoice: A scalable multilingual zero-shot text-to-speech synthesizer based on supervised semantic tokens},
author={Du, Zhihao and Chen, Qian and Zhang, Shiliang and Hu, Kai and Lu, Heng and Yang, Yexin and Hu, Hangrui and Zheng, Siqi and Gu, Yue and Ma, Ziyang and others},
journal={arXiv preprint arXiv:2407.05407},
year={2024}
}
@article{du2024cosyvoice,
title={Cosyvoice 2: Scalable streaming speech synthesis with large language models},
author={Du, Zhihao and Wang, Yuxuan and Chen, Qian and Shi, Xian and Lv, Xiang and Zhao, Tianyu and Gao, Zhifu and Yang, Yexin and Gao, Changfeng and Wang, Hui and others},
journal={arXiv preprint arXiv:2412.10117},
year={2024}
}
@article{du2025cosyvoice,
title={CosyVoice 3: Towards In-the-wild Speech Generation via Scaling-up and Post-training},
author={Du, Zhihao and Gao, Changfeng and Wang, Yuxuan and Yu, Fan and Zhao, Tianyu and Wang, Hao and Lv, Xiang and Wang, Hui and Shi, Xian and An, Keyu and others},
journal={arXiv preprint arXiv:2505.17589},
year={2025}
}
@inproceedings{lyu2025build,
title={Build LLM-Based Zero-Shot Streaming TTS System with Cosyvoice},
author={Lyu, Xiang and Wang, Yuxuan and Zhao, Tianyu and Wang, Hao and Liu, Huadai and Du, Zhihao},
booktitle={ICASSP 2025-2025 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
pages={1--2},
year={2025},
organization={IEEE}
}
The content provided above is for academic purposes only and is intended to demonstrate technical capabilities. Some examples are sourced from the internet. If any content infringes on your rights, please contact us to request its removal.
(top 30 of 40)
Python
98.2%
Shell
1.5%
run_basic.py # fast way to try model, basic configuration
run.py # inference with fp16, trt flow part and torch.compile (take time for compiling)
run_fast.py # inference with fp16, trt flow part, trt llm (take time for converting)
run_offline.py # inference in offline mode with long text
run_instruct.py # inference exaples with instructions
benchmark_llm.py # benchmark llm module in different configurations
Any questions you can discuss with author in Telegram
TTFB - latency to first chunk of speech
RTF - inference time / output speech duration
| RTX 3090 + Ryzen 7 3700x + WSL | Configuration | TTFB | RTF |
|---|---|---|---|
| run_basic.py | stream + basic | 1.767 sec | 0.930 |
| run.py | stream + fp16 + TRT Flow + torch.compile | 0.797 sec | 0.442 |
| run_fast.py | stream + fp16 + TRT Flow + TRT LLM | 0.470 sec | 0.245 |
| run_offline.py | offline + fp16 + TRT Flow + TRT LLM | - | 0.1 |
| RTX 5060ti + Ryzen 9 7900 + Linux | Configuration | TTFB | RTF |
|---|---|---|---|
| run_basic.py | stream + basic | 0.719 sec | 0.548 |
| run.py | stream + fp16 + TRT Flow + torch.compile | 0.358 sec | 0.215 |
| run_fast.py | stream + fp16 + TRT Flow + TRT LLM | 0.376 sec | 0.203 |
| run_offline.py | offline + fp16 + TRT Flow + TRT LLM | - | 0.127 |
Use + before stressed letter. + will be auto converted to \u0301.
Added auto_stress (default False) parameter with silero-stress for Russian language. But it works strange when you have stress mark in every word.
For better performance, only mark stress in homographs and mispronounced words.
uv add git+https://github.com/Brakanier/FastCosyVoice.git
Clone the repo
git clone https://github.com/Brakanier/FastCosyVoice.git
uv sync
Original way:
Install Conda: please see https://docs.conda.io/en/latest/miniconda.html
Create Conda env:
conda create -n cosyvoice -y python=3.10
conda activate cosyvoice
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
# If you encounter sox compatibility issues
# ubuntu
sudo apt-get install sox libsox-dev
# centos
sudo yum install sox sox-devel
Fun-CosyVoice 3.0: Demos; Paper; Modelscope; Huggingface; CV3-Eval
CosyVoice 2.0: Demos; Paper; Modelscope; HuggingFace
CosyVoice 1.0: Demos; Paper; Modelscope; HuggingFace
Fun-CosyVoice 3.0 is an advanced text-to-speech (TTS) system based on large language models (LLM), surpassing its predecessor (CosyVoice 2.0) in content consistency, speaker similarity, and prosody naturalness. It is designed for zero-shot multilingual speech synthesis in the wild.
2025/12
2025/08
2025/07
2025/05
2024/12
2024/09
2024/08
2024/07
| Model | Open-Source | Model Size | test-zh CER (%) β | test-zh Speaker Similarity (%) β | test-en WER (%) β | test-en Speaker Similarity (%) β | test-hard CER (%) β | test-hard Speaker Similarity (%) β |
|---|---|---|---|---|---|---|---|---|
| Human | - | - | 1.26 | 75.5 | 2.14 | 73.4 | - | - |
| Seed-TTS | β | - | 1.12 | 79.6 | 2.25 | 76.2 | 7.59 | 77.6 |
| MiniMax-Speech | β | - | 0.83 | 78.3 | 1.65 | 69.2 | - | - |
| F5-TTS | β | 0.3B | 1.52 | 74.1 | 2.00 | 64.7 | 8.67 | 71.3 |
| Spark TTS | β | 0.5B | 1.2 | 66.0 | 1.98 | 57.3 | - | - |
| CosyVoice2 | β | 0.5B | 1.45 | 75.7 | 2.57 | 65.9 | 6.83 | 72.4 |
| FireRedTTS2 | β | 1.5B | 1.14 | 73.2 | 1.95 | 66.5 | - | - |
| Index-TTS2 | β | 1.5B | 1.03 | 76.5 | 2.23 | 70.6 | 7.12 | 75.5 |
| VibeVoice-1.5B | β | 1.5B | 1.16 | 74.4 | 3.04 | 68.9 | - | - |
| VibeVoice-Realtime | β | 0.5B | - | - | 2.05 | 63.3 | - | - |
| HiggsAudio-v2 | β | 3B | 1.50 | 74.0 | 2.44 | 67.7 | - | - |
| VoxCPM | β | 0.5B | 0.93 | 77.2 | 1.85 | 72.9 | 8.87 | 73.0 |
| GLM-TTS | β | 1.5B | 1.03 | 76.1 | - | - | - | - |
| GLM-TTS RL | β | 1.5B | 0.89 | 76.4 | - | - | - | - |
| Fun-CosyVoice3-0.5B-2512 | β | 0.5B | 1.21 | 78.0 | 2.24 | 71.8 | 6.71 | 75.8 |
| Fun-CosyVoice3-0.5B-2512_RL | β | 0.5B | 0.81 | 77.4 | 1.68 | 69.5 | 5.44 | 75.0 |
We strongly recommend that you download our pretrained Fun-CosyVoice3-0.5B CosyVoice2-0.5B CosyVoice-300M CosyVoice-300M-SFT CosyVoice-300M-Instruct model and CosyVoice-ttsfrd resource.
# modelscope SDK model download
from modelscope import snapshot_download
snapshot_download('FunAudioLLM/Fun-CosyVoice3-0.5B-2512', local_dir='pretrained_models/Fun-CosyVoice3-0.5B')
snapshot_download('iic/CosyVoice2-0.5B', local_dir='pretrained_models/CosyVoice2-0.5B')
snapshot_download('iic/CosyVoice-300M', local_dir='pretrained_models/CosyVoice-300M')
snapshot_download('iic/CosyVoice-300M-SFT', local_dir='pretrained_models/CosyVoice-300M-SFT')
snapshot_download('iic/CosyVoice-300M-Instruct', local_dir='pretrained_models/CosyVoice-300M-Instruct')
snapshot_download('iic/CosyVoice-ttsfrd', local_dir='pretrained_models/CosyVoice-ttsfrd')
# for oversea users, huggingface SDK model download
from huggingface_hub import snapshot_download
snapshot_download('FunAudioLLM/Fun-CosyVoice3-0.5B-2512', local_dir='pretrained_models/Fun-CosyVoice3-0.5B')
snapshot_download('FunAudioLLM/CosyVoice2-0.5B', local_dir='pretrained_models/CosyVoice2-0.5B')
snapshot_download('FunAudioLLM/CosyVoice-300M', local_dir='pretrained_models/CosyVoice-300M')
snapshot_download('FunAudioLLM/CosyVoice-300M-SFT', local_dir='pretrained_models/CosyVoice-300M-SFT')
snapshot_download('FunAudioLLM/CosyVoice-300M-Instruct', local_dir='pretrained_models/CosyVoice-300M-Instruct')
snapshot_download('FunAudioLLM/CosyVoice-ttsfrd', local_dir='pretrained_models/CosyVoice-ttsfrd')
Optionally, you can unzip ttsfrd resource and install ttsfrd package for better text normalization performance.
Notice that this step is not necessary. If you do not install ttsfrd package, we will use wetext by default.
cd pretrained_models/CosyVoice-ttsfrd/
unzip resource.zip -d .
pip install ttsfrd_dependency-0.1-py3-none-any.whl
pip install ttsfrd-0.4.2-cp310-cp310-linux_x86_64.whl
We strongly recommend using Fun-CosyVoice3-0.5B for better performance.
Follow the code in example.py for detailed usage of each model.
python example.py
uv run python cosyvoice/bin/export_onnx_optimized.py \
--model_dir pretrained_models/Fun-CosyVoice3-0.5B \
--fp16 --trt
If you want to use vllm for inference, please install vllm==v0.9.0. Older vllm version do not support CosyVoice2 inference.
Notice that vllm==v0.9.0 has a lot of specific requirements, for example torch==2.7.0. You can create a new env to in case your hardward do not support vllm and old env is corrupted.
conda create -n cosyvoice_vllm --clone cosyvoice
conda activate cosyvoice_vllm
pip install vllm==v0.9.0 transformers==4.51.3 numpy==1.26.4 -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
python vllm_example.py
You can use our web demo page to get familiar with CosyVoice quickly.
Please see the demo website for details.
# change iic/CosyVoice-300M-SFT for sft inference, or iic/CosyVoice-300M-Instruct for instruct inference
python3 webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M
For advanced users, we have provided training and inference scripts in examples/libritts/cosyvoice/run.sh.
Optionally, if you want service deployment, You can run the following steps.
cd runtime/python
docker build -t cosyvoice:v1.0 .
# change iic/CosyVoice-300M to iic/CosyVoice-300M-Instruct if you want to use instruct inference
# for grpc usage
docker run -d --runtime=nvidia -p 50000:50000 cosyvoice:v1.0 /bin/bash -c "cd /opt/CosyVoice/CosyVoice/runtime/python/grpc && python3 server.py --port 50000 --max_conc 4 --model_dir iic/CosyVoice-300M && sleep infinity"
cd grpc && python3 client.py --port 50000 --mode <sft|zero_shot|cross_lingual|instruct>
# for fastapi usage
docker run -d --runtime=nvidia -p 50000:50000 cosyvoice:v1.0 /bin/bash -c "cd /opt/CosyVoice/CosyVoice/runtime/python/fastapi && python3 server.py --port 50000 --model_dir iic/CosyVoice-300M && sleep infinity"
cd fastapi && python3 client.py --port 50000 --mode <sft|zero_shot|cross_lingual|instruct>
Using TensorRT-LLM to accelerate cosyvoice2 llm could give 4x acceleration comparing with huggingface transformers implementation. To quick start:
cd runtime/triton_trtllm
docker compose up -d
For more details, you could check here
You can directly discuss on Github Issues or Original Github Issues.
@article{du2024cosyvoice,
title={Cosyvoice: A scalable multilingual zero-shot text-to-speech synthesizer based on supervised semantic tokens},
author={Du, Zhihao and Chen, Qian and Zhang, Shiliang and Hu, Kai and Lu, Heng and Yang, Yexin and Hu, Hangrui and Zheng, Siqi and Gu, Yue and Ma, Ziyang and others},
journal={arXiv preprint arXiv:2407.05407},
year={2024}
}
@article{du2024cosyvoice,
title={Cosyvoice 2: Scalable streaming speech synthesis with large language models},
author={Du, Zhihao and Wang, Yuxuan and Chen, Qian and Shi, Xian and Lv, Xiang and Zhao, Tianyu and Gao, Zhifu and Yang, Yexin and Gao, Changfeng and Wang, Hui and others},
journal={arXiv preprint arXiv:2412.10117},
year={2024}
}
@article{du2025cosyvoice,
title={CosyVoice 3: Towards In-the-wild Speech Generation via Scaling-up and Post-training},
author={Du, Zhihao and Gao, Changfeng and Wang, Yuxuan and Yu, Fan and Zhao, Tianyu and Wang, Hao and Lv, Xiang and Wang, Hui and Shi, Xian and An, Keyu and others},
journal={arXiv preprint arXiv:2505.17589},
year={2025}
}
@inproceedings{lyu2025build,
title={Build LLM-Based Zero-Shot Streaming TTS System with Cosyvoice},
author={Lyu, Xiang and Wang, Yuxuan and Zhao, Tianyu and Wang, Hao and Liu, Huadai and Du, Zhihao},
booktitle={ICASSP 2025-2025 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
pages={1--2},
year={2025},
organization={IEEE}
}
The content provided above is for academic purposes only and is intended to demonstrate technical capabilities. Some examples are sourced from the internet. If any content infringes on your rights, please contact us to request its removal.
(top 30 of 40)
Python
98.2%
Shell
1.5%