Skip to main content

MLX-native speech library for Apple Silicon.

Project description

mlx-speech

License: MIT Python 3.13+ Platform

[!NOTE] This project wouldn't exist without the inspiration and generous support of the incredible community at linux.do.

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

Alias Type Description
fish-s2-pro TTS Fish S2 Pro — dual-AR TTS, voice cloning, emotion tags
vibevoice TTS VibeVoice Large — hybrid LLM+diffusion TTS, voice cloning
longcat TTS LongCat AudioDiT — flow-matching diffusion TTS
moss-local TTS OpenMOSS TTS Local — local-attention multi-VQ TTS
moss-ttsd TTS OpenMOSS TTS Delay — delay-pattern dialogue TTS
cohere-asr ASR Cohere Transcribe — multilingual ASR

Requirements

  • Apple Silicon Mac (M1 or later)
  • Python 3.13+

Installation

pip install mlx-speech

Quick Start

Models download automatically from HuggingFace on first use.

Python API:

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("cohere-asr")
result = asr.generate("audio.wav")
print(result.text)

# List available models
mlx_speech.tts.list_models()
mlx_speech.asr.list_models()

CLI:

# 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

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

Local model paths work too:

mlx-speech tts --model models/fish_s2_pro/mlx-int8 --text "Hello!" -o output.wav

Models

Pre-converted MLX weights are on Hugging Face under appautomaton. Use mlx_speech.tts.load("alias") or mlx_speech.tts.load("appautomaton/repo-name") to load them.

Alias HF Repo Quant
fish-s2-pro fishaudio-s2-pro-8bit-mlx int8
vibevoice vibevoice-mlx int8
longcat longcat-audiodit-3.5b-8bit-mlx int8
moss-local openmoss-tts-local-mlx int8
moss-ttsd openmoss-ttsd-mlx int8
moss-sound-effect openmoss-sound-effect-mlx 4-bit
step-audio step-audio-editx-8bit-mlx int8
cohere-asr cohere-asr-mlx int8

Conversion

Convert from upstream source weights:

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_cohere_asr.py

Model Guides

Each family has a doc covering behavior, flags, and known limitations:

Development

git clone https://github.com/appautomaton/mlx-speech.git
cd mlx-speech
uv sync
uv run pytest tests/unit/
uv run ruff check .
mlx-speech/
  src/mlx_speech/    library code
  scripts/           conversion and generation entry points
  models/            local checkpoints (not in git)
  tests/             unit, checkpoint, runtime, integration tests
  docs/              model-family behavior guides

License

MIT — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlx_speech-0.3.0.tar.gz (196.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlx_speech-0.3.0-py3-none-any.whl (255.5 kB view details)

Uploaded Python 3

File details

Details for the file mlx_speech-0.3.0.tar.gz.

File metadata

  • Download URL: mlx_speech-0.3.0.tar.gz
  • Upload date:
  • Size: 196.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mlx_speech-0.3.0.tar.gz
Algorithm Hash digest
SHA256 582b7ed38eb6395c01b810673d8cb3a141500a597c5aa18af744ecbdd9aeae42
MD5 1a455fa0fe32216a515c6b4743568041
BLAKE2b-256 52af11e7b57dfe897a73a671526bc281aa9ff30893e624aa809971890d068b7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlx_speech-0.3.0.tar.gz:

Publisher: publish.yml on appautomaton/mlx-speech

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mlx_speech-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mlx_speech-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 255.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mlx_speech-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10a0d62b28b6de6410166310e9bc475552375ca0b08058f9f5ae9358e38fcaa8
MD5 a15e8f636745e58ffcdeb6e92b0acfc7
BLAKE2b-256 9daced8844dbf81b955fbbc33e8b7baeacdb66875f4588f7f12949a4ba29e95f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mlx_speech-0.3.0-py3-none-any.whl:

Publisher: publish.yml on appautomaton/mlx-speech

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page