Metadata-Version: 2.3
Name: mlx-speech
Version: 0.6.0
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.32.4
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: Homepage, https://appautomaton.com/mlx-speech/
Project-URL: Repository, https://github.com/appautomaton/mlx-speech
Project-URL: Documentation, https://github.com/appautomaton/mlx-speech/tree/main/docs
Project-URL: Hugging Face, https://huggingface.co/appautomaton
Description-Content-Type: text/markdown

<p align="center">
  <picture>
    <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/appautomaton/mlx-speech/main/docs/assets/hero-light.svg">
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/appautomaton/mlx-speech/main/docs/assets/hero-dark.svg">
    <img alt="mlx-speech — Your voice. Your Mac. Pure-MLX text-to-speech, speech recognition, and forced alignment for Apple Silicon." src="https://raw.githubusercontent.com/appautomaton/mlx-speech/main/docs/assets/hero-light.svg" width="100%">
  </picture>
</p>

<p align="center">
  <a href="https://pypi.org/project/mlx-speech/"><img alt="PyPI" src="https://img.shields.io/pypi/v/mlx-speech?style=flat-square&label=pypi&labelColor=242326&color=b53b1c"></a>
  <a href="https://www.python.org/downloads/"><img alt="Python 3.13+" src="https://img.shields.io/badge/python-3.13%2B-56515a?style=flat-square&labelColor=242326"></a>
  <a href="https://github.com/ml-explore/mlx"><img alt="Apple Silicon MLX" src="https://img.shields.io/badge/apple_silicon-MLX-56515a?style=flat-square&labelColor=242326"></a>
  <a href="https://github.com/appautomaton/mlx-speech/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-56515a?style=flat-square&labelColor=242326"></a>
  <a href="https://github.com/appautomaton/mlx-speech/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/appautomaton/mlx-speech/actions/workflows/ci.yml/badge.svg"></a>
</p>

<p align="center">
  <a href="#quick-start">Quick start</a> · <a href="#models">Models</a> · <a href="#examples">Examples</a> · <a href="https://github.com/appautomaton/mlx-speech/tree/main/docs">Model guides</a> · <a href="https://huggingface.co/appautomaton">Hugging Face weights</a> · <a href="https://appautomaton.com/mlx-speech/">Website</a>
</p>

<p align="center">
  <picture>
    <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/appautomaton/mlx-speech/main/docs/assets/pillars-light.svg">
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/appautomaton/mlx-speech/main/docs/assets/pillars-dark.svg">
    <img alt="Three unified modules: mlx_speech.tts (13 families), mlx_speech.asr (6 families), and mlx_speech.align (1 family)." src="https://raw.githubusercontent.com/appautomaton/mlx-speech/main/docs/assets/pillars-light.svg" width="100%">
  </picture>
</p>

**mlx-speech** runs 20 speech model families natively on Apple Silicon in [MLX](https://github.com/ml-explore/mlx)—covering text-to-speech, voice cloning, multi-speaker dialogue, sound effects, live transcription, and forced alignment with no PyTorch or cloud dependency. Published weights download automatically on first use; local checkpoints load offline.

## Quick start

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

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

```python
import mlx_speech
from mlx_speech.audio import write_wav

# Text-to-speech
tts = mlx_speech.tts.load("fish-s2-pro")
result = tts.generate("Hello from mlx-speech!")
write_wav("output.wav", result.waveform, sample_rate=result.sample_rate)

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

# Forced alignment (character & word timestamps)
aligner = mlx_speech.align.load("models/qwen3_forced_aligner_0_6b/mlx-int8")
for item in aligner.generate("output.wav", "Hello from mlx-speech!", language="en"):
    print(f"{item.start_s:.2f}–{item.end_s:.2f}s  {item.text}")
```

```bash
mlx-speech tts --model fish-s2-pro --text "Hello!" -o output.wav
mlx-speech asr --model qwen3-asr-1.7b --audio output.wav
mlx-speech tts --list-models
```

## Models

Pass any alias, Hugging Face repo ID, or local directory to `tts.load()`, `asr.load()`, `align.load()`, or `--model`. Model names open behavior guides.

### Text-to-speech, voice cloning, and sound effects (13 families)

| Family | Capabilities | Selector | Weights |
| --- | --- | --- | --- |
| [Fish S2 Pro](https://github.com/appautomaton/mlx-speech/blob/main/docs/fish-s2-pro.md) | Voice cloning and inline emotion tags | `fish-s2-pro` | [int8](https://huggingface.co/appautomaton/fishaudio-s2-pro-8bit-mlx) |
| [Fish Audio Drama 3](https://github.com/appautomaton/mlx-speech/blob/main/docs/fish-drama-3.md) | 16-speaker scenes, cloning, batching, and infilling (44.1 kHz) | local snapshot | [FP8→int8 / BF16](https://huggingface.co/fishaudio/drama-3), direct² |
| [Ming-3.0-tts-tiny](https://github.com/appautomaton/mlx-speech/blob/main/docs/ming-3-tts.md) | Multilingual cloning, voice design, tags, and podcast (44.1 kHz) | local snapshot | [BF16](https://huggingface.co/inclusionAI/Ming-3.0-tts-tiny), direct² |
| [Breeze TTS 2](https://github.com/appautomaton/mlx-speech/blob/main/docs/breeze-tts-2.md) | Voice design, instruction direction, cloning, and streaming | local snapshot | [BF16](https://huggingface.co/BreezeBlue/Breeze-TTS-2), direct² |
| [FireRedTTS3 Base](https://github.com/appautomaton/mlx-speech/blob/main/docs/fireredtts3.md) | Multilingual zero-shot voice cloning at 24 kHz | `fireredtts3-base` | [BF16](https://huggingface.co/appautomaton/fireredtts3-mlx/tree/main/base/mlx-bf16) · [direct²](https://huggingface.co/FireRedTeam/FireRedTTS3) |
| [dots.tts](https://github.com/appautomaton/mlx-speech/blob/main/docs/dots-tts.md) | Voice cloning and waveform streaming (SOAR & MeanFlow) | `dots-tts-soar` · `dots-tts-mf` | [int8 + base](https://huggingface.co/appautomaton/dots-tts-mlx) |
| [VibeVoice Large](https://github.com/appautomaton/mlx-speech/blob/main/docs/vibevoice.md) | Hybrid LLM + diffusion synthesis and voice cloning | `vibevoice` | [int8](https://huggingface.co/appautomaton/vibevoice-mlx) |
| [LongCat AudioDiT](https://github.com/appautomaton/mlx-speech/blob/main/docs/longcat-audiodit.md) | Flow-matching diffusion speech synthesis | `longcat` | [int8](https://huggingface.co/appautomaton/longcat-audiodit-3.5b-8bit-mlx) |
| [DramaBox](https://github.com/appautomaton/mlx-speech/blob/main/docs/dramabox.md) | Expressive speech synthesis in 48 kHz stereo | `dramabox` | [BF16](https://huggingface.co/appautomaton/dramabox-tts-3.3b-bf16-mlx)¹ |
| [Step-Audio-EditX](https://github.com/appautomaton/mlx-speech/blob/main/docs/step-audio-editx.md) | Voice cloning and emotion, style, or speed editing | `step-audio` | [int8](https://huggingface.co/appautomaton/step-audio-editx-8bit-mlx) |
| [OpenMOSS TTS Local](https://github.com/appautomaton/mlx-speech/blob/main/docs/moss-local.md) | Local-attention speech synthesis and voice cloning | `moss-local` | [int8](https://huggingface.co/appautomaton/openmoss-tts-local-mlx)¹ |
| [MOSS-TTSD](https://github.com/appautomaton/mlx-speech/blob/main/docs/moss-ttsd.md) | Multi-speaker conversational dialogue | `moss-ttsd` | [int8](https://huggingface.co/appautomaton/openmoss-ttsd-mlx)¹ |
| [OpenMOSS Sound Effect](https://github.com/appautomaton/mlx-speech/blob/main/docs/moss-sound-effect.md) | Sound effects from text prompts | `moss-sound-effect` | [4-bit](https://huggingface.co/appautomaton/openmoss-sound-effect-mlx)¹ |

### Speech-to-text (6 families)

| Family | Capabilities | Selector | Weights |
| --- | --- | --- | --- |
| [Cohere Transcribe](https://github.com/appautomaton/mlx-speech/blob/main/docs/cohere-asr.md) | Multilingual offline transcription | `cohere-asr` | [int8](https://huggingface.co/appautomaton/cohere-asr-mlx) |
| [Qwen3-ASR-1.7B](https://github.com/appautomaton/mlx-speech/blob/main/docs/qwen3-asr.md) | English, Chinese, and mixed-language speech | `qwen3-asr-1.7b` | [int8](https://huggingface.co/appautomaton/qwen3-asr-1.7b-int8-mlx) · [BF16](https://huggingface.co/appautomaton/qwen3-asr-1.7b-bf16-mlx) |
| [Confucius4-R2T2](https://github.com/appautomaton/mlx-speech/blob/main/docs/confucius4-r2t2.md) | Real-time streaming transcription, 30 languages | `confucius4-r2t2` | [BF16](https://huggingface.co/appautomaton/confucius4-r2t2-bf16-mlx) |
| [NVIDIA Nemotron 3.5 ASR Streaming](https://github.com/appautomaton/mlx-speech/blob/main/docs/nemotron-asr.md) | Cache-aware multilingual streaming transcription | `nemotron-asr-streaming` | [int8](https://huggingface.co/appautomaton/nemotron-3.5-asr-streaming-0.6b-int8-mlx) |
| [IBM Granite Speech 4.0 1B](https://github.com/appautomaton/mlx-speech/blob/main/docs/granite-speech-asr.md) | Six-language ASR with a selective-int8 language model | `granite-speech-4.0-1b` | [int8](https://huggingface.co/appautomaton/granite-4.0-1b-speech-int8-mlx) |
| [Audio8-ASR-Infinite](https://github.com/appautomaton/mlx-speech/blob/main/docs/audio8-asr-infinite.md) | Unlimited-length streaming ASR, Chinese and English | `audio8-asr-infinite` | [int8](https://huggingface.co/appautomaton/audio8-asr-infinite-int8-mlx) · [BF16](https://huggingface.co/appautomaton/audio8-asr-infinite-bf16-mlx) |

### Forced alignment (1 family)

| Family | Capabilities | Selector | Weights |
| --- | --- | --- | --- |
| [Qwen3-ForcedAligner](https://github.com/appautomaton/mlx-speech/blob/main/docs/qwen3-forced-aligner.md) | Character and word timestamps for a known transcript (`zh` / `en`) | local path | BF16 or int8, converted³ |

¹ **Companion weights**: OpenMOSS models auto-download the [MOSS audio codec](https://huggingface.co/appautomaton/openmoss-audio-tokenizer-mlx). DramaBox auto-downloads [Gemma 3 12B (4-bit)](https://huggingface.co/appautomaton/gemma-3-12b-it-backbone-4bit-mlx) and optionally [RE-USE / SEMamba](https://huggingface.co/appautomaton/re-use-semamba-mlx) (`denoise_ref=True`, NSCLv1 non-commercial).
² **Direct upstream snapshots**: Download the official Hugging Face release (`hf download <repo> --local-dir ...`) and pass that local directory to `tts.load()`. Weights map in RAM with no conversion step or PyTorch (Drama 3 requantizes block-FP8 experts to MLX int8 on load; Breeze TTS 2 also offers `scripts/convert/breeze_tts.py --int8`; upstream community/non-commercial licenses apply).
³ **Offline conversion**: Download [`Qwen/Qwen3-ForcedAligner-0.6B`](https://huggingface.co/Qwen/Qwen3-ForcedAligner-0.6B), convert with `scripts/convert/qwen3_forced_aligner.py --quant int8`, and pass the output folder to `align.load()`. All source-to-MLX converters live in [`scripts/convert/`](https://github.com/appautomaton/mlx-speech/tree/main/scripts/convert) and never add runtime dependencies.

## Examples

```python
import mlx_speech

# Voice cloning with inline delivery tags
tts = mlx_speech.tts.load("fish-s2-pro")
clip = tts.generate(
    "[excited] This runs entirely on Apple Silicon!",
    reference_audio="ref.wav",
    reference_text="Exact transcript of ref.wav.",
)

# Real-time streaming ASR (also supported by nemotron-asr-streaming & audio8-asr-infinite)
asr = mlx_speech.asr.load("confucius4-r2t2")
session = asr.stream_session(language="English")
for pcm in microphone:  # float32, 16 kHz mono
    print(session.feed(pcm).committed)
print(session.finalize().text)

# Offline ASR & programmatic catalog discovery (including shared-repo artifact_subdir)
granite = mlx_speech.asr.load("granite-speech-4.0-1b")
print(granite.generate("speech.wav").text)
mlx_speech.tts.list_models(detailed=True)
```

```bash
# Bounded waveform streaming, emotion editing, and text-to-SFX from the CLI
mlx-speech tts --model dots-tts-soar --text "Streaming audio." --stream -o stream.wav
mlx-speech tts --model step-audio --reference-audio in.wav --reference-text "Hi." --edit-type emotion --edit-info happy -o happy.wav
mlx-speech tts --model moss-sound-effect --text "rolling thunder with rainfall" --duration-seconds 8 -o thunder.wav
```

## Development

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

Unit tests run offline without checkpoints; real-weight tiers are documented in [`tests/README.md`](https://github.com/appautomaton/mlx-speech/blob/main/tests/README.md). Public site source lives in [`appautomaton.github.io`](https://github.com/appautomaton/mlx-speech/blob/main/WEBSITE.md).

## License

Code is released under the [MIT License](https://github.com/appautomaton/mlx-speech/blob/main/LICENSE). Model weights retain their upstream licenses as noted in each model card and guide.

Built by [App Automaton](https://appautomaton.com) · Thanks to the [linux.do](https://linux.do) community for its inspiration and support.
