Speech synthesis model
Self-hosting XTTS-v2: 17-language voice cloning on one 24GB card
A 6-second reference clip, 1.87GB of weights, ~4GB peak VRAM. This is the lowest-friction open voice cloner there is — but to run it correctly you need to know about revisions, character caps and the licence.
XTTS · self-hosted
XTTS-v2 is still the fastest open voice-cloning model to get working. Hand it a 6-second reference clip and it reads any text in that voice, across languages — feed it a Chinese sample and it will carry that timbre into English. The core checkpoint, model.pth, is only 1.87GB; add the 211MB DVAE and the whole download is about 2.1GB. An RTX 3090 has room to spare. That accessibility is why the model sits at 3.7k likes and north of eight million monthly downloads on Hugging Face.
One thing has to be said up front: the weights have not moved since late 2023, Coqui the company has wound down, and the original coqui-ai/TTS repo is — in the words of the people who picked it up — "the original, unmaintained repository." What actually ships today is the Idiap Research Institute fork, published on PyPI as coqui-tts, which has tracked Python 3.14, PyTorch 2.10 and transformers 5. That is the package you install. Not pip install TTS, which will fail outright on torch.load with PyTorch 2.6 or newer.
This page walks through everything that bites people self-hosting XTTS: the language that differs between revisions v2.0.2 and v2.0.3, the hard 82-character cap on Chinese input, the 2–3x DeepSpeed speedup, the real VRAM floor for fine-tuning, and exactly what the non-commercial CPML licence blocks. NexGPU bills per second with no minimum — pick a 24GB card from 1,175 rentable nodes, prove it works, then decide whether to keep it running.
01 —
Which XTTS version? Pick the wrong revision and you lose a language
coqui-tts pulls weights from the Hugging Face main branch by default, and main does not carry the same language list as every revision branch.
| Version | Parameters | VRAM | Context | Notes |
|---|---|---|---|---|
| XTTS-v2 (HF main, i.e. v2.0.3) | GPT-2 style autoregressive backbone, 30 layers · 1024 dim · 16 heads, model.pth 1.87GB (fp32) | ~2.5GB loaded in fp32, single-stream inference peaks around 4GB | 402 text tokens / 605 audio tokens, 24kHz output | 17 languages — one more than v2.0.2, namely Hindi (hi). Uses a perceiver resampler for speaker conditioning, which is why v2 clones better than v1.x. This is what coqui-tts downloads when you do not pin a revision. |
| XTTS-v2 revision v2.0.2 | Same architecture and checkpoint size as v2.0.3 | Same, ~4GB peak | 402 text tokens / 605 audio tokens | 16 languages, no Hindi. A whole tier of downstream wrappers such as AllTalk pin this exact revision, so if you are reproducing someone else's results you must specify the branch — otherwise you are not listening to the same weights. |
| XTTS-v1.1 (revision v1.1.2) | 30-layer · 1024-dim GPT backbone, no perceiver resampler | Same order of magnitude as v2 | 402 text tokens / 605 audio tokens | Only 14 languages — no Hungarian, Korean or Hindi — and noticeably weaker speaker similarity than v2. Touch it only when maintaining an older project that needs the exact old voice. |
| Community fine-tuned checkpoints | GPT layers further trained on top of XTTS-v2 | Inference identical to stock; training is a separate budget, see the hardware table | Same as v2 | Hugging Face hosts seventy-plus fine-tunes of XTTS-v2, mostly single-voice or single-language specialisations. They inherit CPML too, so they are not a route around the licence. |
02 —
Which GPU for XTTS? Match the card to the job
XTTS is a small model. The bottleneck is never VRAM capacity — it is autoregressive decode speed and how many streams you need at once.
Single-stream inference, running a persistent OpenAI-compatible TTS endpoint
RTX 3090 24GB$0.193/GPU-hour
1.87GB of weights plus a KV cache for at most 605 audio tokens does not even fill 4GB, and 24GB lets you keep conditioning latents for dozens of speakers resident on the card — at the lowest per-hour rate of any 24GB card we rent.
Batch narration, DeepSpeed enabled, holding sub-200ms time-to-first-chunk
RTX 4090 24GB$0.540/GPU-hour
Autoregressive decode lives on single-thread throughput and memory bandwidth; Ada is the fastest single card here, and the widely reported 2–3x DeepSpeed speedup shows up most clearly on it.
Fine-tuning your own voice (batch_size 4, 11-second clips, 10 epochs)
RTX 5090 32GB$0.723/GPU-hour
Community fine-tuning guides put the floor at 16GB VRAM on Linux; 32GB lets you push batch_size from 4 up to 8–12 instead of trading time for space with gradient accumulation.
Scaling out on one node so a single person can run a whole audiobook or podcast pipeline
RTX A6000 48GB$0.817/GPU-hour
Up to 14 GPUs per node, and 48GB each means several independent worker processes sit side by side without fighting for memory — scaling is just launching more containers, no inference code changes.
03 —
Self-hosting XTTS in four steps
From a bare machine to a voice-cloning endpoint your existing OpenAI SDK code can call.
- 01
Install the runtime — and install the right package
The PyPI package called TTS is abandoned; with PyTorch 2.6 or newer it throws UnpicklingError straight out of torch.load because weights_only now defaults to True. What you want is Idiap's coqui-tts (code under MPL-2.0, Python 3.10–3.14). Since 0.27.4 it no longer pulls PyTorch in by default, so the [cuda] extra is mandatory; Chinese segmentation via spacy_pkuseg and pypinyin arrives with [zh]. COQUI_TOS_AGREED skips the interactive CPML prompt, which otherwise stalls downloads in non-interactive environments.
pip install "coqui-tts[cuda,zh,server]" && export COQUI_TOS_AGREED=1 - 02
First synthesis, which also fetches the 2.1GB of weights
The first call downloads model.pth (1.87GB), dvae.pth (211MB) and speakers_xtts.pth (7.75MB) into the cache directory returned by get_user_data_dir("tts"). Give it six seconds or more of clean speech as reference; input is resampled to 22.05kHz and output is always 24kHz mono. Note the language code is zh-cn, not zh.
python -c 'from TTS.api import TTS; TTS("tts_models/multilingual/multi-dataset/xtts_v2").to("cuda").tts_to_file(text="Testing voice cloning quality", speaker_wav=["ref.wav"], language="en", file_path="out.wav")' - 03
Serve it, and call it with the OpenAI SDK
The bundled tts-server listens on port 5002. Alongside the native /api/tts route it exposes /v1/audio/speech, an OpenAI-compatible endpoint returning wav, mp3, opus, aac, flac or pcm. Existing OpenAI TTS code only needs base_url pointed at http://<node>:5002/v1 with any placeholder api_key. For genuinely low-latency streaming, skip HTTP and drive model.inference_stream() with use_deepspeed=True instead. Check tts-server -h for the current GPU flag spelling.
tts-server --model_name "tts_models/multilingual/multi-dataset/xtts_v2" --use_cuda true - 04
Fine-tune when zero-shot is not close enough
There is an official Gradio fine-tuning demo defaulting to batch_size 4, grad_acumm 1, num_epochs 10 and an 11-second maximum clip length, served on port 5003. It handles transcription and segmentation, trains the GPT layers, then hands you a listening UI. Budget 18–20GB of scratch disk, most of it temporary. The official Colab notebook says a run takes up to about 40 minutes. When it finishes, point the server from the previous step at the new checkpoint directory.
python -m TTS.demos.xtts_ft_demo.xtts_demo --port 5003 --batch_size 4 --grad_acumm 1 --num_epochs 10 --max_audio_length 11
Cloning a voice and producing a 10-hour audiobook: the actual bill
The official Colab notebook puts a fine-tuning run at up to roughly 40 minutes. Rent an RTX 3090 24GB at $0.193/GPU-hour for segmentation, training and listening tests and give the whole thing 3 hours: 3 × $0.193 = $0.579. With the voice settled, switch to an RTX 4090 24GB at $0.540/GPU-hour with DeepSpeed on for batch generation, another 3 hours: 3 × $0.540 = $1.62. XTTS outputs 24kHz 16-bit mono, which is 48,000 bytes per second, roughly 172.8MB per hour of audio; ten finished hours is about 1.73GB, and at the $0.0081/GB median egress rate that is 1.73 × $0.0081 ≈ $0.014. Add them up: $0.579 + $1.62 + $0.014 ≈ $2.21 of compute for an entire audiobook. Storage is separate — call it 10GB for weights plus dataset, so $0.414/GB-month × 10 = $4.14/month; compute billing stops the moment the instance stops, and storage stops when you destroy the volume. If you want a persistent service rather than a batch job: a 3090 running flat out for a month is $0.193 × 24 × 30 = $138.96, while weekdays 09:00–19:00 only comes to $0.193 × 10 × 22 = $42.46. Metered per second, priced per hour, no minimum, no setup fee, no quota request.
04 —
Frequently asked questions
How much VRAM does XTTS-v2 need to self-host? Is an 8GB card enough?
Can I use XTTS commercially? What does the CPML licence actually restrict?
How good is XTTS at Chinese, and why do long sentences get truncated?
I installed TTS and now I get weights_only or transformers errors. How do I fix it?
How much VRAM and how long does fine-tuning a custom voice take?
The weights have not been updated in over two years. Is XTTS still worth using, and how does it compare to CosyVoice or Chatterbox?
More in Speech synthesis
Start building on NexGPU
Enterprise R&D team or solo developer — either way, your first job can be running in minutes.
Sign up to browse live network pricing. No payment method required.
