Qwen3-TTS-API

Qwen3-TTS-API

Docker app from hsiang's Repository

Overview

OpenAI-compatible TTS API powered by Qwen3-TTS with CUDA graph acceleration (7-10x faster). 10 languages, 9 built-in voices, voice cloning, emotion control, streaming output. Supports RTX 50-series (Blackwell) GPUs. First start downloads model (~3-7GB) from HuggingFace. China users: set HF_ENDPOINT to https://hf-mirror.com for faster downloads. Requires NVIDIA GPU with driver 550+.

Qwen3-TTS-API

中文文档

OpenAI-compatible Text-to-Speech API powered by Qwen3-TTS with faster-qwen3-tts CUDA graph acceleration.

7-10x faster than stock inference. Real-time generation on RTX 4060/5060 Ti class GPUs. No flash-attn, no vLLM, no Triton — just CUDA graphs.

Features

  • OpenAI-compatible /v1/audio/speech endpoint (JSON body)
  • CUDA graph acceleration — 7-10x faster than baseline
  • Streaming output ("stream": true returns chunked WAV)
  • Voice cloning from 3-second reference audio
  • 10 languages: Chinese, English, Japanese, Korean, German, French, Russian, Portuguese, Spanish, Italian
  • 9 built-in voices (CustomVoice model) with instruction-based emotion control
  • No flash-attn dependency required
  • Supports RTX 50-series (Blackwell) GPUs

Quick Start

docker run -d --gpus all \
  -p 8080:8080 \
  -v /mnt/user/appdata/qwen3-tts-api/models:/root/.cache/huggingface \
  -e MODEL_ID=Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice \
  --shm-size=4g \
  --name qwen3-tts-api \
  ghcr.io/hsiang-han/qwen3-tts-api:latest

Or with docker compose:

docker compose -f docker/gpu/docker-compose.yml up -d

First start downloads model (~3-7GB) and captures CUDA graphs on first request. China users: set HF_ENDPOINT=https://hf-mirror.com.

Usage Examples

# Generate speech with built-in voice
curl -X POST http://localhost:8080/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"input": "Hello, this is a test.", "voice": "Vivian", "language": "English"}' \
  --output output.wav

# With emotion instruction (1.7B CustomVoice only)
curl -X POST http://localhost:8080/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"input": "我真的太开心了!", "voice": "Vivian", "instruct": "用特别开心的语气说"}' \
  --output happy.wav

# Streaming output
curl -X POST http://localhost:8080/v1/audio/speech \
  -H "Content-Type: application/json" \
  -d '{"input": "Streaming test.", "voice": "Vivian", "stream": true}' \
  --output stream.wav

# List available voices
curl http://localhost:8080/v1/voices

Built-in Voices (CustomVoice model)

Voice Description Native Language
Vivian Bright, slightly edgy young female Chinese
Serena Warm, gentle young female Chinese
Uncle_Fu Seasoned male, low mellow timbre Chinese
Dylan Youthful Beijing male, clear natural Chinese (Beijing)
Eric Lively Chengdu male, slightly husky Chinese (Sichuan)
Ryan Dynamic male, strong rhythmic drive English
Aiden Sunny American male, clear midrange English
Ono_Anna Playful Japanese female, light nimble Japanese
Sohee Warm Korean female, rich emotion Korean

API Endpoints

Endpoint Method Description
/v1/audio/speech POST Text-to-speech (JSON body, OpenAI-compatible)
/v1/audio/speech/clone POST Voice cloning (Form + file upload, Base model only)
/v1/voices GET List available voices and languages
/v1/models GET List models
/health GET Health check
/docs GET Swagger documentation

Environment Variables

Variable Default Description
MODEL_ID Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice HuggingFace model ID or local path
DTYPE bfloat16 Model precision (float16, bfloat16, float32)
DEVICE cuda:0 CUDA device
ATTN_IMPLEMENTATION sdpa Attention backend (sdpa, eager)
PORT 8080 API server port
HF_HOME /root/.cache/huggingface HuggingFace cache directory
HF_ENDPOINT https://huggingface.co HuggingFace mirror (China: https://hf-mirror.com)

Available Models

Model ID Type VRAM Features
Qwen/Qwen3-TTS-12Hz-0.6B-Base Base ~3GB Voice clone
Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice CustomVoice ~3GB 9 built-in voices
Qwen/Qwen3-TTS-12Hz-1.7B-Base Base ~6GB Voice clone
Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice CustomVoice ~6GB 9 built-in voices + instruction control
Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign VoiceDesign ~6GB Design voice from text description

Hardware Requirements

  • NVIDIA GPU with 4GB+ VRAM (0.6B) or 8GB+ VRAM (1.7B)
  • NVIDIA driver 550+ (Ampere/Ada) or 570+ (Blackwell RTX 50-series)
  • Docker with NVIDIA Container Toolkit

Credits

Install Qwen3-TTS-API on Unraid in a few clicks.

Find Qwen3-TTS-API in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for Qwen3-TTS-API Review the template variables and paths Click Install

Related apps

Details

Repository
ghcr.io/hsiang-han/qwen3-tts-api:latest
Last Updated2026-07-07
First Seen2026-06-09

Runtime arguments

Web UI
http://[IP]:[PORT:8080]/docs
Network
bridge
Shell
bash
Privileged
false
Extra Params
--gpus all --shm-size=4g

Template configuration

API PortPorttcp

OpenAI-compatible TTS API port. Swagger docs at /docs

Target
8080
Default
8080
Value
8080
Model CachePathrw

Model download cache. First run downloads ~3-7GB. Persists across container recreates.

Target
/root/.cache/huggingface
Default
/mnt/user/appdata/qwen3-tts-api/models
Value
/mnt/user/appdata/qwen3-tts-api/models
Model IDVariable

Model to load. Base models support voice clone. CustomVoice models have 9 built-in voices. See README for all options.

Target
MODEL_ID
Default
Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice
Value
Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice
DtypeVariable

Model precision. bfloat16 recommended. Use float16 for older GPUs without bf16 support.

Target
DTYPE
Default
bfloat16
Value
bfloat16
HuggingFace EndpointVariable

HuggingFace download mirror. China users: change to https://hf-mirror.com

Target
HF_ENDPOINT
Default
https://huggingface.co
Value
https://huggingface.co
NVIDIA Visible DevicesVariable

GPU selection (all, 0, 1, etc.)

Target
NVIDIA_VISIBLE_DEVICES
Default
all
Value
all
NVIDIA Driver CapabilitiesVariable

NVIDIA driver capabilities

Target
NVIDIA_DRIVER_CAPABILITIES
Default
compute,utility
Value
compute,utility