This document provides detailed information about using the vLLM-Omni backend for faster Qwen3-TTS inference.
The vLLM-Omni backend provides day-0 support for Qwen3-TTS with optimized inference performance. While vLLM-Omni currently only supports offline inference (not true audio streaming), it can significantly speed up generation compared to the official backend.
- ⚡ Faster Inference - Optimized for throughput and latency
- 🎯 Same API - Drop-in replacement, no client changes needed
- 🔧 Thread-Safe - Built-in concurrency handling with async locks
- 🚀 Warmup Support - Optional warmup on startup to reduce first-request latency
- 📊 GPU Optimized - Best performance on NVIDIA GPUs (tested on RTX 3090)
The easiest way to use the vLLM backend is via Docker:
# Build the vLLM-enabled image
docker-compose --profile vllm build qwen3-tts-vllm
# Run the vLLM backend service
docker-compose --profile vllm up qwen3-tts-vllm- Install the base package:
pip install -e .- Install vLLM (requires CUDA):
pip install vllm>=0.4.0Or install with the vllm extras:
pip install -e ".[vllm]"Configure the backend using environment variables:
# Select backend (required)
export TTS_BACKEND=vllm_omni
# Optional: Override model (default: Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice)
export TTS_MODEL_NAME=Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice
# Optional: Enable warmup on startup (recommended)
export TTS_WARMUP_ON_START=true
# Server settings
export HOST=0.0.0.0
export PORT=8880
export WORKERS=1We recommend the 0.6B model for best speed/quality tradeoff:
| Model | Size | Speed | Quality | Use Case |
|---|---|---|---|---|
Qwen3-TTS-12Hz-0.6B-CustomVoice |
0.6B | ⚡⚡⚡ Fast | ⭐⭐⭐ Good | Recommended - Best for production |
Qwen3-TTS-12Hz-1.7B-CustomVoice |
1.7B | ⚡⚡ Medium | ⭐⭐⭐⭐ Better | Higher quality, slower |
The 0.6B model provides excellent quality with significantly faster inference, making it ideal for real-time applications.
# Set backend to vLLM-Omni
export TTS_BACKEND=vllm_omni
export TTS_WARMUP_ON_START=true
# Start the server
python -m api.mainThe API is identical to the official backend:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8880/v1", api_key="not-needed")
response = client.audio.speech.create(
model="qwen3-tts",
voice="Vivian",
input="Hello! This is Qwen3-TTS with vLLM-Omni backend."
)
response.stream_to_file("output.mp3")Qwen3-TTS model families map to distinct characteristics:
- CustomVoice: preset speakers + style instruction control
- VoiceDesign: free-form voice design from natural-language instructions
- Base: reference-audio voice cloning (
ref_audio, optionalref_textin x-vector-only mode)
In this FastAPI wrapper, the primary generation endpoint remains:
POST /v1/audio/speech(OpenAI-compatible request body with extensions likelanguage,instruct, normalization options)
Voice cloning is exposed as a dedicated endpoint:
POST /v1/audio/voice-clone(ref_audio,ref_text,x_vector_only_mode,language,response_format,speed)
Voice listing is available via:
GET /v1/audio/voices(alias:/v1/voices)
Check backend status:
curl http://localhost:8880/healthResponse:
{
"status": "healthy",
"backend": {
"name": "vllm_omni",
"model_id": "Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice",
"ready": true
},
"device": {
"type": "cuda:0",
"gpu_available": true,
"gpu_name": "NVIDIA GeForce RTX 3090",
"vram_total": "24.00 GB",
"vram_used": "3.45 GB"
},
"version": "0.1.0"
}vLLM requires sufficient GPU memory. For different models:
- 0.6B model: ~3-4 GB VRAM
- 1.7B model: ~8-10 GB VRAM
The vLLM backend uses an async lock to ensure thread safety. For high-throughput scenarios:
- Use multiple workers (if supported by your vLLM version)
- Deploy multiple instances behind a load balancer
- Consider request batching at the application level
Enable warmup to reduce first-request latency:
export TTS_WARMUP_ON_START=trueThis runs a test inference during startup to pre-load the model.
The vLLM backend supports the same voices as the official backend:
- Vivian (Female)
- Ryan (Male)
- Sophia (Female)
- Isabella (Female)
- Evan (Male)
- Lily (Female)
Plus OpenAI-compatible aliases: alloy, echo, fable, nova, onyx, shimmer
- English
- Chinese (中文)
- Japanese (日本語)
- Korean (한국어)
- German (Deutsch)
- French (Français)
- Spanish (Español)
- Russian (Русский)
- Portuguese (Português)
- Italian (Italiano)
Specify language in three ways:
- Auto-detection (default):
response = client.audio.speech.create(
model="qwen3-tts",
voice="Vivian",
input="Hello world"
)- Model suffix:
response = client.audio.speech.create(
model="tts-1-es", # Spanish
voice="Vivian",
input="Hola mundo"
)- Request parameter (if extended):
response = client.audio.speech.create(
model="qwen3-tts",
voice="Vivian",
input="Hola mundo",
language="Spanish" # via extended schema
)Problem: vLLM fails to install
Solution:
- Ensure CUDA is installed (CUDA 11.8+ or 12.1+)
- Check PyTorch compatibility:
python -c "import torch; print(torch.cuda.is_available())" - Try:
pip install vllm --no-build-isolation
Problem: CUDA out of memory error
Solutions:
- Use the smaller 0.6B model instead of 1.7B
- Reduce
max_model_len(set via code modification) - Close other GPU applications
- Use a GPU with more VRAM
Problem: First request takes a long time
Solutions:
- Enable warmup:
TTS_WARMUP_ON_START=true - This is expected for model loading; subsequent requests will be fast
- Consider keeping the service running rather than starting/stopping
Problem: Server starts but backend initialization fails
Solutions:
- Check logs for detailed error messages
- Verify vLLM is installed:
pip list | grep vllm - Verify model accessibility from HuggingFace
- Check GPU availability:
nvidia-smi
Problem: Audio quality differs from official backend
Explanation:
- Both backends use the same models
- Minor differences may occur due to different inference paths
- If quality is critical, stick with the official backend
- The 0.6B model trades slight quality for speed
docker build -t qwen3-tts:vllm --target vllm-production .docker run -d \
--name qwen3-tts-vllm \
--gpus all \
-p 8880:8880 \
-e TTS_BACKEND=vllm_omni \
-e TTS_WARMUP_ON_START=true \
-e TTS_MODEL_NAME=Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice \
-v ~/.cache/huggingface:/home/appuser/.cache/huggingface \
qwen3-tts:vllmUse the provided compose configuration:
# Start vLLM backend
docker-compose --profile vllm up -d qwen3-tts-vllm
# View logs
docker-compose logs -f qwen3-tts-vllm
# Stop
docker-compose --profile vllm down| Feature | Official Backend | vLLM-Omni Backend |
|---|---|---|
| Speed | ⚡⚡ Medium | ⚡⚡⚡ Fast |
| Memory | ~6-8 GB (1.7B) | ~3-4 GB (0.6B) |
| Setup | ✅ Simple | |
| Quality | ⭐⭐⭐⭐ Best | ⭐⭐⭐ Good |
| True Streaming | ❌ No | ❌ No |
| Chunk Streaming | ✅ Yes | ✅ Yes |
| OpenWebUI Compatible | ✅ Yes | ✅ Yes |
- True Streaming: Neither backend supports true audio streaming over HTTP currently. Both use OpenWebUI's chunk-based approach.
- UI Behavior: For vLLM-Omni online serving, treat requests as non-streaming and show a processing state until the full audio response is returned.
- Chunk Streaming: Long text is split into chunks, each processed as a separate TTS request.
- Production Use: vLLM backend is suitable for production but test thoroughly in your environment first.
- Model Updates: As vLLM-Omni and Qwen3-TTS evolve, check for updates to both packages.
For issues specific to:
- vLLM-Omni: Check vLLM GitHub
- Qwen3-TTS: Check Qwen3-TTS GitHub
- This Implementation: Open an issue in this repository