AI Skill Hub 强烈推荐:MOSS-TTS — AI 语音合成工具中文文档 是一款优质的AI工具。已获得 1.9k 颗 GitHub Star,AI 综合评分 8.6 分,在同类工具中表现稳健。如果你正在寻找可靠的AI工具解决方案,这是一个值得深入了解的选择。
MOSS-TTS — AI 语音合成工具中文文档 是一款基于 Python 开发的开源工具,专注于 audio、audio-tokenizer、llm 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
MOSS-TTS — AI 语音合成工具中文文档 是一款基于 Python 开发的开源工具,专注于 audio、audio-tokenizer、llm 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:pip 安装(推荐)
pip install moss-tts
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install moss-tts
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/OpenMOSS/MOSS-TTS
cd MOSS-TTS
pip install -e .
# 验证安装
python -c "import moss_tts; print('安装成功')"
# 命令行使用
moss-tts --help
# 基本用法
moss-tts input_file -o output_file
# Python 代码中调用
import moss_tts
# 示例
result = moss_tts.process("input")
print(result)
# moss-tts 配置文件示例(config.yml) app: name: "moss-tts" debug: false log_level: "INFO" # 运行时指定配置文件 moss-tts --config config.yml # 或通过环境变量配置 export MOSS_TTS_API_KEY="your-key" export MOSS_TTS_OUTPUT_DIR="./output"
<br>
<p align="center"> <img src="./assets/OpenMOSS_Logo.png" height="70" align="middle" /> <img src="./assets/mosi-logo.png" height="50" align="middle" /> </p>
<a href="https://studio.mosi.cn"><img src="https://img.shields.io/badge/AIStudio-Try-green?logo=internet-explorer&"></a> <a href="https://studio.mosi.cn/docs/moss-tts"><img src="https://img.shields.io/badge/API-Docs-00A3FF?logo=fastapi&"></a> <a href="https://x.com/Open_MOSS"><img src="https://img.shields.io/badge/Twitter-Follow-black?logo=x&"></a> <a href="https://discord.gg/Xf3aXddCjc"><img src="https://img.shields.io/badge/Discord-Join-5865F2?logo=discord&"></a> <a href="./assets/wechat.jpg"><img src="https://img.shields.io/badge/WeChat-Join-07C160?logo=wechat&logoColor=white" alt="WeChat"></a> </div>
MOSS‑TTS Family is an open‑source speech and sound generation model family from MOSI.AI and the OpenMOSS team. It is designed for high‑fidelity, high‑expressiveness, and complex real‑world scenarios, covering stable long‑form speech, multi‑speaker dialogue, voice/character design, environmental sound effects, and real‑time streaming TTS.
<p align="center"> <img src="./assets/moss_tts_family.jpeg" width="85%" /> </p>
When a single piece of audio needs to sound like a real person, pronounce every word accurately, switch speaking styles across content, remain stable over tens of minutes, and support dialogue, role‑play, and real‑time interaction, a single TTS model is often not enough. The MOSS‑TTS Family breaks the workflow into five production‑ready models that can be used independently or composed into a complete pipeline.
MOSS-TTS-Nano is our lightweight TTS model designed for CPU-first realtime deployment. It focuses on the part of speech generation that matters most in practical products: a small footprint, low-latency streaming generation, and voice-cloning quality that is strong enough for local demos, web services, and lightweight production integration. Built on a pure autoregressive Audio Tokenizer + LLM pipeline, it keeps the deployment stack simple while making realtime speech generation accessible even without a GPU.
Its main features include:
To learn more about setup, advanced usage, and evaluation metrics, please visit the MOSS-TTS-Nano repository.
<p align="center">Architecture of MOSS-TTS-Nano</p>
<a id="moss-tts-nano-model-weights"></a>
MOSS-Audio-Tokenizer serves as the unified discrete audio interface for the entire MOSS-TTS Family. It is based on the Cat (Causal Audio Tokenizer with Transformer) architecture—a 1.6-billion-parameter, "CNN-free" homogeneous audio tokenizer built entirely from Causal Transformer blocks.
To learn more about setup, advanced usage, and evaluation metrics, please visit the MOSS-Audio-Tokenizer Repository
<p align="center"> <img src="./assets/arch_moss_audio_tokenizer.png" alt="MOSS Audio Tokenizer architecture" width="100%" /> Architecture of MOSS Audio Tokenizer </p>
cd moss_tts_delay/llama_cpp && bash build_bridge.sh /path/to/llama.cpp && cd ../..
We recommend a clean, isolated Python environment with Transformers 5.0.0 to avoid dependency conflicts.
conda create -n moss-tts python=3.12 -y
conda activate moss-tts
Install all required dependencies:
git clone https://github.com/OpenMOSS/MOSS-TTS.git
cd MOSS-TTS
pip install --extra-index-url https://download.pytorch.org/whl/cu128 -e ".[torch-runtime]"
uv```bash
git clone https://github.com/OpenMOSS/MOSS-TTS.git cd MOSS-TTS uv venv --python 3.12 .venv source .venv/bin/activate uv pip install --torch-backend cu128 -e ".[torch-runtime]"
#### (Optional) Install FlashAttention 2
For better speed and lower GPU memory usage, you can install FlashAttention 2 if your hardware supports it.
If you use Conda/pip:
bash pip install --extra-index-url https://download.pytorch.org/whl/cu128 -e ".[torch-runtime,flash-attn]"
If your machine has limited RAM and many CPU cores, you can cap build parallelism:
bash MAX_JOBS=4 pip install --extra-index-url https://download.pytorch.org/whl/cu128 -e ".[torch-runtime,flash-attn]"
If you use `uv`:
bash uv pip install --torch-backend cu128 -e ".[torch-runtime,flash-attn]"
If your machine has limited RAM and many CPU cores, you can cap build parallelism:
bash MAX_JOBS=4 uv pip install --torch-backend cu128 -e ".[torch-runtime,flash-attn]" ```
Notes: - Dependencies are managed in pyproject.toml, which currently pins torch==2.9.1+cu128 and torchaudio==2.9.1+cu128. - In uv, --torch-backend cu128 lets uv fetch compatible PyTorch CUDA wheels and resolve the rest from PyPI with the default safe index strategy. - If you need another backend, replace cu128 with your target (for example, cpu, cu126). - If FlashAttention 2 fails to build on your machine, you can skip it and use the default attention backend. - FlashAttention 2 is only available on supported GPUs and is typically used with torch.float16 or torch.bfloat16.
<a id="moss-tts-basic-usage"></a>
pip install -e ".[llama-cpp-onnx]"
| Profile | Install Command | Dependencies | Use Case |
|---|---|---|---|
| **Torch-free (ONNX)** | pip install -e ".[llama-cpp-onnx]" | numpy, onnxruntime-gpu, tokenizers | Recommended starting point |
| **Torch-free (TRT)** | pip install -e ".[llama-cpp-trt]" | numpy, tensorrt, cuda-python | Maximum audio tokenizer speed (build engines yourself) |
| **Torch-accelerated** | pip install -e ".[llama-cpp-onnx,llama-cpp-torch]" | + torch | GPU-accelerated LM heads (~30x faster) |
Want to convert weights yourself? See the conversion guide for step-by-step instructions on extracting, converting, and quantizing MOSS-TTS weights with llama.cpp.
pip install -e ./sglang/python[all]
If you prefer Gradio demos, we provide 4 scripts for the main models:
| Model | Script | Run |
|---|---|---|
| MOSS-TTS | [clis/moss_tts_app.py](clis/moss_tts_app.py) |
For the MOSS-TTS-Realtime Gradio demo, please refer to MOSS-TTS-Realtime Model Card
```python from pathlib import Path import importlib.util import torch import torchaudio from transformers import AutoModel, AutoProcessor
```bash
```bash
python -m moss_tts_delay.llama_cpp \ --config configs/llama_cpp/trt-8gb.yaml \ --text "Hello, world!" --output output.wav ```
Four pre-built configs are provided in configs/llama_cpp/:
default.yaml — ONNX audio + GGUF backbone (recommended start)trt.yaml — TensorRT audio + GGUF backbone (max throughput, user-built engines)trt-8gb.yaml — Low-memory mode for 8 GB GPUs (staged loading, TRT audio)cpu-only.yaml — fully CPU-based (no GPU required)Key config options: - heads_backend: auto | numpy | torch — LM heads computation backend - audio_backend: onnx | trt | torch — audio tokenizer backend - low_memory: true | false — staged loading for limited VRAM (loads/unloads encoder, backbone, decoder per stage) - kv_cache_type_k / kv_cache_type_v — KV cache quantization (e.g. q8_0, q4_0) to reduce VRAM - flash_attn: auto | enabled | disabled — flash attention for lower peak VRAM during prefill
For full documentation, see moss_tts_delay/llama_cpp/README.md.
We add MOSS-TTS skills in ClawHub of 🦞 OpenClaw. You can get your API key from MOSI AI Studio.
| Skill | Description | Install |
|---|---|---|
[feishu-voice-tts](https://clawhub.ai/helloeveryworlds/feishu-voice-tts) | Send voice messages in Feishu | clawhub install feishu-voice-tts |
[moss-tts-voice](https://clawhub.ai/luogao2333/moss-tts-voice) | Call MOSS-TTS API to generate speech | clawhub install moss-tts-voice |
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
总体来看,MOSS-TTS — AI 语音合成工具中文文档 是一款质量优秀的AI工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | MOSS-TTS |
| 原始描述 | MOSS‑TTS Family is an open‑source speech and sound generation model family from MOSI.AI and the OpenMOSS team. It is designed for high‑fidelity, high‑expressiveness, and complex real‑world scenarios, covering stable long‑form speech, multi‑speaker dialogue, voice/character design, environmental soun… |
| Topics | audioaudio-tokenizerllmmultimodaltext-to-speechvoice-cloningtts |
| GitHub | https://github.com/OpenMOSS/MOSS-TTS |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-05-22 · 更新时间:2026-05-22 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。