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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: FireRedTeam/FireRedTTS3
|
| 4 |
+
pipeline_tag: text-to-speech
|
| 5 |
+
tags:
|
| 6 |
+
- sglang-omni
|
| 7 |
+
- fireredtts3
|
| 8 |
+
- text-to-speech
|
| 9 |
+
- voice-cloning
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# FireRedTTS3-Base for SGLang Omni
|
| 13 |
+
|
| 14 |
+
We provide our FireRedTTS3-Base checkpoint for inference with
|
| 15 |
+
[SGLang Omni](https://github.com/sgl-project/sglang-omni). It supports
|
| 16 |
+
zero-shot voice cloning from one reference recording and its transcript.
|
| 17 |
+
Audio output is 24 kHz mono, with WAV responses and streaming PCM available
|
| 18 |
+
through the `/v1/audio/speech` API.
|
| 19 |
+
|
| 20 |
+
Our model code and original checkpoint release:
|
| 21 |
+
|
| 22 |
+
- [FireRedTTS3 source code](https://github.com/FireRedTeam/FireRedTTS3)
|
| 23 |
+
- [Original FireRedTTS3 weights and model card](https://huggingface.co/FireRedTeam/FireRedTTS3)
|
| 24 |
+
|
| 25 |
+
This card documents the SGLang Omni loading and serving workflow.
|
| 26 |
+
|
| 27 |
+
## Install SGLang Omni
|
| 28 |
+
|
| 29 |
+
Use Linux with an NVIDIA CUDA GPU and Python 3.12. Follow the
|
| 30 |
+
[SGLang Omni installation guide](https://github.com/sgl-project/sglang-omni/blob/main/docs/get_started/installation.md)
|
| 31 |
+
for the CUDA, UCX, and FlashAttention prerequisites, then install from source:
|
| 32 |
+
|
| 33 |
+
```bash
|
| 34 |
+
git clone https://github.com/sgl-project/sglang-omni.git
|
| 35 |
+
cd sglang-omni
|
| 36 |
+
pip install uv
|
| 37 |
+
uv venv .venv -p 3.12
|
| 38 |
+
source .venv/bin/activate
|
| 39 |
+
uv pip install --prerelease=allow -e '.[firered-tts3]'
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
Use a revision containing the FireRedTTS3 integration. Before that integration
|
| 43 |
+
is merged, check out the corresponding PR revision before installing; an older
|
| 44 |
+
PyPI release or checkout does not provide this model. Run the following commands
|
| 45 |
+
from the `sglang-omni` repository root.
|
| 46 |
+
|
| 47 |
+
## Download this checkpoint
|
| 48 |
+
|
| 49 |
+
Replace `<HF_ORG>` with the organization or account hosting this checkpoint.
|
| 50 |
+
The repository ID is a publication placeholder, not a currently verified URL.
|
| 51 |
+
|
| 52 |
+
```bash
|
| 53 |
+
hf download '<HF_ORG>/FireRedTTS3-Base' \
|
| 54 |
+
--local-dir ./models/FireRedTTS3-Base
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
Download the complete repository, including configuration, tokenizer, and
|
| 58 |
+
`redae/` assets, plus `campp/`. Loading only the root
|
| 59 |
+
`model.safetensors` file is insufficient. If you already have the complete
|
| 60 |
+
checkpoint locally, use that directory directly.
|
| 61 |
+
|
| 62 |
+
## Start the server
|
| 63 |
+
|
| 64 |
+
```bash
|
| 65 |
+
CUDA_VISIBLE_DEVICES=0 sgl-omni serve \
|
| 66 |
+
--model-path ./models/FireRedTTS3-Base \
|
| 67 |
+
--config examples/configs/firered_tts3_base.yaml \
|
| 68 |
+
--allowed-local-media-path "$PWD/docs/_static/audio" \
|
| 69 |
+
--port 8000
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
Wait for `/health` to return HTTP 200 before sending requests. Initial model
|
| 73 |
+
loading, compilation, and warmup can take several minutes.
|
| 74 |
+
|
| 75 |
+
The reference clips below are included in the SGLang Omni repository. Local
|
| 76 |
+
paths are resolved on the **server**, relative to its working directory.
|
| 77 |
+
For your own clips, allow their directory with `--allowed-local-media-path`
|
| 78 |
+
and supply the matching transcript for cloning.
|
| 79 |
+
|
| 80 |
+
## Voice cloning
|
| 81 |
+
|
| 82 |
+
Provide exactly one reference recording and its actual transcript. The example
|
| 83 |
+
uses the repository's `ref_voice.wav`:
|
| 84 |
+
|
| 85 |
+
```bash
|
| 86 |
+
curl --fail-with-body -X POST http://localhost:8000/v1/audio/speech \
|
| 87 |
+
-H 'Content-Type: application/json' \
|
| 88 |
+
-d '{
|
| 89 |
+
"model": "FireRedTTS3-Base",
|
| 90 |
+
"input": "Hello, welcome to SGLang Omni.",
|
| 91 |
+
"language": "English",
|
| 92 |
+
"references": [{
|
| 93 |
+
"audio_path": "docs/_static/audio/ref_voice.wav",
|
| 94 |
+
"text": "It was the night before my birthday. Hooray! It’s almost here! It may not be a holiday, but it’s the best day of the year."
|
| 95 |
+
}],
|
| 96 |
+
"seed": 42
|
| 97 |
+
}' --output clone.wav
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
## Streaming
|
| 101 |
+
|
| 102 |
+
To stream audio, add `"stream": true` and `"response_format": "pcm"` to
|
| 103 |
+
the request and use `curl -N`. The response contains raw **24 kHz, signed
|
| 104 |
+
16-bit little-endian, mono PCM**. Save it as `output.pcm` and convert it with:
|
| 105 |
+
|
| 106 |
+
```bash
|
| 107 |
+
ffmpeg -f s16le -ar 24000 -ac 1 -i output.pcm output.wav
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
The server also exposes `/v1/audio/speech/stream` over WebSocket. See the
|
| 111 |
+
[WebSocket protocol](https://github.com/sgl-project/sglang-omni/blob/main/docs/basic_usage/tts.md#websocket-speech-streaming)
|
| 112 |
+
for `session.config`, `input.text`, `input.commit`, and `input.done` events.
|
| 113 |
+
|
| 114 |
+
A complete streaming request:
|
| 115 |
+
|
| 116 |
+
```bash
|
| 117 |
+
curl --fail-with-body -N -X POST http://localhost:8000/v1/audio/speech \
|
| 118 |
+
-H 'Content-Type: application/json' \
|
| 119 |
+
-d '{
|
| 120 |
+
"model": "FireRedTTS3-Base",
|
| 121 |
+
"input": "Hello, welcome to SGLang Omni.",
|
| 122 |
+
"language": "English",
|
| 123 |
+
"ref_audio": "docs/_static/audio/ref_voice.wav",
|
| 124 |
+
"ref_text": "It was the night before my birthday. Hooray! It’s almost here! It may not be a holiday, but it’s the best day of the year.",
|
| 125 |
+
"stream": true,
|
| 126 |
+
"response_format": "pcm",
|
| 127 |
+
"seed": 42
|
| 128 |
+
}' --output output.pcm
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
## Offline Python SDK
|
| 132 |
+
|
| 133 |
+
Save this as `offline_tts.py` in the SGLang Omni repository root and run
|
| 134 |
+
`CUDA_VISIBLE_DEVICES=0 python offline_tts.py`. This starts the pipeline
|
| 135 |
+
locally without an HTTP server.
|
| 136 |
+
|
| 137 |
+
```python
|
| 138 |
+
import asyncio
|
| 139 |
+
import multiprocessing as mp
|
| 140 |
+
from pathlib import Path
|
| 141 |
+
|
| 142 |
+
from sglang_omni.client import Client, GenerateRequest
|
| 143 |
+
from sglang_omni.models.firered_tts3.config import FireRedTTS3PipelineConfig
|
| 144 |
+
from sglang_omni.pipeline.mp_runner import MultiProcessPipelineRunner
|
| 145 |
+
|
| 146 |
+
|
| 147 |
+
async def main() -> None:
|
| 148 |
+
config = FireRedTTS3PipelineConfig(
|
| 149 |
+
model_path="./models/FireRedTTS3-Base",
|
| 150 |
+
)
|
| 151 |
+
runner = MultiProcessPipelineRunner(config)
|
| 152 |
+
await runner.start(timeout=600)
|
| 153 |
+
try:
|
| 154 |
+
client = Client(runner.coordinator)
|
| 155 |
+
result = await client.speech(
|
| 156 |
+
GenerateRequest(
|
| 157 |
+
prompt={
|
| 158 |
+
"input": "Hello, welcome to SGLang Omni.",
|
| 159 |
+
"language": "English",
|
| 160 |
+
"ref_audio": "docs/_static/audio/ref_voice.wav",
|
| 161 |
+
"ref_text": "It was the night before my birthday. Hooray! It’s almost here! It may not be a holiday, but it’s the best day of the year.",
|
| 162 |
+
"seed": 42,
|
| 163 |
+
},
|
| 164 |
+
stream=False,
|
| 165 |
+
),
|
| 166 |
+
request_id="demo-1",
|
| 167 |
+
)
|
| 168 |
+
Path("offline.wav").write_bytes(result.audio_bytes)
|
| 169 |
+
finally:
|
| 170 |
+
await runner.stop()
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
if __name__ == "__main__":
|
| 174 |
+
mp.set_start_method("spawn", force=True)
|
| 175 |
+
asyncio.run(main())
|
| 176 |
+
```
|
| 177 |
+
|
| 178 |
+
## Serving notes
|
| 179 |
+
|
| 180 |
+
- The current deployment supports a single GPU (`tp_size=1`).
|
| 181 |
+
- HTTP `input` is limited to 400 characters.
|
| 182 |
+
- Use an explicit language: `Chinese` (default), `English`, `Japanese`, `Korean`,
|
| 183 |
+
`German`, `French`, `Russian`, `Portuguese`, `Spanish`, or `Italian`.
|
| 184 |
+
Automatic language detection (`Auto`) is unsupported. These are the stock
|
| 185 |
+
serving API's accepted language values; FireRedTTS3 supports additional
|
| 186 |
+
languages and dialects through our standalone inference pipeline.
|
| 187 |
+
- Submit spoken-form text when normalization is needed. The FastText and LLM
|
| 188 |
+
text-normalization setup in our standalone pipeline is not used in this quick start.
|
| 189 |
+
- Put flow-solver settings under `stage_params.talker`, for example
|
| 190 |
+
`{"n_timesteps": 10, "inference_cfg": 2.0, "max_patches": 200}`. Unknown
|
| 191 |
+
top-level fields are not forwarded as model settings.
|
| 192 |
+
- `seed` controls the per-request flow sampler. Different precisions, hardware,
|
| 193 |
+
or batching schedules can produce different results with the same seed.
|
| 194 |
+
- For our published model-quality results, see the
|
| 195 |
+
[FireRedTTS3 model card](https://huggingface.co/FireRedTeam/FireRedTTS3).
|
| 196 |
+
SGLang Omni runtime accuracy and performance are evaluated separately.
|
| 197 |
+
- The audio phase generates continuous latents. Token-sampling settings
|
| 198 |
+
such as `temperature`, `top_p`, and `top_k` do not control its audio output.
|
| 199 |
+
|
| 200 |
+
See the [FireRedTTS3 cookbook](https://github.com/sgl-project/sglang-omni/blob/main/docs/cookbook/firered_tts3.md)
|
| 201 |
+
for the full request parameters and deployment configuration.
|
| 202 |
+
|
| 203 |
+
## Usage Disclaimer
|
| 204 |
+
|
| 205 |
+
- The project incorporates zero-shot voice cloning functionality; Please note that this capability is intended **solely for academic research purposes**.
|
| 206 |
+
- **DO NOT** use this model for **ANY illegal activities**❗️❗️
|
| 207 |
+
- The developers assume no liability for any misuse of this model.
|
| 208 |
+
- If you identify any instances of **abuse**, **misuse**, or **fraudulent** activities related to this project, **please report them to our team immediately.**
|
| 209 |
+
|
| 210 |
+
## Citation
|
| 211 |
+
|
| 212 |
+
```bib
|
| 213 |
+
@article{fireredtts3,
|
| 214 |
+
title = {FireRedTTS3: Unified Speech Generation and Editing with Semantically Enriched Speech Representations},
|
| 215 |
+
author = {FireRed Team},
|
| 216 |
+
journal = {arXiv preprint},
|
| 217 |
+
year = {2026},
|
| 218 |
+
}
|
| 219 |
+
```
|
| 220 |
+
|
| 221 |
+
## Acknowledgements
|
| 222 |
+
|
| 223 |
+
- [Qwen3](https://github.com/QwenLM/Qwen3) and [Qwen2-Audio](https://github.com/QwenLM/Qwen2-Audio) for the language model and audio understanding foundations
|
| 224 |
+
- <u>DiTAR</u> for the patch-level diffusion autoregressive formulation
|
| 225 |
+
- [X-Codec](https://github.com/zhenye234/xcodec) for the discriminator design used in RedAE training
|
| 226 |
+
- [CAM++](https://modelscope.cn/models/iic/speech_campplus_sv_en_voxceleb_16k) for speaker embedding extraction
|
| 227 |
+
- [fastText](https://fasttext.cc/docs/en/language-identification.html) for automatic language identification
|
| 228 |
+
- [WeTextProcessing](https://github.com/wenet-e2e/WeTextProcessing) (wetext) for the Chinese / English text normalization front-end
|
| 229 |
+
|
| 230 |
+
## License
|
| 231 |
+
|
| 232 |
+
FireRedTTS3 is released under [Apache-2.0](https://github.com/FireRedTeam/FireRedTTS3/blob/main/LICENSE).
|
| 233 |
+
See our [original model card](https://huggingface.co/FireRedTeam/FireRedTTS3)
|
| 234 |
+
for usage guidance and model evaluation details.
|