Unix-style CLI wrappers for MLX speech, language, and TTS models
Project description
mlx-pipe
Unix-style CLI wrappers for MLX speech and language models.
Alpha software:
mlx-pipecurrently targets Apple Silicon Macs and Python 3.11 or 3.12. The MLX audio ecosystem is moving quickly, so model-specific behavior may change between releases.
mlx-pipe keeps stdout pipe-friendly:
sttandllmwrite plain text to stdout.ttswrites WAV bytes to stdout, or to--out.- progress, model loading, and warnings go to stderr.
--jsonis available when structured output is needed.
Install
From PyPI. The package is published as mlx-pipe; the installed CLI command is mlx-pipe:
uv tool install mlx-pipe --python 3.12
mlx-pipe --help
For local development, clone the repository and use uv:
uv sync
uv run mlx-pipe --help
Python is pinned to >=3.11,<3.13 because the MLX audio stack is not yet stable
on Python 3.13.
Quick Start
Run a local LLM:
uv run mlx-pipe llm "Say hello in one short sentence" \
--model mlx-community/gemma-3-1b-it-4bit
Transcribe audio:
uv run mlx-pipe stt /tmp/asr.wav \
--model RayyTien/Breeze-ASR-26-mlx-4bit
Generate speech:
uv run mlx-pipe tts "Hello from Voxtral." \
--model mlx-community/Voxtral-4B-TTS-2603-mlx-4bit \
--voice casual_male \
--out /tmp/voxtral.wav
file /tmp/voxtral.wav
Expected file output:
RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 24000 Hz
Pipe Composition
Transcribe speech, then send the transcript to an LLM:
uv run mlx-pipe stt /tmp/asr.wav \
--model RayyTien/Breeze-ASR-26-mlx-4bit \
| uv run mlx-pipe llm "translate to Chinese" \
--model mlx-community/gemma-3-1b-it-4bit
Generate text, then synthesize it:
uv run mlx-pipe llm "explain MLX in one sentence" \
--model mlx-community/gemma-3-1b-it-4bit \
| uv run mlx-pipe tts \
--model mlx-community/Voxtral-4B-TTS-2603-mlx-4bit \
--voice casual_male \
--out /tmp/mlx.wav
When stdin is piped into llm, the positional prompt is treated as the
instruction:
{instruction}:
{stdin text}
Logprobs
Use --json --logprobs to include generated token metadata. Use
--top-logprobs N to include the top N alternatives for each generated token.
uv run mlx-pipe llm "Say hello" \
--model mlx-community/gemma-3-1b-it-4bit \
--json \
--logprobs \
--top-logprobs 5 \
--max-tokens 8
Output shape:
{
"text": "Hello there! How can I help you",
"meta": {"model": "mlx-community/gemma-3-1b-it-4bit"},
"tokens": [
{
"token": 9259,
"text": "Hello",
"logprob": 0.0,
"top_logprobs": [
{"token": 9259, "text": "Hello", "logprob": 0.0}
]
}
]
}
Config
Model resolution priority is:
- explicit
--model - user config
- built-in defaults
Set defaults:
uv run mlx-pipe config set llm.default mlx-community/gemma-3-1b-it-4bit
uv run mlx-pipe config set stt.default RayyTien/Breeze-ASR-26-mlx-4bit
uv run mlx-pipe config set tts.default mlx-community/Voxtral-4B-TTS-2603-mlx-4bit
Read config:
uv run mlx-pipe config get llm.default
uv run mlx-pipe config list
By default config is stored at:
~/.config/mlx-pipe/config.json
For tests or isolated runs, override it:
MLX_PIPE_CONFIG_HOME=$(mktemp -d) uv run mlx-pipe config list
Model Management
Download a model:
uv run mlx-pipe pull mlx-community/gemma-3-1b-it-4bit
List cached Hugging Face models:
uv run mlx-pipe list
Remove cached models:
uv run mlx-pipe remove mlx-community/gemma-3-1b-it-4bit
Suggested Models
LLM:
mlx-community/gemma-3-1b-it-4bit
ASR:
RayyTien/Breeze-ASR-26-mlx-4bit
Breeze-ASR-26 is intended for Taiwanese Hokkien / Taigi audio with Mandarin
Chinese character output. For English test audio, use an English Whisper model
instead.
TTS:
mlx-community/Voxtral-4B-TTS-2603-mlx-4bit
Voxtral requires tiktoken, which is included in this package's dependencies.
Development
Run the local checks:
uv sync
uv run pytest
uv run ruff check .
uv run python -m build
uv run twine check dist/*
Run CLI smoke checks without downloading models:
uv run mlx-pipe --help
uv run mlx-pipe llm --help
uv run mlx-pipe stt --help
uv run mlx-pipe tts --help
Run a config smoke check:
tmpdir=$(mktemp -d)
MLX_PIPE_CONFIG_HOME=$tmpdir uv run mlx-pipe config set llm.default local-llm
MLX_PIPE_CONFIG_HOME=$tmpdir uv run mlx-pipe config get llm.default
MLX_PIPE_CONFIG_HOME=$tmpdir uv run mlx-pipe config list
CI
The GitHub Actions workflow runs on a macOS arm64 hosted runner because MLX is Apple Silicon oriented. It verifies:
- locked dependency resolution
- unit tests
- ruff lint
- CLI help/config smoke checks
Full model e2e tests are intentionally manual for now because they download large models and can make routine CI slow and expensive.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlx_pipe-0.1.0a1.tar.gz.
File metadata
- Download URL: mlx_pipe-0.1.0a1.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79c0a85f15c991757855a4f558dfef36afe3b9e48327a752dd781812eead939f
|
|
| MD5 |
8607b98130435e76a85fc2522cf712d4
|
|
| BLAKE2b-256 |
df77e43dc8f09e6bead67c4c83c5e1cc2b719a1da5e7360066804d95eeae6146
|
Provenance
The following attestation bundles were made for mlx_pipe-0.1.0a1.tar.gz:
Publisher:
publish.yml on Ray0907/mlx-pipe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlx_pipe-0.1.0a1.tar.gz -
Subject digest:
79c0a85f15c991757855a4f558dfef36afe3b9e48327a752dd781812eead939f - Sigstore transparency entry: 1562244944
- Sigstore integration time:
-
Permalink:
Ray0907/mlx-pipe@dbd36931afc8d21d89efe8013b82067a41294f66 -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/Ray0907
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dbd36931afc8d21d89efe8013b82067a41294f66 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mlx_pipe-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: mlx_pipe-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9d2d20ecc51c2637ec47e9a7f8338bf146fdb1526fc42af70d31a4d92b48be2
|
|
| MD5 |
c9fd61568ccc4ab46489bb2b00758c7f
|
|
| BLAKE2b-256 |
57fc456b7f14e2f94467e28ff18c81465bf05a8b54722ac79de5d5b1ed4335f2
|
Provenance
The following attestation bundles were made for mlx_pipe-0.1.0a1-py3-none-any.whl:
Publisher:
publish.yml on Ray0907/mlx-pipe
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mlx_pipe-0.1.0a1-py3-none-any.whl -
Subject digest:
a9d2d20ecc51c2637ec47e9a7f8338bf146fdb1526fc42af70d31a4d92b48be2 - Sigstore transparency entry: 1562244999
- Sigstore integration time:
-
Permalink:
Ray0907/mlx-pipe@dbd36931afc8d21d89efe8013b82067a41294f66 -
Branch / Tag:
refs/tags/v0.1.0a1 - Owner: https://github.com/Ray0907
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dbd36931afc8d21d89efe8013b82067a41294f66 -
Trigger Event:
release
-
Statement type: