Skip to main content

moss-tts-local-mnn-cli

MOSS-TTS-Local-Transformer-v1.5 voice cloning via MNN (Mobile Neural Network). Converted from the original PyTorch model (4.13B params, Qwen3 global + GPT2 local transformer).

MNN provides optimized CPU inference on ARM (Apple Silicon, Android) with fp16/int8 quantization support.

Quick Start

uvx moss-tts-local-mnn-cli --text "你好,这是一段测试语音合成。" --reference ref.wav --output output.wav

Installation

uv pip install moss-tts-local-mnn-cli

# For ModelScope download support (China mainland):
pip install "moss-tts-local-mnn-cli[modelscope]"

CLI Usage

# Voice cloning with fp16 (default)
moss-tts-local-mnn-cli --text "你好" --reference speaker.wav --output output.wav

# Use int8 quantization (smaller, faster)
moss-tts-local-mnn-cli --text "你好" --reference speaker.wav --quantization int8 --output output.wav

# Download from ModelScope (China)
moss-tts-local-mnn-cli --text "你好" --reference speaker.wav --source modelscope --output output.wav

Python API

from moss_tts_local_mnn_cli import MossTTS

# Initialize once
tts = MossTTS(quantization="fp16")

# Generate multiple times without reloading
audio = tts.generate("你好,这是第一段。", reference="ref.wav", language="Chinese")
tts.save(audio, "output1.wav")

audio2 = tts.generate("这是第二段。", reference="ref.wav")
tts.save(audio2, "output2.wav")

Audio Codec

The audio codec (MOSS-Audio-Tokenizer-v2) is required for decoding. Download it:

pip install modelscope
python -c "from modelscope import snapshot_download; snapshot_download('OpenMOSS/MOSS-Audio-Tokenizer-v2')"

Model Conversion

Convert ONNX models to MNN:

# Prerequisites: build MNNConvert from https://github.com/alibaba/MNN

# fp16
MNNConvert -f ONNX --modelFile global_prefill.onnx --MNNModel global_prefill_fp16.mnn --fp16 --saveExternalData
MNNConvert -f ONNX --modelFile global_decode.onnx --MNNModel global_decode_fp16.mnn --fp16 --saveExternalData
MNNConvert -f ONNX --modelFile local_transformer_first.onnx --MNNModel local_transformer_first_fp16.mnn --fp16
MNNConvert -f ONNX --modelFile local_transformer.onnx --MNNModel local_transformer_fp16.mnn --fp16

# int8
MNNConvert -f ONNX --modelFile global_prefill.onnx --MNNModel global_prefill_int8.mnn --weightQuantBits 8 --saveExternalData
MNNConvert -f ONNX --modelFile global_decode.onnx --MNNModel global_decode_int8.mnn --weightQuantBits 8 --saveExternalData
MNNConvert -f ONNX --modelFile local_transformer_first.onnx --MNNModel local_transformer_first_int8.mnn --weightQuantBits 8
MNNConvert -f ONNX --modelFile local_transformer.onnx --MNNModel local_transformer_int8.mnn --weightQuantBits 8

Benchmark (Apple M3 Max, 36GB)

Engine ms/step vs PyTorch
PyTorch fp32 338 1.00x
ONNX fp32 374 0.90x
MNN fp16 274 1.24x
MNN int8 277 1.22x

Requirements

  • Python >= 3.10
  • ~20GB RAM (fp16) or ~16GB RAM (int8)
  • ~14GB disk (fp16) or ~11GB disk (int8)

License

MIT

Metadata

Release files for moss-tts-local-mnn-cli 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moss-tts-local-mnn-cli 0.1.1
File Size Uploaded Provenance
moss_tts_local_mnn_cli-0.1.1.tar.gz 7.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for moss-tts-local-mnn-cli 0.1.1
File Interpreter ABI Platform
moss_tts_local_mnn_cli-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / moss_tts_local_mnn_cli-0.1.1.tar.gz

Download URL moss_tts_local_mnn_cli-0.1.1.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
10743214ae27472e476574c0002b7cc7baad2e4be1734a0ad6be5c660cdeaeb9
BLAKE2b-256 checksum
How to use checksums
4cbb881715b041e10b627f9625f439086536bf9637eff55861c5c9915c3bf32c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / moss_tts_local_mnn_cli-0.1.1-py3-none-any.whl

Download URL moss_tts_local_mnn_cli-0.1.1-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75cc7052f83c23c69d0e789f71ac5fb020ae401914f643105845790ef6e4f0b9
BLAKE2b-256 checksum
How to use checksums
8c5be6b65957218fe7197293941b34bf8282a9514699a753e5b62b2812f25288
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for moss-tts-local-mnn-cli 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page