@mlx-node/cli

The mlx command: download, convert and serve models, and run coding agents from the terminal.

Install

bash
npm install --global @mlx-node/cli

This gives you the mlx command. You need Node.js 22.19 or newer. Portato brings its own copy of the command at ~/.mlx-node/bin/mlx.

The shell samples on these pages use macOS and Linux shell syntax. On Windows, put each command on one line and write the model path in full.

Command map

The commands of mlx
Command What it does
mlx download model Get a model from Hugging Face
mlx download dataset Get a dataset
mlx download --set-token Store a Hugging Face token in the system keychain
mlx serve Start the HTTP server
mlx agent A coding agent on a local model, in your terminal
mlx agent update Update the agent
mlx launch claude Start the server and run Claude Code against it
mlx delegate Run the agent once with a prompt, then exit
mlx convert Change dtype, quantize, or turn a GGUF into SafeTensors
mlx calibrate Collect activation ranges for a quantization recipe
mlx eval cache, mlx eval score Score a checkpoint against a reference model
mlx tts Speak text to the speakers or a WAV file
mlx rerank Rank documents for a query (JSON in, JSON out)
mlx redact Find and mask personal data in text

mlx <command> --help prints the options of each one.

Download models and datasets

bash
mlx download model --model Qwen/Qwen3-0.6B
Flags of mlx download model
Flag Meaning
-m, --model The Hugging Face repo
-o, --output Where to write it. Default: ~/.mlx-node/models/<name>
-g, --glob Pick files by pattern. Repeat it for more patterns. Use it to choose one GGUF build
--assets-repo A second repo to take the tokenizer and config from, for GGUF repos that lack them
--force Download again

A GGUF build with its tokenizer:

bash
mlx download model -m unsloth/Qwen3.8-27B-GGUF -g "*UD-Q4_K_XL*" \
  --assets-repo Qwen/Qwen3.8-27B

For a GGUF that takes images, the download also fetches the matching vision file.

mlx download dataset gets a dataset (default openai/gsm8k) and writes it to data/<name>/ in the current folder.

Coding agents

mlx agent runs a coding agent on a local model. The first run downloads the agent to ~/.mlx-node/bin and asks you to pick a model. Its settings live in ~/.mlx-agent. mlx agent update updates it.

Models the first-run picker offers
Model Download Offered on
Qwen3.8-27B (the default) 18.6 GB (UD-Q4_K_XL) or 17.5 GB (UD-Q4_K_M), plus a 3.85 GB draft model Every supported machine
Inkling-2-Mini 18.7 GB, 17.7 GB or 20.2 GB by build, plus a 1.0 GB draft model Every supported machine
Qwen3.8-Flash-Next 112.2 GB 96 GiB of RAM or more
Hy4-flash 169.4 GB on macOS, plus a 6.24 GB draft model 96 GiB of RAM or more

mlx launch claude starts the server and runs Claude Code against it. You need the claude command on your PATH. --model picks the model, and everything after -- goes to claude.

mlx delegate runs the same agent without a screen: it takes one prompt, does the work and exits.

Convert and quantize

bash
mlx convert --input ~/.mlx-node/models/qwen3-0.6b \
  --output ~/.mlx-node/models/qwen3-0.6b-mlx-bf16

You do not need this for the quickstart model. Use it when you want another dtype (-d) or a quantized copy (-q, with --q-bits and --q-mode affine, mxfp4, mxfp8, nvfp4 or sym8). The input can be a folder or a .gguf file.

Speech, reranking and redaction

  • mlx tts reads text from --text, --file or stdin. -m names the model folder. It needs one voice (--voice for a preset, --reference-audio to clone one, or --voice-description) and at least one of --play and -o: --play plays it on a Mac, -o writes a WAV file.
  • mlx rerank -m <model> -i <file> reads JSON with query and documents and prints the ranking as JSON.
  • mlx redact -m <model> -i <file> masks personal data. --labels limits the kinds, --threshold sets the score cut (default 0.5), --json also writes the entities as JSON.

Each of these is a library too: @mlx-node/tts, @mlx-node/rerank and @mlx-node/privacy.

Where files live

What Where
Models ~/.mlx-node/models (MLX_MODELS_DIR changes it)
The agent ~/.mlx-node/bin
The disk state cache of Qwen3.5-family models, Qwen3.8-Flash-Next and Hy4-flash ~/.mlx-node/cache/prefix-cache (mlx serve --cache-dir changes it)
The disk KV cache of Qwen3, Gemma 4, Muse-Glimmer and LFM2 ~/.mlx-node/cache/paged
Server logs with --verbose ~/.mlx-node/logs/<time>

Go deeper