MOSS-TTS-Nano

OpenMOSSApache-2.0活跃维护

100M 参数的多语言语音合成模型,能在 CPU 上实时推理,支持音色克隆和 48kHz 立体声输出,适合本地部署轻量 TTS。

A 100M-parameter multilingual TTS model for real-time CPU inference, voice cloning, and 48 kHz stereo generation

暂无版本4,655star +13 / 7 天580fork同步于 2026-11-10 11:37 UTC

怎么上手

由 README 提炼,执行前请确认
conda create -n moss-tts-nano python=3.12 -y
conda activate moss-tts-nano
git clone https://github.com/OpenMOSS/MOSS-TTS-Nano.git
cd MOSS-TTS-Nano
pip install -r requirements.txt
pip install -e .
硬件要求按 README 说明

README 明确说明无需 GPU,纯 CPU 即可运行;ONNX 版在 MacBook Air M4 上单核即可流畅推理。若使用 NVIDIA GPU,可安装 onnxruntime-gpu 并通过 --execution-provider cuda 启用 CUDA。README 未给出显存要求。

纯 CPU 可运行支持 Apple Silicon需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

0.1B 参数多语言 TTS 模型,纯 CPU 实时推理,支持音色克隆与 48kHz 立体声生成

100M 参数的多语言语音合成模型,能在 CPU 上实时推理,支持音色克隆和 48kHz 立体声输出,适合本地部署轻量 TTS。

核心能力

  • 仅 0.1B 参数,无需 GPU 即可在 CPU 上实时生成语音
  • 支持音色克隆,直接输入参考音频即可复刻音色
  • 提供 ONNX CPU 版本,推理时不再依赖 PyTorch
  • ONNX 版支持实时流式解码(Realtime Streaming Decode)
  • 附带 FastAPI 本地 Web Demo 与命令行工具

容易踩的坑

WeTextProcessing 或 pynini 可能装不上,需先装匹配版本的 pynini 再装 WeTextProcessing;首次运行会自动从 Hugging Face 下载模型权重到 models/ 目录,需保证网络可达;Web Demo 默认监听 127.0.0.1:18083,端口被占用需自行处理。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    MOSS-TTS-Nano

    English | 简体中文

    MOSS-TTS-Nano is an open-source multilingual tiny speech generation model from MOSI.AI and the OpenMOSS team. With only 0.1B parameters, it is designed for realtime speech generation, can run directly on CPU without a GPU, and keeps the deployment stack simple enough for local demos, web serving, and lightweight product integration.

    Start here: Try the demo · Run locally · ONNX CPU inference · Model weights · Fine-tuning

    demo_video.mp4

    News

    • 2026.4.17: We are excited to release a more efficient and fully standalone ONNX CPU Version, backed by the Hugging Face repositories MOSS-TTS-Nano-100M-ONNX and MOSS-Audio-Tokenizer-Nano-ONNX. It preserves the full voice cloning workflow while removing the PyTorch dependency during inference. In our tests, it delivers nearly 2x the processing efficiency of the original version, and runs smoothly on a single CPU core on a MacBook Air M4. Built on top of this ONNX CPU version, we have also updated MOSS-TTS-Nano-Reader, which can now run the model directly inside the browser as an extension, without requiring a separate local inference service.
    • 2026.4.16: We release the MOSS-TTS-Nano finetuning code. See ./finetuning/README.md for training and usage details.
    • 2026.4.14: We release MOSS-TTS-Nano-Reader, a local browser reading application built on top of MOSS-TTS-Nano.
    • 2026.4.10: We release MOSS-TTS-Nano. A demo Space is available at OpenMOSS-Team/MOSS-TTS-Nano. You can also view the demo and more details at openmoss.github.io/MOSS-TTS-Nano-Demo/.

    Demo

    Contents

    Introduction

    MOSS-TTS-Nano focuses on the part of TTS deployment that matters most in practice: small footprint, low latency, good enough quality for realtime products, and simple local setup. It uses a pure autoregressive Audio Tokenizer + LLM pipeline and keeps the inference workflow friendly for both terminal users and web-demo users.

    Main Features

    • Tiny model size: only 0.1B parameters
    • Native audio format: 48 kHz, 2-channel output
    • Multilingual: supports Chinese, English, and more
    • Pure autoregressive architecture: built on Audio Tokenizer + LLM
    • Streaming inference: low realtime latency and fast first audio
    • CPU friendly: streaming generation can run on a 4-core CPU
    • Long-text capable: supports long input with automatic chunked voice cloning
    • Open-source deployment: direct python infer.py, python app.py, and packaged CLI support

    Supported Languages

    MOSS-TTS-Nano currently supports 20 languages:

    LanguageCodeFlagLanguageCodeFlagLanguageCodeFlag
    Chinesezh🇨🇳Englishen🇺🇸Germande🇩🇪
    Spanishes🇪🇸Frenchfr🇫🇷Japaneseja🇯🇵
    Italianit🇮🇹Hungarianhu🇭🇺Koreanko🇰🇷
    Russianru🇷🇺Persian (Farsi)fa🇮🇷Arabicar🇸🇦
    Polishpl🇵🇱Portuguesept🇵🇹Czechcs🇨🇿
    Danishda🇩🇰Swedishsv🇸🇪Greekel🇬🇷
    Turkishtr🇹🇷

    Quickstart

    Environment Setup

    We recommend a clean Python environment first, then installing the project in editable mode so the moss-tts-nano command becomes available locally. The examples below intentionally keep arguments minimal and rely on the repository defaults. By default, the code loads OpenMOSS-Team/MOSS-TTS-Nano and OpenMOSS-Team/MOSS-Audio-Tokenizer-Nano.

    Using Conda
    conda create -n moss-tts-nano python=3.12 -y
    conda activate moss-tts-nano
    
    git clone https://github.com/OpenMOSS/MOSS-TTS-Nano.git
    cd MOSS-TTS-Nano
    
    pip install -r requirements.txt
    pip install -e .
    

    If WeTextProcessing or pynini fails to install from requirements.txt, install pynini first in the same environment, then install WeTextProcessing, remove WeTextProcessing from requirements.txt, and finally rerun pip install -r requirements.txt.

    With Conda, we recommend:

    conda install -c conda-forge pynini=2.1.6.post1 -y
    pip install git+https://github.com/WhizZest/WeTextProcessing.git
    pip install -r requirements.txt
    

    If you are not using Conda, make sure you download a pynini wheel that matches your Python version and platform before installing WeTextProcessing. For a community-tested example, see Issue #6.

    Voice Clone with infer.py

    This repository keeps the direct Python entrypoint for local inference. The example below uses voice clone mode, which is the main recommended workflow for MOSS-TTS-Nano.

    python infer.py \
      --prompt-audio-path assets/audio/zh_1.wav \
      --text "欢迎关注模思智能、上海创智学院与复旦大学自然语言处理实验室。"
    

    This writes audio to generated_audio/infer_output.wav by default.

    Local Web Demo with app.py

    You can launch the local FastAPI demo for browser-based testing:

    python app.py
    

    Then open http://127.0.0.1:18083 in your browser.

    ONNX CPU Inference

    We now strongly recommend trying the ONNX CPU version first for lightweight local deployment and CPU inference.

    This version is designed to be more deployment-friendly while keeping the same core MOSS-TTS-Nano experience:

    • No PyTorch dependency during inference: it runs directly on ONNX Runtime CPU.
    • Fully standalone CPU deployment: suitable for local demos, services, and lightweight integration.
    • Feature-complete voice cloning workflow: supports direct reference audio input, built-in voices, and Realtime Streaming Decode.
    • Faster in practice: in our tests, processing efficiency is nearly 2x that of the original version.
    • Strong single-core usability: on a MacBook Air M4, we observed smooth inference with only 1 CPU core.

    The ONNX entrypoints are infer_onnx.py, app_onnx.py, and the packaged CLI with --backend onnx.

    By default, all ONNX commands use --execution-provider cpu, so existing commands keep the same CPU behavior. If you have an NVIDIA GPU and a compatible onnxruntime-gpu installation, you can opt in to CUDA with --execution-provider cuda.

    To prepare a CUDA ONNX Runtime environment, replace the CPU ONNX Runtime wheel with the GPU wheel:

    pip uninstall -y onnxruntime
    pip install "onnxruntime-gpu>=1.20.0"
    

    If --model-dir is omitted, the script automatically checks ./models. When the model files are missing, it downloads them on first run from:

    Downloaded files are stored under:

    • models/MOSS-TTS-Nano-100M-ONNX
    • models/MOSS-Audio-Tokenizer-Nano-ONNX

    Example:

    python infer_onnx.py \
      --prompt-audio-path assets/audio/zh_1.wav \
      --text "Welcome to the ONNX Runtime CPU demo."
    

    Optional CUDA execution:

    python infer_onnx.py \
      --execution-provider cuda \
      --prompt-audio-path assets/audio/zh_1.wav \
      --text "Welcome to the ONNX Runtime CUDA demo."
    

    CUDA execution requires onnxruntime-gpu.

    If you already have the ONNX assets in another directory, pass it explicitly:

    python infer_onnx.py \
      --model-dir /path/to/models \
      --prompt-audio-path assets/audio/zh_1.wav \
      --text "Welcome to the ONNX Runtime CPU demo."
    

    ONNX Local Web Demo with app_onnx.py

    You can also launch the ONNX-backed local web demo:

    python app_onnx.py
    

    To run the ONNX web demo with CUDA, start it with:

    python app_onnx.py \
      --execution-provider cuda
    

    Then open http://127.0.0.1:18083 in your browser.

    The first startup may spend extra time downloading assets if models/ does not contain the ONNX weights yet.

    Android ONNX Runtime Example

    An Android ONNX Runtime smoke example is available under examples/android_onnx_runtime.

    The example loads the exported MOSS-TTS-Nano ONNX graphs and the MOSS-Audio-Tokenizer-Nano ONNX decoder on device, synthesizes short pre-tokenized demo prompts, and writes a WAV file from Android. It is intentionally minimal and keeps model files outside the APK for local testing.

    Export TTS-only ONNX Weights

    If you retrain MOSS-TTS-Nano, you need to re-export the TTS-side ONNX weights. The exporter under onnx/ takes a local Hugging Face-format MOSS-TTS-Nano checkpoint and outputs a TTS-only ONNX model directory.

    Example:

    python onnx/export_hf_to_tts_onnx.py \
      --checkpoint-path /path/to/MOSS-TTS-Nano \
      --output-dir /path/to/MOSS-TTS-Nano-100M-ONNX
    

    The output directory contains:

    • moss_tts_prefill.onnx
    • moss_tts_decode_step.onnx
    • moss_tts_local_decoder.onnx
    • moss_tts_local_cached_step.onnx
    • moss_tts_local_fixed_sampled_frame.onnx
    • moss_tts_global_shared.data
    • moss_tts_local_shared.data
    • tts_browser_onnx_meta.json
    • tokenizer.model

    This is intended for the ONNX deployment path only. Existing prompt audio codes produced by MOSS-Audio-Tokenizer-Nano do not need to be regenerated when the audio tokenizer stays fixed.

    CLI Command: moss-tts-nano generate

    After pip install -e ., you can call the packaged CLI directly:

    moss-tts-nano generate \
      --prompt-speech assets/audio/zh_1.wav \
      --text "欢迎关注模思智能、上海创智学院与复旦大学自然语言处理实验室。"
    

    For the ONNX CPU backend, add --backend onnx:

    moss-tts-nano generate \
      --backend onnx \
      --prompt-speech assets/audio/zh_1.wav \
      --text "欢迎关注模思智能、上海创智学院与复旦大学自然语言处理实验室。"
    

    To opt in to CUDA:

    moss-tts-nano generate \
      --backend onnx \
      --execution-provider cuda \
      --prompt-speech assets/audio/zh_1.wav \
      --text "欢迎关注模思智能、上海创智学院与复旦大学自然语言处理实验室。"
    

    Useful notes:

    • moss-tts-nano generate writes to generated_audio/moss_tts_nano_output.wav by default.
    • --prompt-speech is the friendly alias for the reference audio path used by voice cloning.
    • --text-file is supported for long-form synthesis.
    • ONNX CUDA execution requires onnxruntime-gpu; without --execution-provider cuda, ONNX inference remains CPU-only.

    CLI Command: moss-tts-nano serve

    You can also launch the web demo through the packaged CLI:

    moss-tts-nano serve
    

    For the ONNX web demo:

    moss-tts-nano serve \
      --backend onnx
    

    For the ONNX web demo with CUDA:

    moss-tts-nano serve \
      --backend onnx \
      --execution-provider cuda
    

    This command forwards to the corresponding web app, keeps the model loaded in memory, and serves the local browser demo plus HTTP generation endpoints.

    For server deployment with paged KV cache, streaming, and an OpenAI-compatible /v1/audio/speech endpoint, please read the vLLM-Omni MOSS-TTS-Nano README.

    Finetuning

    Finetuning tutorials are already provided.

    See ./finetuning/README.md for details.

    MOSS-Audio-Tokenizer-Nano

    Introduction

    MOSS-Audio-Tokenizer is the unified discrete audio interface for the entire MOSS-TTS family. It is built on the Cat (Causal Audio Tokenizer with Transformer) architecture, a CNN-free audio tokenizer composed entirely of causal Transformer blocks. It serves as the shared audio backbone for MOSS-TTS, MOSS-TTS-Nano, MOSS-TTSD, MOSS-VoiceGenerator, MOSS-SoundEffect, and MOSS-TTS-Realtime, providing a consistent audio representation across the full product family.

    To further improve perceptual quality while reducing inference cost, we trained MOSS-Audio-Tokenizer-Nano, a lightweight tokenizer with approximately 20 million parameters designed for high-fidelity audio compression. It supports 48 kHz input and output as well as stereo audio, which helps reduce compression loss and improve listening quality. It can compress 48 kHz stereo audio into a 12.5 Hz token stream and uses RVQ with 16 codebooks, enabling high-fidelity reconstruction across variable bitrates from 0.125 kbps to 2 kbps.

    To learn more about setup, advanced usage, and evaluation metrics, please visit the MOSS-Audio-Tokenizer Repository.

    Model Weights

    ModelHugging FaceModelScope
    MOSS-Audio-Tokenizer-NanoHugging FaceModelScope

    Evaluation Metrics

    The table below compares the reconstruction quality of MOSS-Audio-Tokenizer-Nano with open-source audio tokenizers with no more than 120M parameters on speech, audio, and music data. As shown in the table and figure, MOSS-Audio-Tokenizer-Nano achieves the best overall reconstruction quality while remaining one of the smallest models in the comparison.

    • Speech metrics are evaluated on LibriSpeech test-clean (English) and AISHELL-2 (Chinese), reported as EN/ZH.
    • Audio metrics are evaluated on the AudioSet evaluation subset, while music metrics are evaluated on MUSDB, reported as audio/music.
    • STFT-Dist. denotes the STFT distance.
    • Higher is better for speech metrics, while lower is better for audio/music metrics (Mel-Loss, STFT-Dist.).
    • Ch. denotes the number of input/output channels supported by the audio tokenizer: ch=1 means mono audio, and ch=2 means stereo audio.
    • Nvq denotes the number of quantizers.

    LibriSpeech Speech Metrics (MOSS-Audio-Tokenizer-Nano vs. Open-source Tokenizers)

    The plots below compare MOSS-Audio-Tokenizer-Nano with other open-source audio tokenizers and codecs with no more than 120M parameters on the LibriSpeech dataset. The models are evaluated with SIM, STOI, PESQ-NB, and PESQ-WB, where higher values indicate better reconstruction quality. For the same model, we control the bitrate by adjusting the number of RVQ codebooks used during inference.

    MOSS-TTS Family

    Introduction

    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.

    The family currently includes:

    • MOSS-TTS: the flagship model for high-fidelity zero-shot voice cloning, long-speech generation, fine-grained control over Pinyin, phonemes, and duration, and multilingual/code-switched synthesis.
    • MOSS-TTS-Local-Transformer: a smaller model in the family based on MossTTSLocal, designed to keep the MOSS-TTS style of speech generation in a lighter model size.
    • MOSS-TTSD-v1.0: a spoken dialogue generation model for expressive, multi-speaker, and ultra-long dialogue audio.
    • MOSS-VoiceGenerator: a voice design model that can generate diverse voices and speaking styles directly from text prompts, without reference speech.
    • MOSS-SoundEffect: a controllable sound generation model for natural ambience, city scenes, animals, human actions, and short music-like audio fragments.
    • MOSS-TTS-Realtime: a realtime speech model for low-latency voice agents, designed to keep replies natural, coherent, and voice-consistent across turns.

    Released Models

    ModelArchitectureSizeHugging FaceModelScope
    MOSS-TTSMossTTSDelay8BHugging FaceModelScope
    MOSS-TTS-Local-TransformerMossTTSLocal1.7BHugging FaceModelScope
    MOSS-TTSD-v1.0MossTTSDelay8BHugging FaceModelScope
    MOSS-VoiceGeneratorMossTTSDelay1.7BHugging FaceModelScope
    MOSS-SoundEffectMossTTSDelay8BHugging FaceModelScope
    MOSS-TTS-RealtimeMossTTSRealtime1.7BHugging FaceModelScope

    License

    This repository will follow the license specified in the root LICENSE file. If you are reading this before that file is published, please treat the repository as not yet licensed for redistribution.

    Citation

    If you use the MOSS-TTS work in your research or product, please cite:

    @misc{openmoss2026mossttsnano,
      title={MOSS-TTS-Nano},
      author={OpenMOSS Team},
      year={2026},
      howpublished={GitHub repository},
      url={https://github.com/OpenMOSS/MOSS-TTS-Nano}
    }
    
    @misc{gong2026mossttstechnicalreport,
      title={MOSS-TTS Technical Report},
      author={Yitian Gong and Botian Jiang and Yiwei Zhao and Yucheng Yuan and Kuangwei Chen and Yaozhou Jiang and Cheng Chang and Dong Hong and Mingshu Chen and Ruixiao Li and Yiyang Zhang and Yang Gao and Hanfu Chen and Ke Chen and Songlin Wang and Xiaogui Yang and Yuqian Zhang and Kexin Huang and ZhengYuan Lin and Kang Yu and Ziqi Chen and Jin Wang and Zhaoye Fei and Qinyuan Cheng and Shimin Li and Xipeng Qiu},
      year={2026},
      eprint={2603.18090},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2603.18090}
    }
    
    @misc{gong2026mossaudiotokenizerscalingaudiotokenizers,
      title={MOSS-Audio-Tokenizer: Scaling Audio Tokenizers for Future Audio Foundation Models}, 
      author={Yitian Gong and Kuangwei Chen and Zhaoye Fei and Xiaogui Yang and Ke Chen and Yang Wang and Kexin Huang and Mingshu Chen and Ruixiao Li and Qingyuan Cheng and Shimin Li and Xipeng Qiu},
      year={2026},
      eprint={2602.10934},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2602.10934}, 
    }
    

    Star History