█

AI/TLDR

Buy me a coffee
Buy me a coffee

CosyVoice

Multilingual LLM-based text-to-speech with zero-shot voice cloning and streaming output

Audio, Music & VoiceOpen source
Language
Python
License
Apache-2.0
IN SHORT

What is CosyVoice?

CosyVoice is an open-source text-to-speech (TTS) system built on a large language model. From the FunAudioLLM team, it turns written text into natural-sounding speech and can clone a voice from a short reference clip without any per-speaker fine-tuning (zero-shot cloning). It sits in the Audio, Music & Voice category of the Multimodal Generation tools and is open-source, written in Python and licensed Apache-2.0.

Overview

CosyVoice is an open-source text-to-speech (TTS) system built on a large language model. From the FunAudioLLM team, it turns written text into natural-sounding speech and can clone a voice from a short reference clip without any per-speaker fine-tuning (zero-shot cloning). The project ships pretrained models, plus full inference, training, and deployment code.

It is designed for multilingual use. Fun-CosyVoice 3.0 covers 9 common languages (Chinese, English, Japanese, Korean, German, Spanish, French, Italian, and Russian) along with 18+ Chinese dialects and accents, and supports cross-lingual voice cloning. It also accepts instructions to control language, dialect, emotion, speed, and volume.

CosyVoice supports bi-directional streaming: text can stream in while audio streams out, with latency reported as low as 150ms. It includes built-in text normalization (reading numbers and special symbols) and pronunciation inpainting for Chinese Pinyin and English CMU phonemes, giving finer control for production use. You can run it from a script, a Gradio web demo, or as a deployed gRPC/FastAPI service.

What it does

  • Zero-shot voice cloning: copy a target voice from a short reference sample, including cross-lingual cloning, with no per-speaker training
  • Multilingual coverage: 9 common languages plus 18+ Chinese dialects and accents in the Fun-CosyVoice 3.0 model
  • Bi-directional streaming: text-in and audio-out streaming with latency reported as low as 150ms
  • Instruction control: adjust language, dialect, emotion, speed, and volume via instructions
  • Built-in text normalization for numbers and symbols, plus pronunciation inpainting for Pinyin and CMU phonemes
  • Multiple run modes: Python script, Gradio web demo, and gRPC/FastAPI deployment, with optional vLLM and TensorRT-LLM acceleration

Getting started

CosyVoice runs in a Conda environment. You clone the repo with its submodules, install the Python requirements, download a pretrained model, then run the example script. The team recommends the Fun-CosyVoice3-0.5B model for best quality.

Clone the repository with submodules

Clone the repo recursively so the bundled submodules come along. If the submodule clone fails due to network issues, re-run the update command until it succeeds.

bashbash
git clone --recursive https://github.com/FunAudioLLM/CosyVoice.git
cd CosyVoice
git submodule update --init --recursive

Create the Conda environment and install

Create a Python 3.10 Conda environment, activate it, and install the requirements.

bashbash
conda create -n cosyvoice -y python=3.10
conda activate cosyvoice
pip install -r requirements.txt

Download a pretrained model

Download a pretrained model into the pretrained_models folder. You can use ModelScope or, for users outside China, the Hugging Face Hub.

pythonpython
from modelscope import snapshot_download
snapshot_download('FunAudioLLM/Fun-CosyVoice3-0.5B-2512', local_dir='pretrained_models/Fun-CosyVoice3-0.5B')

Run the example or web demo

Run example.py to generate speech, or launch the Gradio web demo to try it interactively in the browser.

bashbash
python example.py
# or launch the web demo
python3 webui.py --port 50000 --model_dir pretrained_models/CosyVoice-300M

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Cloning a specific voice from a short audio sample to narrate text in the same voice, including across languages
  • Building multilingual voice assistants or readers that speak Chinese, English, Japanese, Korean, and other supported languages
  • Adding low-latency streaming speech output to real-time apps where text is generated and spoken on the fly
  • Generating expressive speech with controlled emotion, speed, dialect, or volume for media, dubbing, or accessibility tools
  • Deploying a self-hosted TTS service via gRPC or FastAPI, with optional vLLM or TensorRT-LLM acceleration for throughput

How CosyVoice compares

CosyVoice alongside other open-source audio, music & voice tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
VoiceStudio★ 121kA local-first desktop voice studio that clones and designs voices, dubs video, and handles dictation, running 16 text-to-speech and 11 speech-recognition engines on your own hardware.
Whisper★ 114kOpenAI's speech recognition model that transcribes and translates audio across many languages.
GPT-SoVITS★ 64.3kAn open-source WebUI that clones a voice from a short audio sample and turns text into speech, with zero-shot and few-shot fine-tuning.
Voicebox★ 61.6kLocal-first voice studio that clones a voice from a short sample, generates speech across seven TTS engines and 23 languages, handles system-wide dictation, and speaks for agents over MCP.
VibeVoice★ 57.6kMicrosoft's text-to-speech model for generating long, expressive multi-speaker audio like podcasts.
whisper.cpp★ 55.7kA dependency-free C/C++ port of Whisper built on ggml, running speech recognition on CPU, Metal, CUDA, Vulkan and NPUs from phones to servers.
Coqui TTS★ 46.3kA library of text-to-speech models including the multilingual XTTS voice-cloning model.
CosyVoice★ 24.6kMultilingual LLM-based text-to-speech with zero-shot voice cloning and streaming output