> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/guides/guides_v2-zh/yin-pin-yu-yu-yin/voxtral-tts.md).

# Voxtral TTS

> **Mistral 的开放权重文本转语音模型：40亿参数、9种语言、零样本声音克隆，仅需 3 GB 显存。**

| 规格       | 数值                                      |
| -------- | --------------------------------------- |
| **开发者**  | Mistral AI                              |
| **参数**   | 40亿                                     |
| **架构**   | 仅解码器 TTS                                |
| **语言**   | 9种（英语、法语、德语、西班牙语、印地语、阿拉伯语、葡萄牙语、意大利语、日语） |
| **许可证**  | Apache 2.0（开放权重）                        |
| **显存**   | 约 3 GB（FP16）                            |
| **延迟**   | 10秒输出耗时 70 毫秒                           |
| **声音克隆** | 基于 3 秒参考音频的零样本                          |
| **发布**   | 2026年3月26日                              |

## 为什么选择 Voxtral TTS？

Voxtral TTS 是 Mistral 针对 ElevenLabs 和 OpenAI TTS 的开放权重方案。对 Clore.ai 用户的主要优势：

* **可在任何 GPU 上运行** ——仅需 3 GB 显存，甚至 RTX 3060 也能完美运行
* **没有 API 费用** ——自托管 = 无限合成，边际成本为零
* **数据隐私** ——音频永远不会离开你的机器
* **零样本克隆** ——仅凭 3 秒参考音频即可克隆任何声音
* **原生支持 9 种语言** ——包括印地语和阿拉伯语，而这些往往是竞争对手缺少的
* **实时速度** ——在 RTX 4070 及以上上 RTF 为 0.1–0.2×（10 秒片段仅需 1–2 秒）

## Clore.ai 上的 GPU 要求

| GPU           | 显存    | 性能             | Clore.ai 价格      |
| ------------- | ----- | -------------- | ---------------- |
| RTX 3060 12GB | 12 GB | ✅ 良好——3–4× 实时  | 起价 $0.03–0.07/小时 |
| RTX 3090 24GB | 24 GB | ✅ 很棒——批量处理     | 起价 $0.07–0.21/小时 |
| RTX 4070 12GB | 12 GB | ✅ 优秀——5–10× 实时 | 起价 $0.04–0.20/小时 |
| RTX 4090 24GB | 24 GB | ✅ 性能过剩——亚秒级延迟  | 起价 $0.14–0.42/小时 |

> **推荐：** RTX 3060 12GB（Clore.ai 上每小时 $0.03–0.07）是大多数场景的最佳选择。Voxtral 只需要 3 GB 显存，因此你可以将它与其他模型一起运行。

## 在 Clore.ai 上快速开始

### 步骤 1：租用 GPU 服务器

1. 前往 [Clore.ai 市场](https://clore.ai/marketplace)
2. 筛选任何显存 8GB 以上的 GPU
3. 选择一个 **Docker** 部署
4. 使用镜像： `pytorch/pytorch:2.11.0-cuda12.8-cudnn9-devel`

### 步骤 2：安装依赖

```bash
# 通过 SSH 或 Jupyter 终端连接
pip install torch torchaudio transformers accelerate

# 安装 Voxtral TTS 包
pip install voxtral-tts

# 或直接使用 HuggingFace
pip install huggingface_hub
huggingface-cli download mistralai/Voxtral-TTS --local-dir ./voxtral-tts
```

### 步骤 3：基础文本转语音

```python
from voxtral import VoxtralTTS

# 初始化模型（会自动下载约 6 GB 权重）
model = VoxtralTTS.from_pretrained("mistralai/Voxtral-TTS")
model.to("cuda")

# 基础合成
audio = model.synthesize(
    text="欢迎来到 Clore.ai——去中心化 GPU 市场。",
    language="en"
)
audio.save("output.wav")
print(f"已生成 {audio.duration:.1f}s 音频")
```

### 步骤 4：零样本声音克隆

```python
# 从 3 秒参考音频克隆声音
audio = model.synthesize(
    text="这是我的克隆声音，在谈论 GPU 计算。",
    reference_audio="reference_speaker.wav",  # 3秒以上
    language="en"
)
audio.save("cloned_output.wav")
```

### 步骤 5：多语言合成

```python
# 用 9 种受支持语言进行合成
languages = {
    "en": "你好，这里是 Voxtral 在用英语说话。",
    "fr": "你好，这是 Voxtral 在用法语说话。",
    "de": "你好，这里是 Voxtral 在用德语说话。",
    "es": "你好，Voxtral 在用西班牙语说话。",
    "hi": "你好，这是 Voxtral 在用印地语说话。",
    "ar": "你好，这是 Voxtral 在用阿拉伯语说话。",
    "pt": "你好，这里是 Voxtral 在用葡萄牙语说话。",
    "it": "你好，这里是 Voxtral 在用意大利语说话。",
    "ja": "你好，这是 Voxtral 在用日语说话。",
}

for lang, text in languages.items():
    audio = model.synthesize(text=text, language=lang)
    audio.save(f"voxtral_{lang}.wav")
    print(f"[{lang}] 已生成 {audio.duration:.1f}s")
```

## 生产环境 API 服务器

将 Voxtral 部署为 REST API，集成到你的应用中：

```python
# server.py —— Voxtral TTS 的 FastAPI 封装
from fastapi import FastAPI, UploadFile, File
from fastapi.responses import StreamingResponse
from voxtral import VoxtralTTS
import io
import soundfile as sf

app = FastAPI(title="Voxtral TTS API")
model = VoxtralTTS.from_pretrained("mistralai/Voxtral-TTS").to("cuda")

@app.post("/synthesize")
async def synthesize(
    text: str,
    language: str = "en",
    reference: UploadFile = File(None)
):
    kwargs = {"text": text, "language": language}
    if reference:
        ref_bytes = await reference.read()
        kwargs["reference_audio"] = ref_bytes
    
    audio = model.synthesize(**kwargs)
    
    # 以 WAV 流形式返回
    buffer = io.BytesIO()
    sf.write(buffer, audio.numpy(), samplerate=24000, format="WAV")
    buffer.seek(0)
    
    return StreamingResponse(buffer, media_type="audio/wav")

@app.get("/health")
async def health():
    return {"status": "正常", "model": "voxtral-tts", "languages": 9}
```

```bash
# 运行 API 服务器
pip install fastapi uvicorn python-multipart soundfile
uvicorn server:app --host 0.0.0.0 --port 8000

# 测试它
curl -X POST "http://localhost:8000/synthesize?text=你好世界&language=en" \
  --output hello.wav
```

## Docker 部署

```dockerfile
FROM pytorch/pytorch:2.11.0-cuda12.8-cudnn9-devel

WORKDIR /app
RUN pip install voxtral-tts fastapi uvicorn python-multipart soundfile

# 预先下载模型权重
RUN python -c "from voxtral import VoxtralTTS; VoxtralTTS.from_pretrained('mistralai/Voxtral-TTS')"

COPY server.py .
EXPOSE 8000
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8000"]
```

```bash
# 构建并运行
docker build -t voxtral-tts-api .
docker run --gpus all -p 8000:8000 voxtral-tts-api
```

## Voxtral 与其他 TTS 模型对比

| 功能       | Voxtral TTS  | ElevenLabs | Qwen3-TTS | Kokoro TTS | Fish Speech |
| -------- | ------------ | ---------- | --------- | ---------- | ----------- |
| **开源权重** | ✅ Apache 2.0 | ❌ 仅限 API   | ✅         | ✅          | ✅           |
| **显存**   | 3 GB         | 不适用（云端）    | 8 GB      | 2 GB       | 4 GB        |
| **语言**   | 9            | 30+        | 50+       | 5          | 8           |
| **声音克隆** | 3秒参考         | 1秒参考       | 5秒参考      | ❌          | 10秒参考       |
| **延迟**   | 70 毫秒        | 约 200 毫秒   | 约 150 毫秒  | 50 毫秒      | 100 毫秒      |
| **质量**   | ⭐⭐⭐⭐⭐        | ⭐⭐⭐⭐⭐      | ⭐⭐⭐⭐      | ⭐⭐⭐⭐       | ⭐⭐⭐⭐        |
| **自托管**  | ✅            | ❌          | ✅         | ✅          | ✅           |

## 大型项目的批处理

```python
import concurrent.futures
from voxtral import VoxtralTTS

model = VoxtralTTS.from_pretrained("mistralai/Voxtral-TTS").to("cuda")

# 处理整整一章有声书
paragraphs = [
    "第1章：开始……",
    "那是一个黑暗而暴风雨肆虐的夜晚……",
    "主人公向前迈出一步……",
    # ……数百个段落
]

def process_paragraph(idx_text):
    idx, text = idx_text
    audio = model.synthesize(text=text, language="en")
    audio.save(f"chapter1_part{idx:04d}.wav")
    return idx

# 顺序处理（受 GPU 限制）
for i, text in enumerate(paragraphs):
    process_paragraph((i, text))
    
print(f"已处理 {len(paragraphs)} 个段落")
```

## 实时应用的流式模式

```python
# 面向实时应用的流式合成
async def stream_synthesis(text: str, language: str = "en"):
    """以流式分块生成音频，用于低延迟播放。"""
    model = VoxtralTTS.from_pretrained("mistralai/Voxtral-TTS").to("cuda")
    
    async for chunk in model.synthesize_stream(
        text=text,
        language=language,
        chunk_size=4096  # 在 24kHz 下每个块约 170 毫秒
    ):
        yield chunk.numpy().tobytes()
```

## 故障排查

| 问题             | 解决方案                                           |
| -------------- | ---------------------------------------------- |
| 小型 GPU 上发生 OOM | 使用 `model.half()` 适用于 FP16（显存减半至约 1.5 GB）      |
| 首次推理较慢         | 正常——模型首次运行时会编译 CUDA 内核（约30秒）                   |
| 语言 X 的质量较差     | 确保正确的 `语言` 参数；某些语言需要更长的参考音频                    |
| 音频伪影           | 增大 `reference_audio` 长度增加到 5–10 秒，以获得更好的声音克隆效果 |
| 模型下载失败         | 设置 `HF_TOKEN` 用于受限模型访问的环境变量                    |

## 成本分析：Clore.ai 上的 Voxtral 与云端 TTS

| 服务                      | 每月 100 万字符  | 备注                            |
| ----------------------- | ----------- | ----------------------------- |
| ElevenLabs Pro          | $99/月       | 包含 50 万字符，超额收费                |
| OpenAI TTS              | $15/月       | 每 100 万字符 $15                 |
| Google Cloud TTS        | $16/月       | 标准语音                          |
| **Clore.ai 上的 Voxtral** | **$3–15/月** | RTX 3060，每小时 $0.03–0.07，无字符限制 |

> **结论：** 在 Clore.ai 上自托管 Voxtral，比云端 TTS API 便宜 6–30 倍，而且没有字符限制，数据隐私也完全保留。

## 延伸阅读

* [HuggingFace 上的 Voxtral TTS](https://huggingface.co/mistralai/Voxtral-TTS)
* [Mistral AI 博客——Voxtral 发布公告](https://mistral.ai/news/voxtral-tts)
* [在 Clore.ai 上比较 TTS 模型](/guides/guides_v2-zh/dui-bi/tts-comparison.md)
* [其他音频与语音指南](/guides/guides_v2-zh/yin-pin-yu-yu-yin/audio-voice.md)

***

*最后更新：2026年3月30日*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-zh/yin-pin-yu-yu-yin/voxtral-tts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
