cosyvoice voice generation

A multilingual large voice generation model for expressive speech, practical inference and full-stack deployment.

Public

Try the model

Turn a prompt into a natural voice

Text to speech

Describe the voice, mood and words you want to hear, then continue to the Cosyvoice creation workspace.

Describe a voice and continue.

Free to start · no signup · about 10 s

Or start with an example

main
Code
Add multilingual voice generation examples and deployment notes 5 months ago
552 Commits
Name Last commit message Last commit date
.github fix lint 10 months ago
asset update dingding 10 months ago
cosyvoice fix lint 7 months ago
docker fix a typo in Dockerfile 10 months ago
examples keep offline embedding/token extraction for compatible 8 months ago
runtime fix lint 7 months ago
third_party remove academic and change to iic/CosyVoice_ttsfrd 2 years ago
tools online feature 9 months ago
.gitignore add cosyvoice2 2 years ago
.gitmodules remove academic and change to iic/CosyVoice_ttsfrd 2 years ago
CODE_OF_CONDUCT.md add cosyvoice code 2 years ago
FAQ.md remove academic third party 2 years ago
LICENSE add cosyvoice code 2 years ago
README.md Add ecosystem section with links to speech projects 5 months ago
example.py fix lint 7 months ago
requirements.txt fix vllm yaml version 8 months ago
vllm_example.py fix bistream bug 10 months ago
webui.py remove instruct warning 10 months ago
Blue and violet Cosyvoice banner with the model name and text-to-speech large language model subtitle

👉🏻 Cosyvoice 👈🏻

Fun-Cosyvoice 3.0: Demos; Paper; Modelscope; Huggingface; Evaluation

Cosyvoice 2.0: Demos; Paper; Modelscope; HuggingFace

Cosyvoice 1.0: Demos; Paper; Modelscope; HuggingFace

Highlight🔥

Fun-Cosyvoice 3.0 is an advanced text-to-speech system built around large language models. It improves continuity, speaker likeness and prosody while remaining suitable for zero-shot multilingual speech synthesis in everyday settings.

Key Features

  • Language Coverage: Supports 9 widely used languages including Chinese, English, Japanese, Korean, German, Spanish, French, Italian and Russian, alongside 18+ Chinese dialects and accents. It also supports multilingual and cross-lingual zero-shot voice cloning.
  • Content Consistency & Naturalness: Keeps the spoken content stable while preserving speaker similarity and natural-sounding prosody.
  • Pronunciation Inpainting: Accepts Chinese Pinyin and English CMU phonemes for more precise pronunciation control in production workflows.
  • Text Normalization: Reads numbers, symbols and varied text formats without requiring a traditional frontend module.
  • Bi-Streaming: Supports text-in streaming and audio-out streaming, with latency designed to reach approximately 150ms while maintaining detailed audio.
  • Instruct Support: Handles instructions for language, dialect, emotion, speed, volume and related delivery controls.

Roadmap

  • 2025/12
    • Release the Fun-Cosyvoice3-0.5B-2512 base model, RL model and training/inference scripts
    • Release a Fun-Cosyvoice3-0.5B Modelscope Gradio space
  • 2025/08
    • Add Triton TRT-LLM runtime support and Cosyvoice2 GRPO training support
  • 2025/07
    • Release the Fun-Cosyvoice 3.0 evaluation set
  • 2025/05
    • Add Cosyvoice2-0.5B vLLM support
  • 2024/12
    • Release the 25Hz Cosyvoice2-0.5B model
  • 2024/09
    • Release the 25Hz Cosyvoice-300M base model
    • Add the Cosyvoice-300M voice conversion function
  • 2024/08
    • Add repetition-aware sampling inference for LLM stability
    • Add streaming inference support with KV cache and SOTA optimization
  • 2024/07
    • Add flow matching training support
    • Add WeTextProcessing support when ttsfrd is unavailable
    • Add FastAPI server and client support

Evaluation

Model Open-Source Model Size test-zh
CER (%) ↓
test-zh
SS (%) ↑
test-en
WER (%) ↓
test-en
SS (%) ↑
test-hard
CER (%) ↓
test-hard
SS (%) ↑
Human--1.2675.52.1473.4--
Seed-TTS❌-1.1279.62.2576.27.5977.6
MiniMax-Speech❌-0.8378.31.6569.2--
F5-TTS✅0.3B1.5274.12.0064.78.6771.3
Spark TTS✅0.5B1.266.01.9857.3--
CosyVoice2✅0.5B1.4575.72.5765.96.8372.4
FireRedTTS2✅1.5B1.1473.21.9566.5--
Index-TTS2✅1.5B1.0376.52.2370.67.1275.5
VibeVoice-1.5B✅1.5B1.1674.43.0468.9--
VibeVoice-Realtime✅0.5B--2.0563.3--
HiggsAudio-v2✅3B1.5074.02.4467.7--
VoxCPM✅0.5B0.9377.21.8572.98.8773.0
GLM-TTS✅1.5B1.0376.1----
GLM-TTS RL✅1.5B0.8976.4----
Fun-CosyVoice3-0.5B-2512✅0.5B1.2178.02.2471.86.7175.8
Fun-CosyVoice3-0.5B-2512_RL✅0.5B0.8177.41.6869.55.4475.0

Install

Clone and install

  • Clone the repository

    git clone --recursive https://github.com/FunAudioLLM/CosyVoice.git
    # If the submodule download fails because of network conditions, run the following command again
    cd CosyVoice
    git submodule update --init --recursive
  • Install Conda: please see the Miniconda documentation.

  • Create a Conda environment:

    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

Model download

We recommend downloading the pretrained Fun-CosyVoice3-0.5B, CosyVoice2-0.5B, CosyVoice-300M, CosyVoice-300M-SFT, CosyVoice-300M-Instruct and CosyVoice-ttsfrd resources.

# 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 overseas 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, unpack the ttsfrd resource and install its package for improved text normalization.

This step is optional. Without it, Cosyvoice uses 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

Basic Usage

For the strongest results, use Fun-CosyVoice3-0.5B and follow the examples for each supported model.

python example.py

vLLM Usage

Cosyvoice2 and Cosyvoice3 support vLLM 0.11.x+ with the V1 engine and vLLM 0.9.0 in legacy mode. Older releases do not support Cosyvoice inference, while versions between these tested releases may require additional validation.

Because vLLM has specific dependency requirements, create a separate environment when needed.

conda create -n cosyvoice_vllm --clone cosyvoice
conda activate cosyvoice_vllm
# for vllm==0.9.0
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
# for vllm>=0.11.0
pip install vllm==v0.11.0 transformers==4.57.1 numpy==1.26.4 -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com
python vllm_example.py

Start web demo

Use the web demo to get familiar with Cosyvoice quickly, then adapt the example to your selected model.

Please see the creation workspace for the current demo 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

Advanced Usage

Training and inference scripts for advanced users are provided in examples/libritts.

Build for deployment

For optional service deployment, run the following steps.

cd runtime/python
docker build -t cosyvoice:v1.0 .
# change iic/CosyVoice-300M to iic/CosyVoice-300M-Instruct for 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 Nvidia TensorRT-LLM for deployment

TensorRT-LLM can accelerate the Cosyvoice2 language model substantially compared with a standard Hugging Face Transformers implementation.

cd runtime/triton_trtllm
docker compose up -d

For deployment details, continue through the creation workspace.

Discussion & Communication

Questions and technical discussions can be shared through the Cosyvoice community workspace.

You can also scan the QR code to join the official Cosyvoice discussion group.

A clean black-and-white QR code card for joining the Cosyvoice community, centered on white paper with a small blue accent

Acknowledge

  1. We borrowed substantial code from FunASR.
  2. We borrowed substantial code from FunCodec.
  3. We borrowed substantial code from Matcha-TTS.
  4. We borrowed substantial code from AcademiCodec.
  5. We borrowed substantial code from WeNet.

Citations

@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 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 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 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},
  pages={1--2},
  year={2025},
  organization={IEEE}
}

Ecosystem

Cosyvoice is part of the FunAudioLLM family, a broader toolkit for speech understanding and generation.

Project Description Stars
FunASR Industrial speech recognition with 50+ languages, diarization and streaming. FunASR stars badge
Fun-ASR-Nano End-to-end LLM-based ASR for 31 languages, hotwords and vLLM streaming. Fun-ASR-Nano stars badge
SenseVoice Ultra-fast ASR with emotion recognition and audio event detection. SenseVoice stars badge
FunClip AI video clipping powered by speech recognition. FunClip stars badge

Disclaimer

The material on this page is provided for academic and technical demonstration purposes. Some examples are sourced from public resources. If any material infringes your rights, please contact us to request its removal.

Start creating
Start creating