Metadata-Version: 2.3
Name: mlx-speech
Version: 0.4.2
Summary: MLX-native speech library for Apple Silicon.
Author: appautomaton
License: MIT License
         
         Copyright (c) 2026 AppAutomaton swarm of agents
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Requires-Dist: mlx>=0.31.1
Requires-Dist: numpy
Requires-Dist: safetensors
Requires-Dist: soundfile>=0.13.1
Requires-Dist: tokenizers>=0.22.2
Requires-Dist: huggingface-hub>=1.8,<2
Requires-Python: >=3.13
Project-URL: Repository, https://github.com/appautomaton/mlx-speech
Description-Content-Type: text/markdown

# mlx-speech

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/appautomaton/mlx-speech/blob/main/LICENSE)
[![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
[![Platform](https://img.shields.io/badge/platform-Apple%20Silicon-black?logo=apple)](https://developer.apple.com/documentation/apple-silicon)

> [!NOTE]
> This project wouldn't exist without the inspiration and generous support of the incredible community at [linux.do](https://linux.do).

Local speech synthesis, editing, and transcription on Apple Silicon, running
pure MLX. No cloud, no PyTorch.

mlx-speech is an [App Automaton](https://appautomaton.github.io) project. The
`appautomaton` org hosts the [code on GitHub](https://github.com/appautomaton/mlx-speech)
and the converted [weights on Hugging Face](https://huggingface.co/appautomaton).

## Models

Pre-converted MLX weights are published under the App Automaton Hugging Face
org, [appautomaton](https://huggingface.co/appautomaton), and download
automatically on first use. Load by alias or by full repo id — `tts.load("fish-s2-pro")` and
`tts.load("appautomaton/fishaudio-s2-pro-8bit-mlx")` are equivalent. Each
model name links to a guide covering behavior, flags, and known limitations.

**Text-to-speech**

| Alias | Model | Weights |
| --- | --- | --- |
| `fish-s2-pro` | [Fish S2 Pro](https://github.com/appautomaton/mlx-speech/blob/main/docs/fish-s2-pro.md) — dual-AR TTS, voice cloning, emotion tags | [int8](https://huggingface.co/appautomaton/fishaudio-s2-pro-8bit-mlx) |
| `vibevoice` | [VibeVoice Large](https://github.com/appautomaton/mlx-speech/blob/main/docs/vibevoice.md) — hybrid LLM+diffusion TTS, voice cloning | [int8](https://huggingface.co/appautomaton/vibevoice-mlx) |
| `longcat` | [LongCat AudioDiT](https://github.com/appautomaton/mlx-speech/blob/main/docs/longcat-audiodit.md) — flow-matching diffusion TTS | [int8](https://huggingface.co/appautomaton/longcat-audiodit-3.5b-8bit-mlx) |
| `moss-local` | [OpenMOSS TTS Local](https://github.com/appautomaton/mlx-speech/blob/main/docs/moss-local.md) — local-attention multi-VQ TTS | [int8](https://huggingface.co/appautomaton/openmoss-tts-local-mlx) |
| `moss-ttsd` | [MOSS-TTSD](https://github.com/appautomaton/mlx-speech/blob/main/docs/moss-ttsd.md) — delay-pattern dialogue TTS | [int8](https://huggingface.co/appautomaton/openmoss-ttsd-mlx) |
| `moss-sound-effect` | [OpenMOSS Sound Effect](https://github.com/appautomaton/mlx-speech/blob/main/docs/moss-sound-effect.md) — text-to-sound-effect generation | [4-bit](https://huggingface.co/appautomaton/openmoss-sound-effect-mlx) |
| `step-audio` | [Step-Audio-EditX](https://github.com/appautomaton/mlx-speech/blob/main/docs/step-audio-editx.md) — voice cloning, audio editing | [int8](https://huggingface.co/appautomaton/step-audio-editx-8bit-mlx) |
| — | [DramaBox](https://github.com/appautomaton/mlx-speech/blob/main/docs/dramabox.md) — Resemble flow-matching diffusion TTS, 48 kHz stereo | local checkpoint¹ |

**Speech-to-text**

| Alias | Model | Weights |
| --- | --- | --- |
| `cohere-asr` | [Cohere Transcribe](https://github.com/appautomaton/mlx-speech/blob/main/docs/cohere-asr.md) — multilingual ASR | [int8](https://huggingface.co/appautomaton/cohere-asr-mlx) |
| `qwen3-asr-1.7b` | [Qwen3-ASR-1.7B](https://github.com/appautomaton/mlx-speech/blob/main/docs/qwen3-asr.md) — English, Chinese, and mixed Chinese/English ASR | [bf16](https://huggingface.co/appautomaton/qwen3-asr-1.7b-bf16-mlx) |
| — | [IBM Granite Speech 4.0 1B](https://github.com/appautomaton/mlx-speech/blob/main/docs/granite-speech-asr.md) — runs the original sharded checkpoint from a local path | local checkpoint |

¹ DramaBox MLX weights are not published yet — run it from a local checkpoint
via `scripts/generate_dramabox.py` (see [docs/dramabox.md](https://github.com/appautomaton/mlx-speech/blob/main/docs/dramabox.md)).

## Installation

Requires an Apple Silicon Mac (M1 or later) and Python 3.13+.

```bash
pip install mlx-speech
```

## Quick Start

**Python:**

```python
import mlx_speech

# Text-to-speech
model = mlx_speech.tts.load("fish-s2-pro")
result = model.generate("Hello from mlx-speech!")
# result.waveform: mx.array, result.sample_rate: int

# Voice cloning with emotion tags
result = model.generate(
    "[excited] This is amazing!",
    reference_audio="reference.wav",
    reference_text="Transcript of the reference audio.",
)

# Speech-to-text
asr = mlx_speech.asr.load("qwen3-asr-1.7b")
print(asr.generate("audio.wav").text)

# Local checkpoint paths work anywhere an alias does
granite = mlx_speech.asr.load("models/ibm/granite_4_0_1b_speech/original")
print(granite.generate("audio.wav").text)

# Discover models
mlx_speech.tts.list_models()
mlx_speech.asr.list_models()
```

**CLI:**

```bash
# Generate speech
mlx-speech tts --model fish-s2-pro --text "Hello!" -o output.wav

# Voice cloning with emotion tags
mlx-speech tts --model fish-s2-pro \
  --text "[whisper] Just between us..." \
  --reference-audio ref.wav \
  --reference-text "Transcript of reference." \
  -o cloned.wav

# Step Audio emotion editing
mlx-speech tts --model step-audio \
  --reference-audio input.wav \
  --reference-text "Transcript." \
  --edit-type emotion --edit-info happy \
  -o happy.wav

# Sound effect generation
mlx-speech tts --model moss-sound-effect \
  --text "rolling thunder with rainfall" \
  --duration-seconds 8 \
  -o thunder.wav

# Transcribe audio
mlx-speech asr --model cohere-asr --audio speech.wav
mlx-speech asr --model qwen3-asr-1.7b --audio speech.wav --language Chinese

# Local checkpoint paths work anywhere an alias does
mlx-speech tts --model models/fish_s2_pro/mlx-int8 --text "Hello!" -o output.wav
mlx-speech asr --model models/ibm/granite_4_0_1b_speech/original --audio speech.wav

# Discover models
mlx-speech tts --list-models
mlx-speech asr --list-models
mlx-speech --help
```

> **Note:** The `mlx-speech` CLI covers the common path — basic generation,
> voice cloning, and editing. For advanced controls (sampling temperature,
> top-p/k, diffusion steps, batch JSONL, duration tuning, etc.) use the
> scripts in `scripts/` directly. Each model family has a corresponding
> script with the full inference surface documented in `docs/`.

## Conversion

To convert upstream source weights yourself:

```bash
python scripts/convert/fish_s2_pro.py
python scripts/convert/longcat_audiodit.py
python scripts/convert/vibevoice.py
python scripts/convert/moss_local.py
python scripts/convert/moss_ttsd.py
python scripts/convert/moss_sound_effect.py
python scripts/convert/step_audio_editx.py
python scripts/convert/cohere_asr.py
python scripts/convert/qwen3_asr.py
```

## Development

```bash
git clone https://github.com/appautomaton/mlx-speech.git
cd mlx-speech
uv sync
uv run pytest tests/unit/
uv run ruff check .
```

```text
mlx-speech/
  src/mlx_speech/    library code
  scripts/           conversion, generation, eval, and audit entry points
  models/            local checkpoints (not in git)
  tests/             unit, checkpoint, runtime, integration tests
  docs/              model-family behavior guides
```

## License

MIT — see [LICENSE](https://github.com/appautomaton/mlx-speech/blob/main/LICENSE)

Built and maintained by [App Automaton](https://appautomaton.github.io).
