diff --git a/docs/serving/speech_api.md b/docs/serving/speech_api.md index 0527ab443..d4871ce15 100644 --- a/docs/serving/speech_api.md +++ b/docs/serving/speech_api.md @@ -95,7 +95,7 @@ response.stream_to_file("output.wav") ### Endpoint -``` +```text POST /v1/audio/speech Content-Type: application/json ``` @@ -105,7 +105,7 @@ Content-Type: application/json #### OpenAI Standard Parameters | Parameter | Type | Default | Description | -|-----------|------|---------|-------------| +| ----------- | ------ | --------- | ------------- | | `input` | string | **required** | The text to synthesize into speech | | `model` | string | server's model | Model to use (optional, should match server if specified) | | `voice` | string | "vivian" | Speaker name (e.g., vivian, ryan, aiden) | @@ -115,9 +115,9 @@ Content-Type: application/json #### vLLM-Omni Extension Parameters | Parameter | Type | Default | Description | -|-----------|------|---------|-------------| +| ----------- | ------ | --------- | ------------- | +| `task_type` | string | null (inferred) | TTS task type: CustomVoice, VoiceDesign, or Base. For Qwen3-TTS, `ref_audio` or `ref_text` infers Base when this field is omitted, while an uploaded/precomputed voice always selects Base. Other omitted values select CustomVoice; VoiceDesign must be specified explicitly. | | `sample_rate` | integer | model native | Target output sample rate. Qwen3-TTS supports 8000 or 24000 Hz; the model remains native 24 kHz internally and is resampled before encoding. | -| `task_type` | string | "CustomVoice" | TTS task type: CustomVoice, VoiceDesign, or Base | | `language` | string | "Auto" | Language (see supported languages below) | | `instructions` | string | "" | Voice style/emotion instructions | | `max_new_tokens` | integer | 2048 | Maximum tokens to generate | @@ -131,7 +131,7 @@ Content-Type: application/json #### Voice Clone Parameters (Base task) | Parameter | Type | Default | Description | -|-----------|------|---------|-------------| +| ----------- | ------ | --------- | ------------- | | `ref_audio` | string | null | Reference audio (HTTP URL, base64 data URL, or `file://` URI with `--allowed-local-media-path`). Local files fold `mtime_ns` and `size` into cache keys to automatically reload on-disk edits; HTTP URLs and base64 URIs remain cached by string locator. | | `ref_text` | string | null | Transcript of reference audio | | `x_vector_only_mode` | bool | null | Use speaker embedding only (no ICL) | @@ -205,7 +205,7 @@ The `usage` object on `speech.audio.done` is the same shape returned per item by ### Voices Endpoint -``` +```text GET /v1/audio/voices ``` @@ -230,7 +230,7 @@ Lists available voices for the loaded model. `uploaded_voices` is always present (empty list when no custom voices have been uploaded). Fields `ref_text` and `speaker_description` are omitted per-entry when not provided at upload time. -``` +```text POST /v1/audio/voices Content-Type: multipart/form-data ``` @@ -240,7 +240,7 @@ Upload a new voice sample for voice cloning in Base task TTS requests. **Form Parameters:** | Parameter | Type | Required | Description | -|-----------|------|----------|-------------| +| ----------- | ------ | ---------- | ------------- | | `audio_sample` | file | Yes | Audio file (max 10MB, supported formats: wav, mp3, flac, ogg, aac, webm, mp4) | | `consent` | string | Yes | Consent recording ID | | `name` | string | Yes | Name for the new voice | @@ -289,7 +289,7 @@ The `/v1/audio/speech/stream` WebSocket endpoint accepts text incrementally and Client -> Server: | Message | Description | -|---------|-------------| +| --------- | ------------- | | `{"type": "session.config", ...}` | Session configuration (first message; may be resent between utterances to change it) | | `{"type": "input.text", "text": "..."}` | Text chunk | | `{"type": "input.done"}` | End of utterance: flushes the buffer and keeps the connection open | @@ -298,7 +298,7 @@ Client -> Server: Server -> Client: | Message | Description | -|---------|-------------| +| --------- | ------------- | | `{"type": "audio.start", "utterance_index": 0, "sentence_index": 0, "sentence_text": "...", "format": "pcm", "sample_rate": 24000}` | Audio generation starting for the buffered input | | Binary frame | Raw audio bytes (one or more PCM chunks when `stream_audio=true`) | | `{"type": "audio.done", "utterance_index": 0, "sentence_index": 0, "total_bytes": 96000, "error": false}` | Audio complete for the buffered input | @@ -312,17 +312,17 @@ text, emits `session.done`, and then waits on the same connection for the next utterance, so a client that speaks repeatedly (for example one driven by an upstream LLM) pays the WebSocket handshake once instead of once per utterance. -* The session config is sticky. Send `input.text` again straight after +- The session config is sticky. Send `input.text` again straight after `session.done` to reuse it, or send another `session.config` first to change voice, format, or reference audio. A `session.config` sent while text is still buffered is rejected so no pending input is silently dropped. -* An utterance is the flush unit, not a linguistic one: it is whatever text was +- An utterance is the flush unit, not a linguistic one: it is whatever text was buffered when `input.done` arrived, of any length, synthesized as one request. `utterance_index` counts those flushes across the connection, so it tells you which `input.done` a frame belongs to. `sentence_index` counts within one flush and so pairs with `total_sentences`, which means every utterance reports `sentence_index: 0` of `total_sentences: 1` (or `0` for an empty buffer). -* End the connection with `session.close`, or by closing the socket. An idle +- End the connection with `session.close`, or by closing the socket. An idle connection is still closed after the server's idle timeout, which now also applies to the gap between utterances. @@ -331,10 +331,9 @@ upstream LLM) pays the WebSocket handshake once instead of once per utterance. All REST API parameters are supported, plus: | Parameter | Type | Default | Description | -|-----------|------|---------|-------------| +| ----------- | ------ | --------- | ------------- | | `stream_audio` | bool | false | Stream one or more PCM chunks for the buffered input over WebSocket | - ```bash DELETE /v1/audio/voices/{name} ``` @@ -344,7 +343,7 @@ Delete an uploaded voice sample. **Path Parameters:** | Parameter | Type | Required | Description | -|-----------|------|----------|-------------| +| ----------- | ------ | ---------- | ------------- | | `name` | string | Yes | Name of the voice to delete | **Response Example:** @@ -434,6 +433,7 @@ curl -X POST http://localhost:8091/v1/audio/speech \ ### Upload Voice Upload voice (speaker embedding only): + ```bash curl -X POST http://localhost:8091/v1/audio/voices \ -F "audio_sample=@/path/to/voice_sample.wav" \ @@ -442,6 +442,7 @@ curl -X POST http://localhost:8091/v1/audio/voices \ ``` Upload voice with transcript (in-context cloning, higher quality): + ```bash curl -X POST http://localhost:8091/v1/audio/voices \ -F "audio_sample=@/path/to/voice_sample.wav" \ @@ -451,6 +452,7 @@ curl -X POST http://localhost:8091/v1/audio/voices \ ``` ### Use Uploaded Voice + ```bash curl -X POST http://localhost:8091/v1/audio/speech \ -H "Content-Type: application/json" \ @@ -460,6 +462,11 @@ curl -X POST http://localhost:8091/v1/audio/speech \ }' --output cloned.wav ``` +For Qwen3-TTS, an uploaded voice is a Base voice-cloning input. The server +infers `task_type="Base"` when `voice` names an uploaded entry, so the request +must be sent to a Base checkpoint. Built-in presets such as `vivian` and +`ryan` remain CustomVoice speakers and require a CustomVoice checkpoint. + ### Voice Storage & Caching Uploaded voices are persisted to disk as a single `.safetensors` file per voice @@ -479,6 +486,9 @@ once. ### Precomputed Custom Voices Qwen3-TTS Base and VoxCPM2 can load offline-precomputed voices at startup. +Qwen3-TTS precomputed voices follow the same Base task and checkpoint-matching +rules as uploaded voices. + Generate a directory containing `custom_voice_manifest.json` plus one `.safetensors` file per voice, then set the pipeline-wide deploy config field: @@ -517,7 +527,7 @@ by `GET /v1/audio/voices`. Valid precomputed voices can be used in **Configuration (environment variables):** | Variable | Default | Description | -|----------|---------|-------------| +| ---------- | --------- | ------------- | | `SPEAKER_SAMPLES_DIR` | `~/.cache/vllm-omni/speakers` | Directory for persisted uploaded speakers (`.safetensors` files). | | `SPEAKER_MAX_UPLOADED` | `1000` | Maximum number of uploaded speakers kept on disk. Upload requests past the cap return 400. | @@ -529,7 +539,7 @@ The batch endpoint synthesizes multiple texts in a single request, returning all ### Endpoint -``` +```text POST /v1/audio/speech/batch Content-Type: application/json ``` @@ -537,7 +547,7 @@ Content-Type: application/json ### Request Parameters | Parameter | Type | Default | Description | -|-----------|------|---------|-------------| +| ----------- | ------ | --------- | ------------- | | `items` | array | **required** | List of items to synthesize (1–32) | | `model` | string | server's model | Model to use | | `voice` | string | null | Default voice for all items | @@ -554,7 +564,7 @@ Content-Type: application/json Each item in the `items` array requires only `input` (the text). All other fields are optional and override the batch-level defaults when set: | Field | Type | Description | -|-------|------|-------------| +| ------- | ------ | ------------- | | `input` | string | **required** — text to synthesize | | `voice` | string | Override voice for this item | | `response_format` | string | Override format for this item | @@ -686,7 +696,7 @@ for result in response.json()["results"]: ### Configuration | Parameter | Source | Default | Description | -|-----------|--------|---------|-------------| +| ----------- | -------- | --------- | ------------- | | `tts_batch_max_items` | engine kwarg | 32 | Maximum number of items per batch request | All items are fanned out to `generate()` concurrently. The engine's stage worker automatically batches them up to the configured `max_num_seqs` and queues the rest — no client-side throttling needed. @@ -709,17 +719,17 @@ The bundled config also sets `initial_codec_chunk_frames: 1`. This emits only th ### Qwen3-TTS | Model | Task Type | Description | -|-------|-----------|-------------| +| ------- | ----------- | ------------- | | `Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice` | CustomVoice | Predefined speaker voices with optional style control | | `Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign` | VoiceDesign | Natural language voice style description | -| `Qwen/Qwen3-TTS-12Hz-1.7B-Base` | Base | Voice cloning from reference audio | +| `Qwen/Qwen3-TTS-12Hz-1.7B-Base` | Base | Voice cloning from reference audio or an uploaded/precomputed voice | | `Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice` | CustomVoice | Smaller/faster variant | -| `Qwen/Qwen3-TTS-12Hz-0.6B-Base` | Base | Smaller/faster variant for voice cloning | +| `Qwen/Qwen3-TTS-12Hz-0.6B-Base` | Base | Smaller/faster Base variant for voice cloning, including uploaded/precomputed voices | ### Fish Speech S2 Pro | Model | Description | -|-------|-------------| +| ------- | ------------- | | `fishaudio/s2-pro` | 4B dual-AR TTS with DAC codec (44.1 kHz). Supports text-to-speech and voice cloning. | Fish Speech uses `ref_audio` and `ref_text` for voice cloning (no `task_type` needed). The `voice` field should be set to `"default"`. See the [Fish Speech section of the online TTS hub](../user_guide/examples/online_serving/text_to_speech.md#fish-speech-s2-pro) for details. @@ -727,31 +737,31 @@ Fish Speech uses `ref_audio` and `ref_text` for voice cloning (no `task_type` ne ### Voxtral TTS | Model | Description | -|-------|-------------| +| ------- | ------------- | | `mistralai/Voxtral-4B-TTS-2603` | 3B AR + FlowMatching TTS. Supports text-to-speech with preset voices. | ### CosyVoice3 | Model | Description | -|-------|-------------| +| ------- | ------------- | | `FunAudioLLM/Fun-CosyVoice3-0.5B-2512` | Voice cloning from `ref_audio` + `ref_text`. No built-in voice presets — upload a voice or pass `ref_audio`/`ref_text` per request. | ### OmniVoice | Model | Description | -|-------|-------------| +| ------- | ------------- | | `k2-fsa/OmniVoice` | Pure-diffusion TTS. Supports voice cloning via `ref_audio` (with optional `ref_text`); no built-in voice presets. | ### VoxCPM2 | Model | Description | -|-------|-------------| +| ------- | ------------- | | `openbmb/VoxCPM2` | TTS + voice cloning with built-in speaker presets and uploaded-voice support. Accepts `voice` (preset or uploaded) or `ref_audio` + optional `ref_text`. | ### MOSS-TTS-Nano | Model | Description | -|-------|-------------| +| ------- | ------------- | | `OpenMOSS-Team/MOSS-TTS-Nano` | Voice cloning only. Requires `ref_audio` (or an uploaded `voice`); no built-in voice presets. `ref_text` is accepted but ignored — upstream's `voice_clone` mode does not consume a transcript. | ## Error Responses @@ -771,6 +781,19 @@ Invalid parameters: } ``` +Qwen3-TTS task/checkpoint mismatch: + +```json +{ + "error": { + "message": "Qwen3-TTS CustomVoice checkpoint does not support task_type='Base'. Use task_type='CustomVoice' or load the matching Base checkpoint.", + "type": "BadRequestError", + "param": null, + "code": 400 + } +} +``` + ### 404 Not Found Model not found: @@ -791,10 +814,15 @@ Model not found: ### "TTS model did not produce audio output" Ensure you're using the correct model variant for your task type: + - CustomVoice task → CustomVoice model - VoiceDesign task → VoiceDesign model - Base task → Base model +Uploaded and precomputed Qwen3-TTS voices select the Base task, even when the +client supplies a different `task_type`; serve them with a Base checkpoint. +Built-in Qwen3-TTS presets remain CustomVoice voices. + ### Server Not Running ```bash @@ -805,6 +833,7 @@ curl http://localhost:8091/v1/audio/voices ### Out of Memory If you encounter OOM errors: + 1. Use smaller model variant: `Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice` 2. Reduce `--gpu-memory-utilization` @@ -823,7 +852,7 @@ final-output drain to a condition-variable wakeup at the same time. **Configuration (environment variables):** | Variable | Default | Description | -|----------|---------|-------------| +| --- | --- | --- | | `VLLM_OMNI_EVENT_DRIVEN_ORCH` | `0` (off) | Switches the orchestration loop and the final-output drain from the legacy 1 ms poll to event-driven wakeups. Enabled by `1`, `true`, `yes`, or `on`, matched case-insensitively after surrounding whitespace is stripped; any other value leaves it off. | Set it on the process that runs the orchestrator (stage 0 of an omni diff --git a/docs/user_guide/examples/online_serving/text_to_speech.md b/docs/user_guide/examples/online_serving/text_to_speech.md index 5d4ccbf3b..f1b643ac7 100644 --- a/docs/user_guide/examples/online_serving/text_to_speech.md +++ b/docs/user_guide/examples/online_serving/text_to_speech.md @@ -2,7 +2,6 @@ Source . - vLLM-Omni exposes TTS models through the OpenAI-compatible [`POST /v1/audio/speech`](https://github.com/vllm-project/vllm-omni/tree/main/docs/serving/speech_api.md) endpoint, launched with `vllm serve --omni`. Each TTS model has its own @@ -16,7 +15,7 @@ For the full list of supported architectures across all modalities, see ## Supported Models | Model | HuggingFace repo | Voice cloning | Streaming | Voice presets / upload | Gradio demo | -|---|---|---|---|---|---| +| --- | --- | --- | --- | --- | --- | | CosyVoice3 | `FunAudioLLM/Fun-CosyVoice3-0.5B-2512` | ✓ (`ref_audio`+`ref_text`) | ✓ (PCM stream) | — | — | | Fish Speech S2 Pro | `fishaudio/s2-pro` | ✓ (`ref_audio`+`ref_text`) | ✓ (PCM stream) | — | ✓ | | higgs-audio v2 | `bosonai/higgs-audio-v2-generation-3B-base` | ✓ (`ref_audio`+`ref_text`) | ✓ (codec_streaming) | — | — | @@ -104,6 +103,7 @@ For full request-shape documentation (all parameters, response formats, error co 2-stage TTS (`talker` + flow-matching `code2wav`) at 24 kHz. Voice cloning only — every request needs `ref_audio` + `ref_text`; there are no built-in voice presets. ### Prerequisites + ```bash huggingface-cli download FunAudioLLM/Fun-CosyVoice3-0.5B-2512 ``` @@ -111,6 +111,7 @@ huggingface-cli download FunAudioLLM/Fun-CosyVoice3-0.5B-2512 If your downloaded checkpoint lacks `config.json`, add one with `{"model_type": "cosyvoice3", "architectures": ["CosyVoice3Model"]}` (the loader reads `model_type` to select the class). ### Launch + ```bash vllm serve FunAudioLLM/Fun-CosyVoice3-0.5B-2512 --omni --port 8091 --trust-remote-code # or: @@ -120,13 +121,16 @@ vllm serve FunAudioLLM/Fun-CosyVoice3-0.5B-2512 --omni --port 8091 --trust-remot Streaming is on by default via `async_chunk: true` in `vllm_omni/deploy/cosyvoice3.yaml`. Pass `--no-async-chunk` (or `NO_ASYNC_CHUNK=1 ./cosyvoice3/run_server.sh`) for the legacy synchronous path. ### CLI client + The client defaults to the official upstream zero-shot prompt, so it runs without extra flags: + ```bash cd examples/online_serving/text_to_speech/cosyvoice3 python speech_client.py --text "收到好友从远方寄来的生日礼物。" ``` Pass your own reference clip and transcript for a different voice: + ```bash python speech_client.py --text "Hello, this is a cloned voice." \ --ref-audio /path/to/reference.wav \ @@ -134,6 +138,7 @@ python speech_client.py --text "Hello, this is a cloned voice." \ ``` Stream PCM instead of WAV: + ```bash python speech_client.py --text "Hello world" --stream --output output.pcm ``` @@ -141,6 +146,7 @@ python speech_client.py --text "Hello world" --stream --output output.pcm The client supports `--api-base`, `--model`, `--text`, `--ref-audio`, `--ref-text`, `--response-format`, `--stream`, `--output`. ### Notes + - Stage 0 (`talker`) emits speech tokens; stage 1 (`code2wav`) runs flow matching + HiFiGAN to synthesize waveform. - Deploy config auto-loads from `vllm_omni/deploy/cosyvoice3.yaml` based on HF `model_type`. Pass `--deploy-config ` to override. - For offline inference and the end-to-end script, see the [offline CosyVoice3 section](https://github.com/vllm-project/vllm-omni/tree/main/examples/offline_inference/text_to_speech/README.md#cosyvoice3). @@ -152,19 +158,23 @@ The client supports `--api-base`, `--model`, `--text`, `--ref-audio`, `--ref-tex 4B dual-AR TTS at 44.1 kHz. Server uses the DAC codec. ### Prerequisites + ```bash pip install fish-speech ``` ### Launch + ```bash vllm serve fishaudio/s2-pro --omni --port 8091 # or: ./fish_speech/run_server.sh ``` + The deploy config auto-loads from `vllm_omni/deploy/fish_qwen3_omni.yaml` (the HF `model_type` on the fishaudio checkpoint is `fish_qwen3_omni`). ### Voice cloning + ```bash curl -X POST http://localhost:8091/v1/audio/speech \ -H "Content-Type: application/json" \ @@ -177,6 +187,7 @@ curl -X POST http://localhost:8091/v1/audio/speech \ ``` ### CLI client + ```bash cd examples/online_serving/text_to_speech/fish_speech python speech_client.py --text "Hello, how are you?" @@ -184,12 +195,14 @@ python speech_client.py --text "Hello world" --stream --output output.pcm ``` ### Gradio demo + ```bash ./fish_speech/run_gradio_demo.sh # launches server + Gradio python fish_speech/gradio_demo.py --api-base http://localhost:8091 # if server already running ``` ### Notes + - Output: 44.1 kHz mono. - Streaming PCM player command must use `-r 44100`. @@ -208,12 +221,15 @@ pip install -U "transformers>=5.3.0" ``` ### Launch + ```bash GPUS=6,7 PORT=8094 bash examples/online_serving/text_to_speech/higgs_audio_v2/run_server.sh ``` + Deploy config auto-loads from `vllm_omni/deploy/higgs_audio_v2.yaml`. ### Sending requests + ```bash # Plain TTS python higgs_audio_v2/batch_speech_client.py \ @@ -231,14 +247,17 @@ python higgs_audio_v2/batch_speech_client.py \ ``` ### Notes + - Output: 24 kHz mono. - `--ref-text` must be the real transcript of `--ref-audio`; mismatched text degrades cloned-voice quality. - Out of scope (rejected with explicit 4xx): multi-speaker `[SPEAKERn]` tags inside `input`, `profile:` text-only speaker descriptions, the `ref_audio_in_system_message` system-block variant, chunked long-form generation, and per-request `voice` / `instructions` / `task_type` / `language` / `speed != 1.0` / `x_vector_only_mode` / `speaker_embedding`. + ## GLM-TTS 2-stage TTS (AR + DiT flow-matching) at 24 kHz. Every request requires `ref_audio` + `ref_text`. ### Launch + ```bash vllm serve zai-org/GLM-TTS --omni --trust-remote-code --port 8091 # or: @@ -246,6 +265,7 @@ bash examples/online_serving/text_to_speech/glm_tts/run_server.sh /path/to/GLM-T ``` ### Sending requests + ```bash # Voice cloning (required) python examples/online_serving/text_to_speech/glm_tts/openai_speech_client.py \ @@ -262,11 +282,13 @@ python examples/online_serving/text_to_speech/glm_tts/openai_speech_client.py \ ``` ### Gradio demo + ```bash bash examples/online_serving/text_to_speech/glm_tts/run_gradio_demo.sh ``` ### Notes + - Output: 24 kHz mono WAV via HiFT vocoder. - `ref_audio` + `ref_text` are **required** together on every request. Reference audio should be 3-10 seconds. - Voice cloning feature extraction (WhisperVQ, CampPlus, mel) runs on the model side — no external dependency on the serving layer. @@ -278,12 +300,15 @@ bash examples/online_serving/text_to_speech/glm_tts/run_gradio_demo.sh Zero-shot multilingual TTS (600+ languages). Online serving currently exposes **auto voice** only; voice cloning and voice design are available offline. ### Prerequisites + ```bash huggingface-cli download k2-fsa/OmniVoice ``` + Voice cloning (offline) needs `transformers>=5.3.0`; auto voice works with `transformers>=4.57.0`. ### Launch + ```bash vllm serve k2-fsa/OmniVoice --omni --port 8091 --trust-remote-code # or: @@ -291,6 +316,7 @@ vllm serve k2-fsa/OmniVoice --omni --port 8091 --trust-remote-code ``` ### CLI client + ```bash cd examples/online_serving/text_to_speech/omnivoice python speech_client.py --text "Hello, how are you?" @@ -300,6 +326,7 @@ python speech_client.py --text "Bonjour, comment allez-vous?" --language French The client supports `--api-base`, `--model`, `--text`, `--response-format`, `--language`, `--output`. ### Notes + - Voice cloning and voice design require offline inference; see the [offline OmniVoice section](https://github.com/vllm-project/vllm-omni/tree/main/examples/offline_inference/text_to_speech/README.md#omnivoice). --- @@ -309,7 +336,7 @@ The client supports `--api-base`, `--model`, `--text`, `--response-format`, `--l Three model variants exposed via separate checkpoints: | Variant | HF repo | Use | -|---|---|---| +| --- | --- | --- | | CustomVoice | `Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice` | Predefined speakers (`vivian`, `ryan`, …) with optional style instructions | | VoiceDesign | `Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign` | Natural-language voice style description | | Base | `Qwen/Qwen3-TTS-12Hz-1.7B-Base` | Voice cloning from a reference audio | @@ -317,6 +344,7 @@ Three model variants exposed via separate checkpoints: Each variant ships smaller `0.6B` companions where available. ### Launch + ```bash vllm serve Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice --omni --port 8091 # or: @@ -326,27 +354,30 @@ vllm serve Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice --omni --port 8091 ``` ### Executor backend + Single-GPU serves now default to the uniproc executor (lower IPC overhead, the Base cloning use case from [#2603](https://github.com/vllm-project/vllm-omni/issues/2603) / [#2604](https://github.com/vllm-project/vllm-omni/pull/2604)). `vllm_omni/deploy/qwen3_tts.yaml` is the only Qwen3-TTS deploy config; pass `--deploy-config ` to override. To opt out of chunked streaming, pass `--no-async-chunk` — the pipeline auto-dispatches to the end-to-end codec processor. ### Tuning stage 1 `max_num_seqs` per task type + The bundled `qwen3_tts.yaml` ships stage 1 (Code2Wav) at `max_num_seqs: 10`, tuned for Base voice cloning: stage-1 lifetimes are long (~3 s/req), so admitting up to 10 concurrent codec sequences lets requests progress in parallel in the scheduler — ~2× TTFA p95 at c=4 / c=8 (1× H100, 1.7B-Base, seed-tts) at an 8–12 % audio-throughput cost. CustomVoice / VoiceDesign have much shorter stage-1 lifetimes (~50–200 ms) and are TTFA-optimal at `max_num_seqs: 1`. Override the default when serving those task types: ```bash -vllm serve Qwen/Qwen3-TTS-12Hz-1.7B-Base --omni \ +vllm serve Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice --omni \ --stage-overrides '{"1": {"max_num_seqs": 1}}' ``` ### Sending requests + ```bash # CustomVoice with a predefined speaker python qwen3_tts/openai_speech_client.py \ --model Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice \ --text "今天天气真好" \ - --voice ryan \ + --speaker ryan \ --instructions "用开心的语气说" # VoiceDesign with a style description @@ -366,7 +397,9 @@ python qwen3_tts/openai_speech_client.py \ ``` ### Voices endpoint + List available voices, or upload a custom one for Base cloning: + ```bash # List curl http://localhost:8091/v1/audio/voices @@ -379,10 +412,18 @@ curl -X POST http://localhost:8091/v1/audio/voices \ -F "ref_text=The exact transcript of the audio sample." \ -F "speaker_description=warm narrator" ``` -Uploaded voices are then usable as `voice="custom_voice_1"` on subsequent requests. + +For Qwen3-TTS, uploaded voices are Base voice-cloning inputs and require a Base +checkpoint. When a request names an uploaded voice, the server infers +`task_type="Base"`. Built-in presets such as `vivian` and `ryan` remain +CustomVoice speakers and require a CustomVoice checkpoint. ### Precomputed custom voices -For reused Base voice-cloning speakers, precompute the reference artifacts once and load them at server startup: + +For reused Base voice-cloning speakers, precompute the reference artifacts once +and load them at server startup. Precomputed voices use the same Base task and +checkpoint-matching rules as uploaded voices: + ```bash python qwen3_tts/precompute_custom_voice.py \ --model Qwen/Qwen3-TTS-12Hz-1.7B-Base \ @@ -392,11 +433,15 @@ python qwen3_tts/precompute_custom_voice.py \ --mode icl \ --output-dir /path/to/custom_voices ``` + `--mode icl` stores both `speaker_embedding` and `ref_code`; `--mode xvec` stores only the speaker embedding. Add the output directory to a deploy config: + ```yaml custom_voice_dir: /path/to/custom_voices ``` + Then start the server with that config and call the Speech API with only the voice name: + ```bash vllm serve Qwen/Qwen3-TTS-12Hz-1.7B-Base --omni --deploy-config /path/to/qwen3_tts_custom_voice.yaml @@ -407,6 +452,7 @@ curl -X POST http://localhost:8091/v1/audio/speech \ ``` ### Streaming PCM + ```bash curl -X POST http://localhost:8091/v1/audio/speech \ -H "Content-Type: application/json" \ @@ -419,16 +465,20 @@ curl -X POST http://localhost:8091/v1/audio/speech \ "response_format": "pcm" }' --no-buffer | play -t raw -r 24000 -e signed -b 16 -c 1 - ``` + Raw PCM streaming requires `stream_format="audio"`, `response_format="pcm"`, and `async_chunk: true` in the deploy config (default in `qwen3_tts.yaml`). `speed` is not supported when streaming. ### Streaming WebSocket + The `/v1/audio/speech/stream` endpoint accepts text incrementally and synthesizes the buffered text as one continuous request on `input.done`: + ```bash python qwen3_tts/streaming_speech_client.py --text "Hello world. How are you? I am fine." python qwen3_tts/streaming_speech_client.py --text "..." --simulate-stt --stt-delay 0.1 ``` `input.done` flushes without closing, so repeating `--text` synthesizes several utterances over one connection: + ```bash python qwen3_tts/streaming_speech_client.py \ --text "First utterance." \ @@ -436,6 +486,7 @@ python qwen3_tts/streaming_speech_client.py \ ``` ### Gradio demos + ```bash ./qwen3_tts/run_gradio_demo.sh # CustomVoice (default) ./qwen3_tts/run_gradio_demo.sh --task-type VoiceDesign @@ -447,12 +498,15 @@ python qwen3_tts/gradio_fastrtc_demo.py --api-base http://localhost:8000 ``` ### Speaker embedding interpolation + `qwen3_tts/speaker_embedding_interpolation.py` blends two predefined speakers' embeddings to produce intermediate voices. See the script for usage. ### Batch client + `qwen3_tts/batch_speech_client.py` issues many concurrent requests for throughput measurement. ### Notes + - Base voice cloning has uniproc-vs-mp tradeoffs depending on per-request reference audio cost; see the executor-backend section above. - With async chunking, Qwen3-TTS Base voice cloning sends the full reference context in the first Code2Wav packet, then caches that prefix on the Code2Wav stage for follow-up chunks in the same request. - `vllm_omni/deploy/qwen3_tts.yaml` is the default deploy config (loaded by HF `model_type`); per-stage runtime overrides are available via `--stage-N- `. @@ -467,12 +521,15 @@ python qwen3_tts/gradio_fastrtc_demo.py --api-base http://localhost:8000 Single-stage native AR TTS at 48 kHz. ### Launch + ```bash vllm serve openbmb/VoxCPM2 --omni --host 0.0.0.0 --port 8000 ``` + Deploy config auto-loads from `vllm_omni/deploy/voxcpm2.yaml`. Pass `--deploy-config ` to override or `--stage-N- ` for per-stage runtime tweaks. ### Sending requests + ```bash # Zero-shot synthesis python voxcpm2/openai_speech_client.py --text "Hello, this is VoxCPM2." @@ -482,10 +539,13 @@ python voxcpm2/openai_speech_client.py \ --text "This should sound like the reference speaker." \ --ref-audio /path/to/reference.wav ``` + The `ref_audio` field accepts local file paths (auto-base64), HTTP URLs, or `data:audio/wav;base64,...` data URIs. ### Precomputed custom voices + For repeated VoxCPM2 speakers, precompute the prompt cache and load it through `custom_voice_dir`: + ```bash python voxcpm2/precompute_custom_voice.py \ --model openbmb/VoxCPM2 \ @@ -495,16 +555,21 @@ python voxcpm2/precompute_custom_voice.py \ --prompt-text "Original transcript of the reference audio" \ --output-dir /path/to/custom_voices ``` + Add the output directory to the deploy config: + ```yaml custom_voice_dir: /path/to/custom_voices ``` + After startup, `/v1/audio/voices` lists `alice`, and `/v1/audio/speech` can use `voice="alice"` without sending `ref_audio`. ### Gradio demo (gapless streaming via AudioWorklet) + ```bash python voxcpm2/gradio_demo.py ``` + Uses an AudioWorklet-based player adapted from the Qwen3-TTS demo for gap-free playback. Raw PCM audio is streamed from the OpenAI Speech endpoint with `stream=true` and `stream_format="audio"`. --- @@ -514,24 +579,31 @@ Uses an AudioWorklet-based player adapted from the Qwen3-TTS demo for gap-free p Voxtral-4B-TTS (Mistral). Uses the `mistral_common` `SpeechRequest` protocol; voice presets are model-specific. ### Prerequisites + Latest `mistral_common` with `SpeechRequest` support: + ```bash pip install -e /path/to/mistral-common # or upgrade from PyPI when available ``` ### Launch + ```bash vllm serve mistralai/Voxtral-4B-TTS-2603 --omni --port 8091 ``` + Deploy config auto-loads from `vllm_omni/deploy/voxtral_tts.yaml`. ### Gradio demo + ```bash python voxtral_tts/gradio_demo.py ``` + The demo handles voice-preset selection and reference-audio upload. `voxtral_tts/text_preprocess.py` provides the text-normalization helpers used by the demo (also available for other clients). ### Notes + - Voice presets are listed on the HF model card (`mistralai/Voxtral-4B-TTS-2603`). - Voice cloning is gated upstream and may require a recent `mistral_common`. - A standalone CLI client is not yet shipped; the gradio demo is the canonical reference for now. diff --git a/examples/online_serving/text_to_speech/README.md b/examples/online_serving/text_to_speech/README.md index 69a50540b..500e52773 100644 --- a/examples/online_serving/text_to_speech/README.md +++ b/examples/online_serving/text_to_speech/README.md @@ -13,7 +13,7 @@ For the full list of supported architectures across all modalities, see ## Supported Models | Model | HuggingFace repo | Voice cloning | Streaming | Voice presets / upload | Gradio demo | -|---|---|---|---|---|---| +| --- | --- | --- | --- | --- | --- | | Fish Speech S2 Pro | `fishaudio/s2-pro` | ✓ (`ref_audio`+`ref_text`) | ✓ (PCM stream) | — | ✓ | | GLM-TTS | `zai-org/GLM-TTS` | ✓ (`ref_audio`+`ref_text`, required) | ✓ (PCM stream) | — | ✓ | | IndexTTS-2 | `IndexTeam/IndexTTS-2` | ✓ (`ref_audio` or uploaded `voice`) | `stream=true` response, non-chunk | uploaded audio voice only; no presets | — | @@ -104,6 +104,7 @@ For full request-shape documentation (all parameters, response formats, error co 2-stage TTS (AR + DiT flow-matching) at 24 kHz. Every request requires `ref_audio` + `ref_text`. ### Launch + ```bash vllm serve zai-org/GLM-TTS --omni --trust-remote-code --port 8091 # or: @@ -111,6 +112,7 @@ bash examples/online_serving/text_to_speech/glm_tts/run_server.sh /path/to/GLM-T ``` ### Sending requests + ```bash # Voice cloning (required) python examples/online_serving/text_to_speech/glm_tts/openai_speech_client.py \ @@ -127,11 +129,13 @@ python examples/online_serving/text_to_speech/glm_tts/openai_speech_client.py \ ``` ### Gradio demo + ```bash bash examples/online_serving/text_to_speech/glm_tts/run_gradio_demo.sh ``` ### Notes + - Output: 24 kHz mono WAV via HiFT vocoder. - `ref_audio` + `ref_text` are **required** together on every request. Reference audio should be 3-10 seconds. - Voice cloning feature extraction (WhisperVQ, CampPlus, mel) runs on the model side — no external dependency on the serving layer. @@ -151,6 +155,7 @@ pip install 'vllm-omni[indextts2]' ``` ### Launch + ```bash vllm serve IndexTeam/IndexTTS-2 --omni --trust-remote-code --port 8092 # or, to pass the bundled deploy config explicitly: @@ -164,6 +169,7 @@ bash examples/online_serving/text_to_speech/indextts2/run_server.sh ``` ### Sending requests + ```bash # Voice cloning (ref_audio required) python examples/online_serving/text_to_speech/indextts2/speech_client.py \ @@ -194,6 +200,7 @@ python examples/online_serving/text_to_speech/indextts2/speech_client.py \ ``` ### Notes + - Output: 22.05 kHz mono WAV. - Provide `ref_audio` on the documented raw request path, or pass `voice` only when it names an uploaded audio voice; neither version provides a built-in text-only preset voice. - IndexTTS-2.5 request controls `lang` and `text_normalization` are carried in `extra_params`; the client does this for `--model-version 2.5`. @@ -212,6 +219,7 @@ python examples/online_serving/text_to_speech/indextts2/speech_client.py \ 4B dual-AR TTS at 44.1 kHz. Server uses the DAC codec. ### Prerequisites + ```bash pip install fish-speech ``` @@ -237,14 +245,17 @@ export VLLM_OMNI_FISH_KVCACHE_ATTN=0 ``` ### Launch + ```bash vllm serve fishaudio/s2-pro --omni --port 8091 # or: ./fish_speech/run_server.sh ``` + The deploy config auto-loads from `vllm_omni/deploy/fish_qwen3_omni.yaml` (the HF `model_type` on the fishaudio checkpoint is `fish_qwen3_omni`). ### Voice cloning + ```bash curl -X POST http://localhost:8091/v1/audio/speech \ -H "Content-Type: application/json" \ @@ -257,6 +268,7 @@ curl -X POST http://localhost:8091/v1/audio/speech \ ``` ### CLI client + ```bash cd examples/online_serving/text_to_speech/fish_speech python speech_client.py --text "Hello, how are you?" @@ -264,12 +276,14 @@ python speech_client.py --text "Hello world" --stream --output output.pcm ``` ### Gradio demo + ```bash ./fish_speech/run_gradio_demo.sh # launches server + Gradio python fish_speech/gradio_demo.py --api-base http://localhost:8091 # if server already running ``` ### Notes + - Output: 44.1 kHz mono. - Streaming PCM player command must use `-r 44100`. @@ -280,10 +294,13 @@ python fish_speech/gradio_demo.py --api-base http://localhost:8091 # if server Dense 0.5B two-stage TTS served through `/v1/audio/speech`. Ming uses the standard speech endpoint plus structured controls in `instructions`, `voice`, `language`, `ref_audio`, `ref_text`, and `speaker_embedding`. ### Launch + ```bash bash examples/online_serving/text_to_speech/ming_tts/run_server.sh ``` + Equivalent manual command: + ```bash vllm-omni serve inclusionAI/Ming-omni-tts-0.5B \ --deploy-config vllm_omni/deploy/ming_tts.yaml \ @@ -292,12 +309,14 @@ vllm-omni serve inclusionAI/Ming-omni-tts-0.5B \ ``` ### Sending requests + ```bash python examples/online_serving/text_to_speech/ming_tts/openai_speech_client.py \ --text "你好,这是 Ming 在线语音合成测试。" ``` Structured dialect control: + ```bash python examples/online_serving/text_to_speech/ming_tts/openai_speech_client.py \ --text "我觉得社会企业同个人都有责任" \ @@ -306,6 +325,7 @@ python examples/online_serving/text_to_speech/ming_tts/openai_speech_client.py \ ``` Zero-shot cloning: + ```bash python examples/online_serving/text_to_speech/ming_tts/openai_speech_client.py \ --text "我们的愿景是构建未来服务业的数字化基础设施,为世界带来更多微小而美好的改变。" \ @@ -314,6 +334,7 @@ python examples/online_serving/text_to_speech/ming_tts/openai_speech_client.py \ ``` ### Notes + - `run_curl.sh` keeps a small sanity subset; use the Ming README for the broader request cookbook. - Online serving is speech-shaped today; music-only `bgm` and text-to-audio `tta` remain offline examples. - Full request details live in [`ming_tts/README.md`](ming_tts/README.md). @@ -325,11 +346,14 @@ python examples/online_serving/text_to_speech/ming_tts/openai_speech_client.py \ Standalone talker-only deployment of Ming-flash-omni-2.0. Voice is controlled through caption text passed via `instructions`. ### Launch + ```bash # from repo root bash examples/online_serving/text_to_speech/ming_flash_omni_tts/run_server.sh ``` + Equivalent manual command: + ```bash vllm serve Jonathan1909/Ming-flash-omni-2.0 \ --deploy-config vllm_omni/deploy/ming_flash_omni_tts.yaml \ @@ -338,6 +362,7 @@ vllm serve Jonathan1909/Ming-flash-omni-2.0 \ ``` ### Sending requests + ```bash python examples/online_serving/text_to_speech/ming_flash_omni_tts/speech_client.py \ --text "我们当迎着阳光辛勤耕作,去摘取,去制作,去品尝,去馈赠。" \ @@ -345,6 +370,7 @@ python examples/online_serving/text_to_speech/ming_flash_omni_tts/speech_client. ``` ASMR-style caption via `instructions`: + ```bash python examples/online_serving/text_to_speech/ming_flash_omni_tts/speech_client.py \ --text "我会一直在这里陪着你,直到你慢慢、慢慢地沉入那个最温柔的梦里……好吗?" \ @@ -353,6 +379,7 @@ python examples/online_serving/text_to_speech/ming_flash_omni_tts/speech_client. ``` ### Notes + - Server uses `use_zero_spk_emb=True` and the cookbook decode defaults (`max_decode_steps=200`, `cfg=2.0`, `sigma=0.25`, `temperature=0.0`). For other caption fields (`语速`, `基频`, `IP`, BGM, etc.) or overriding decode args, use the offline example where `additional_information` is set explicitly. - This is the online counterpart of [`examples/offline_inference/text_to_speech/ming_flash_omni_tts/`](../../offline_inference/text_to_speech/ming_flash_omni_tts/). - For multimodal Ming-flash-omni online serving, see [`examples/online_serving/ming_flash_omni/`](../../ming_flash_omni/). @@ -366,14 +393,17 @@ Single-stage 0.1B AR LM + MOSS-Audio-Tokenizer-Nano codec at 48 kHz mono. Every > The OpenAI-schema `voice` and `ref_text` fields are accepted but ignored — `voice_clone` does not consume a transcript, and upstream's `continuation` mode (the only path that accepts `prompt_text`) emits near-silent output, so it is not exposed here. Sample reference clips ship in the upstream repo under [`assets/audio/`](https://github.com/OpenMOSS/MOSS-TTS-Nano/tree/main/assets/audio). ### Launch + ```bash vllm serve OpenMOSS-Team/MOSS-TTS-Nano --omni --port 8091 # or: ./moss_tts_nano/run_server.sh ``` + The deploy config at `vllm_omni/deploy/moss_tts_nano.yaml` auto-loads; no `--deploy-config`, `--trust-remote-code`, or `--enforce-eager` flags are needed. ### Sending requests + ```bash # One-off fetch of a sample reference clip; cache under XDG_CACHE_HOME. REF_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/moss-tts-nano" @@ -392,6 +422,7 @@ curl -X POST http://localhost:8091/v1/audio/speech \ ``` ### Streaming PCM + ```bash curl -X POST http://localhost:8091/v1/audio/speech \ -H "Content-Type: application/json" \ @@ -405,6 +436,7 @@ curl -X POST http://localhost:8091/v1/audio/speech \ ``` ### Gradio demo + ```bash # Option 1: launch server + Gradio together ./moss_tts_nano/run_gradio_demo.sh @@ -412,9 +444,11 @@ curl -X POST http://localhost:8091/v1/audio/speech \ # Option 2: server already running python moss_tts_nano/gradio_demo.py --api-base http://localhost:8091 ``` -Then open http://localhost:7860 in your browser. + +Then open in your browser. ### Notes + - Output is 48 kHz mono PCM (the upstream tokenizer is internally stereo at 48 kHz; the wrapper averages to mono before reaching the engine). - Standard `/v1/audio/speech` request shape: `input`, `ref_audio` (base64 data URL), `response_format`, `stream`, `max_new_tokens`. The `voice` and `ref_text` fields from the OpenAI schema are accepted but ignored. @@ -425,12 +459,15 @@ Then open http://localhost:7860 in your browser. Zero-shot multilingual TTS (600+ languages). Online serving currently exposes **auto voice** only; voice cloning and voice design are available offline. ### Prerequisites + ```bash huggingface-cli download k2-fsa/OmniVoice ``` + Voice cloning (offline) needs `transformers>=5.3.0`; auto voice works with `transformers>=4.57.0`. ### Launch + ```bash vllm serve k2-fsa/OmniVoice --omni --port 8091 --trust-remote-code # or: @@ -438,6 +475,7 @@ vllm serve k2-fsa/OmniVoice --omni --port 8091 --trust-remote-code ``` ### CLI client + ```bash cd examples/online_serving/text_to_speech/omnivoice # Text-only (auto voice) @@ -463,13 +501,12 @@ python speech_client.py --text "Hello, how are you?" --seed 42 The client supports `--api-base`, `--model`, `--text`, `--response-format`, `--language`, `--voice`, `--ref-audio`, `--ref-text`, `--instructions`, `--seed`, and `--output`. - ## Qwen3-TTS Three model variants exposed via separate checkpoints: | Variant | HF repo | Use | -|---|---|---| +| --- | --- | --- | | CustomVoice | `Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice` | Predefined speakers (`vivian`, `ryan`, …) with optional style instructions | | VoiceDesign | `Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign` | Natural-language voice style description | | Base | `Qwen/Qwen3-TTS-12Hz-1.7B-Base` | Voice cloning from a reference audio | @@ -477,6 +514,7 @@ Three model variants exposed via separate checkpoints: Each variant ships smaller `0.6B` companions where available. ### Launch + ```bash vllm serve Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice --omni --port 8091 # or: @@ -486,11 +524,13 @@ vllm serve Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice --omni --port 8091 ``` ### Executor backend + Single-GPU serves now default to the uniproc executor (lower IPC overhead, the Base cloning use case from [#2603](https://github.com/vllm-project/vllm-omni/issues/2603) / [#2604](https://github.com/vllm-project/vllm-omni/pull/2604)). `vllm_omni/deploy/qwen3_tts.yaml` is the only Qwen3-TTS deploy config; pass `--deploy-config ` to override. To opt out of chunked streaming, pass `--no-async-chunk` — the pipeline auto-dispatches to the end-to-end codec processor. ### Sending requests + ```bash # CustomVoice with a predefined speaker python qwen3_tts/openai_speech_client.py \ @@ -516,7 +556,9 @@ python qwen3_tts/openai_speech_client.py \ ``` ### Voices endpoint + List available voices, or upload a custom one for Base cloning: + ```bash # List curl http://localhost:8091/v1/audio/voices @@ -529,10 +571,18 @@ curl -X POST http://localhost:8091/v1/audio/voices \ -F "ref_text=The exact transcript of the audio sample." \ -F "speaker_description=warm narrator" ``` -Uploaded voices are then usable as `voice="custom_voice_1"` on subsequent requests. + +For Qwen3-TTS, uploaded voices are Base voice-cloning inputs and require a Base +checkpoint. When a request names an uploaded voice, the server infers +`task_type="Base"`. Built-in presets such as `vivian` and `ryan` remain +CustomVoice speakers and require a CustomVoice checkpoint. ### Precomputed custom voices -For reused Base voice-cloning speakers, precompute the reference artifacts once and load them at server startup: + +For reused Base voice-cloning speakers, precompute the reference artifacts once +and load them at server startup. Precomputed voices use the same Base task and +checkpoint-matching rules as uploaded voices: + ```bash python qwen3_tts/precompute_custom_voice.py \ --model Qwen/Qwen3-TTS-12Hz-1.7B-Base \ @@ -542,11 +592,15 @@ python qwen3_tts/precompute_custom_voice.py \ --mode icl \ --output-dir /path/to/custom_voices ``` + `--mode icl` stores both `speaker_embedding` and `ref_code`; `--mode xvec` stores only the speaker embedding. Add the output directory to a deploy config: + ```yaml custom_voice_dir: /path/to/custom_voices ``` + Then start the server with that config and call the Speech API with only the voice name: + ```bash vllm serve Qwen/Qwen3-TTS-12Hz-1.7B-Base --omni --deploy-config /path/to/qwen3_tts_custom_voice.yaml @@ -557,6 +611,7 @@ curl -X POST http://localhost:8091/v1/audio/speech \ ``` ### Streaming PCM + ```bash curl -X POST http://localhost:8091/v1/audio/speech \ -H "Content-Type: application/json" \ @@ -569,16 +624,20 @@ curl -X POST http://localhost:8091/v1/audio/speech \ "response_format": "pcm" }' --no-buffer | play -t raw -r 24000 -e signed -b 16 -c 1 - ``` + Raw PCM streaming requires `stream_format="audio"`, `response_format="pcm"`, and `async_chunk: true` in the deploy config (default in `qwen3_tts.yaml`). `speed` is not supported when streaming. ### Streaming WebSocket + The `/v1/audio/speech/stream` endpoint accepts text incrementally and synthesizes the buffered text as one continuous request on `input.done`: + ```bash python qwen3_tts/streaming_speech_client.py --text "Hello world. How are you? I am fine." python qwen3_tts/streaming_speech_client.py --text "..." --simulate-stt --stt-delay 0.1 ``` `input.done` flushes without closing, so repeating `--text` synthesizes several utterances over one connection: + ```bash python qwen3_tts/streaming_speech_client.py \ --text "First utterance." \ @@ -586,6 +645,7 @@ python qwen3_tts/streaming_speech_client.py \ ``` To receive word-level timestamps, launch the server with a forced aligner: + ```bash vllm-omni serve Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice \ --omni \ @@ -593,7 +653,9 @@ vllm-omni serve Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice \ --trust-remote-code \ --forced-aligner Qwen/Qwen3-ForcedAligner-0.6B ``` + Then request PCM JSON sidecar chunks: + ```bash python qwen3_tts/streaming_speech_client.py \ --text "Hello world. How are you?" \ @@ -601,6 +663,7 @@ python qwen3_tts/streaming_speech_client.py \ --response-format pcm \ --word-timestamps ``` + The client writes one PCM file per sentence and a matching `sentence_XXX_timestamps.json` sidecar. @@ -613,15 +676,18 @@ still returns — use the WebSocket path for long transcripts. To *see* the alignment instead of reading a JSON sidecar, run the word-timestamp Gradio demo (server must be launched with `--forced-aligner`): + ```bash python qwen3_tts/word_timestamps_demo.py --api-base http://localhost:8091 ``` + Each sentence's audio plays in an `