Standalone serving layer around the local Qwen3-TTS-streaming checkout.
This repo now contains:
qwen_tts_services/: backend service packageapp.py: FastAPI entrypointfrontend/index.html: browser client for websocket streaming testsfrontend/server.py: tiny static file serveruv python install 3.12
uv venv --python 3.12
uv pip install -r requirements.txt
This creates a local .venv, installs the backend dependencies, and installs the local Qwen3-TTS-streaming checkout in editable mode.
If you need GPU-specific Torch / FlashAttention wheels, install those with uv pip install ... first based on the instructions in Qwen3-TTS-streaming/README.md, then run the command above.
Plain HTTP and WS:
uv run python serve_backend.py
TLS for HTTPS and WSS:
QWEN_TTS_PORT=8443 \
QWEN_TTS_SSL_CERTFILE=/path/to/cert.pem \
QWEN_TTS_SSL_KEYFILE=/path/to/key.pem \
uv run python serve_backend.py
Useful environment variables:
QWEN_TTS_MODEL_NAMEQWEN_TTS_DEVICE_MAPQWEN_TTS_DTYPEQWEN_TTS_ATTN_IMPLEMENTATIONQWEN_TTS_SOURCE_DIRQWEN_TTS_HOSTQWEN_TTS_PORTQWEN_TTS_PRELOAD_MODELQWEN_TTS_ENABLE_STREAMING_OPTIMIZATIONSThe backend currently targets the Base voice-clone model flow, because the upstream streaming API is exposed through stream_generate_voice_clone(...).
uv run python frontend/server.py
Open http://127.0.0.1:8080.
POST /api/v1/tts
JSON body example:
{
"text": "Hello from the non-streaming endpoint.",
"language": "Auto",
"reference_audio_path": "/absolute/path/to/reference.wav",
"reference_text": "Reference transcript for in-context cloning."
}
The response body is audio/wav.
WS /api/v1/tts/stream
emit_every_framesdecode_window_framesmax_framesstream_start framepcm_s16le mono audio chunksstream_end frameExample websocket request:
{
"text": "Hello from the streaming endpoint.",
"language": "Auto",
"reference_audio_path": "/absolute/path/to/reference.wav",
"reference_text": "Reference transcript for in-context cloning.",
"emit_every_frames": 4,
"decode_window_frames": 80,
"max_frames": 10000
}
1 commits
Python
96.0%
HTML
4.0%
Standalone serving layer around the local Qwen3-TTS-streaming checkout.
This repo now contains:
qwen_tts_services/: backend service packageapp.py: FastAPI entrypointfrontend/index.html: browser client for websocket streaming testsfrontend/server.py: tiny static file serveruv python install 3.12
uv venv --python 3.12
uv pip install -r requirements.txt
This creates a local .venv, installs the backend dependencies, and installs the local Qwen3-TTS-streaming checkout in editable mode.
If you need GPU-specific Torch / FlashAttention wheels, install those with uv pip install ... first based on the instructions in Qwen3-TTS-streaming/README.md, then run the command above.
Plain HTTP and WS:
uv run python serve_backend.py
TLS for HTTPS and WSS:
QWEN_TTS_PORT=8443 \
QWEN_TTS_SSL_CERTFILE=/path/to/cert.pem \
QWEN_TTS_SSL_KEYFILE=/path/to/key.pem \
uv run python serve_backend.py
Useful environment variables:
QWEN_TTS_MODEL_NAMEQWEN_TTS_DEVICE_MAPQWEN_TTS_DTYPEQWEN_TTS_ATTN_IMPLEMENTATIONQWEN_TTS_SOURCE_DIRQWEN_TTS_HOSTQWEN_TTS_PORTQWEN_TTS_PRELOAD_MODELQWEN_TTS_ENABLE_STREAMING_OPTIMIZATIONSThe backend currently targets the Base voice-clone model flow, because the upstream streaming API is exposed through stream_generate_voice_clone(...).
uv run python frontend/server.py
Open http://127.0.0.1:8080.
POST /api/v1/tts
JSON body example:
{
"text": "Hello from the non-streaming endpoint.",
"language": "Auto",
"reference_audio_path": "/absolute/path/to/reference.wav",
"reference_text": "Reference transcript for in-context cloning."
}
The response body is audio/wav.
WS /api/v1/tts/stream
emit_every_framesdecode_window_framesmax_framesstream_start framepcm_s16le mono audio chunksstream_end frameExample websocket request:
{
"text": "Hello from the streaming endpoint.",
"language": "Auto",
"reference_audio_path": "/absolute/path/to/reference.wav",
"reference_text": "Reference transcript for in-context cloning.",
"emit_every_frames": 4,
"decode_window_frames": 80,
"max_frames": 10000
}
1 commits
Python
96.0%
HTML
4.0%