# Codec-token streaming (on-device decoding) For edge deployments the expensive part of a TTS pipeline that must run near the user is the audio decoder, while the autoregressive talker can stay on a server. Codec-token streaming serves the **talker only** and streams its codec frames to a client that decodes them locally (Qwen3-TTS: 16 codebooks at 12.5 Hz, about 400 B/s of payload before framing). ## Server Deploy the talker-only pipeline: ```bash vllm serve Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice --omni --port 8001 \ --deploy-config qwen3_tts_talker_only.yaml --trust-remote-code ``` `qwen3_tts_talker_only.yaml` selects the registered `qwen3_tts_talker_only` pipeline (stage 0 only, `final_output_type: latent`). The talker publishes its per-step `codes.audio` rows to the client (`omni_client_multimodal_output_keys`), and the WebSocket handler emits them as binary frames. ## Protocol (`/v1/audio/speech/stream`) Client → server: the usual `session.config` with ```json {"type": "session.config", "output_mode": "codec_tokens", "stream_audio": true, "response_format": "pcm", "voice": "vivian", "task_type": "CustomVoice"} ``` then `input.text` / `input.done`. `input.cancel` aborts the in-flight generation (works for PCM sessions too). Server → client per utterance: | message | content | |---|---| | `codec.start` (JSON) | `codebooks`, `codebook_size`, `frame_rate_hz`, `sample_rate`, `decoder_id`, `header_format` | | binary frames | header `