Run local models on your Mac. Portato is a menu bar app for chat and coding work,
built on mlx-node, the open source engine and libraries in this repository.
Download for Mac · macOS 26.2 or newer on Apple Silicon · preview builds for Windows ARM64 and Linux arm64 on the same page

A real chat with Qwen3.8-27B running on an M5 Max. It read a one-page card statement on the device and sorted it into categories. The statement is made up. The speed in the picture is from this one reply, not a benchmark.
Run MLX models from Node.js: a CLI, an HTTP server and TypeScript packages on one native engine.
The public APIs are TypeScript. The native layer is Rust and C++ on top of MLX, and nothing needs Python at runtime. Apple Silicon with Metal is the main target. NVIDIA CUDA on Linux arm64 and Windows ARM64 is an inference-only preview. mlx-node is at version 0.0.x, and its APIs can change between releases.
You need Node.js 22.19 or newer. On a Mac, the prebuilt binary needs Apple Silicon and macOS 26.2 or newer. If you want an app and not a terminal, download Portato.
npm install --global @mlx-node/cli
mlx download model --model Qwen/Qwen3-0.6B
mlx serve --port 8080
# in a second terminal (this curl form is for macOS and Linux shells)
curl http://127.0.0.1:8080/v1/responses \
-H 'content-type: application/json' \
-d '{"model":"qwen3-0.6b","input":"Write a haiku about TypeScript."}'Models are stored in ~/.mlx-node/models (set MLX_MODELS_DIR to change it). A model id is its folder name, and GET /v1/models lists them. The download ends with a hint to run mlx convert. This model does not need it.
Portato lives in the menu bar. It bundles the engine, the mlx command and a coding agent, so it needs no Node.js.
- Chat with a local model. Attach text files, pictures and PDFs. Code in an answer is colored by language. Web search stays off until you add your own provider key.
- Work lets the agent read, edit and run commands in a folder you pick. A file edit is shown as a diff, and each command shows its output. A new conversation starts in Ask mode: shell commands, file edits and MCP tool calls wait for you, but reading and searching files does not. Saved grants and allow rules, yours or in the folder's own settings, can let a call run without asking; the Portato guide lists every case.
- Control Panel installs models and shows sessions, speed, memory and the disk cache.

Work mode in Auto, fixing a failing test in a small sample project.
Download Portato from GitHub Releases. The macOS build is the main one: it is signed, notarized and updates itself. The Windows ARM64 (NVIDIA RTX Spark) and Linux arm64 (NVIDIA DGX Spark) builds are previews for inference only. The engine listens on 127.0.0.1 and asks for a token; models download from Hugging Face. How each build updates is in packages/desktop/README.md.
Ten public packages are published under @mlx-node. Open one for its install line and a small example. The examples read models from ~/.mlx-node/models, where mlx download puts them. @mlx-node/core holds the internal native bindings; the packages load it for you, so do not install it directly.
@mlx-node/cli · the mlx command · npm install --global @mlx-node/cli
mlx download model --model Qwen/Qwen3-0.6B # get a model from Hugging Face
mlx serve --port 8080 # start the HTTP server
mlx agent # a coding agent on a local model
mlx launch claude # Claude Code on a local modelThe first run of mlx agent downloads the agent and offers a model: Qwen3.8-27B (18.6 GB) or Inkling-2-Mini (18.7 GB), plus Qwen3.8-Flash-Next (112.2 GB) and Hy4-flash (169.4 GB on macOS) on machines with 96 GiB of RAM or more. mlx launch claude needs claude on your PATH. mlx --help lists every command, including convert, tts, rerank and redact. See docs/cli.md.
@mlx-node/lm · chat sessions, tool calls, images, embeddings · npm install @mlx-node/lm
import { homedir } from 'node:os';
import { join } from 'node:path';
import { loadSession } from '@mlx-node/lm';
const session = await loadSession(join(homedir(), '.mlx-node', 'models', 'qwen3-0.6b'));
const opts = { config: { reasoningEffort: 'none' } };
const first = await session.send('Write a haiku about TypeScript.', opts);
console.log(first.text);
const followUp = await session.send('Make it shorter.', opts);
console.log(followUp.text);A ChatSession keeps the conversation and its KV cache between turns. reasoningEffort: 'none' turns thinking off, which this small model needs to answer in one turn. The session also has sendStream(), sendToolResult(), reset() and dispose(). See docs/models.md.
@mlx-node/server · the HTTP server · npm install @mlx-node/server
import { createInferenceHost } from '@mlx-node/server/host';
// Finds the models in ~/.mlx-node/models and listens on 127.0.0.1.
const host = await createInferenceHost({ port: 8080 });
console.log(host.url);
console.log(host.models.map((model) => model.name));
// Later: stop the server and close the model caches.
await host.close();mlx serve starts the same server. It speaks the OpenAI Responses API (POST /v1/responses) and the Anthropic Messages API (POST /v1/messages), and has routes for reranking and audio. There is no /v1/chat/completions route and no embeddings route. Set --auth-token before you bind another host. Requests to one model decode as one batch where the model supports it (docs/concurrent-inference.md). All flags are in docs/cli.md.
@mlx-node/vlm · OCR and document pipelines · npm install @mlx-node/vlm
import { readFile } from 'node:fs/promises';
import { homedir } from 'node:os';
import { join } from 'node:path';
import { VLModel } from '@mlx-node/vlm';
const ocr = await VLModel.load(join(homedir(), '.mlx-node', 'models', 'paddleocr-vl'));
console.log(await ocr.ocr(await readFile('page.png')));PaddleOCR-VL reads a page. Qianfan OCR answers questions about a document, and the PP-StructureV3 pipeline finds layout and tables. The folder name is an example: point it at your own PaddleOCR-VL folder. See packages/vlm.
@mlx-node/asr · speech to text · npm install @mlx-node/asr @mlx-node/tts
import { homedir } from 'node:os';
import { join } from 'node:path';
import { Qwen3AsrModel } from '@mlx-node/asr';
import { readWav } from '@mlx-node/tts';
// A mono WAV file. transcribe() resamples it to 16 kHz.
const { samples, sampleRate } = await readWav('recording.wav');
const models = join(homedir(), '.mlx-node', 'models');
const asr = await Qwen3AsrModel.load(join(models, 'qwen3-asr-1.7b-mlx-mxfp4'));
const { text } = await asr.transcribe(samples, { sampleRate });
console.log(text);
await asr.dispose();Qwen3-ASR for files, live streams and meetings. @mlx-node/tts is installed for its WAV reader. The checkpoint needs one convert step, described in packages/asr.
@mlx-node/tts · text to speech · npm install @mlx-node/tts
import { homedir } from 'node:os';
import { join } from 'node:path';
import { loadTtsModel, WavWriter } from '@mlx-node/tts';
const models = join(homedir(), '.mlx-node', 'models');
const model = await loadTtsModel(join(models, 'qwen3-tts-12hz-0.6b-customvoice'));
const wav = await WavWriter.open('hello.wav', model.capabilities.sampleRate);
try {
const speech = model.synthesizeStream('Hello from mlx-node.', { voice: 'vivian' });
for await (const chunk of speech) {
await wav.write(chunk);
}
} finally {
await wav.close();
await model.dispose();
}Qwen3-TTS streams audio while it is generated, with preset voices, designed voices and voice cloning. See docs/tts.md.
@mlx-node/rerank · rank documents for a query · npm install @mlx-node/rerank
import { homedir } from 'node:os';
import { join } from 'node:path';
import { loadReranker } from '@mlx-node/rerank';
const models = join(homedir(), '.mlx-node', 'models');
const reranker = await loadReranker(join(models, 'jina-reranker-v3.5-mlx'));
try {
const { results } = await reranker.rerank({
query: 'What is unified memory?',
documents: ['CPU and GPU share a memory pool.', 'A city park.'],
topN: 1,
});
console.log(results[0]); // { index, relevanceScore }
} finally {
await reranker.dispose();
}Jina Reranker v3 and v3.5, and BGE-v2-M3 (not fully validated yet). Model weights keep their own licenses. See docs/rerank.md.
@mlx-node/privacy · find and mask personal data · npm install @mlx-node/privacy
import { homedir } from 'node:os';
import { join } from 'node:path';
import { PrivacyFilter } from '@mlx-node/privacy';
const models = join(homedir(), '.mlx-node', 'models');
const pf = await PrivacyFilter.load(join(models, 'privacy-filter'));
const { redacted } = await pf.redact('Email [email protected] or call +1 555 0100.');
console.log(redacted); // labels like [private_email], [private_phone]A port of openai/privacy-filter with eight kinds of entity. It is a model and can miss one. See docs/privacy-filter.md.
@mlx-node/trl · GRPO and SFT training · npm install @mlx-node/trl
import { homedir } from 'node:os';
import { join } from 'node:path';
import { GRPOTrainer, loadLocalGsm8kDataset } from '@mlx-node/trl';
import { extractGsm8kAnswer, extractXmlAnswer } from '@mlx-node/trl';
// 1 when the <answer> tag holds the dataset's answer ("$" signs ignored), else 0.
function score(text: string, answer: string | null) {
return extractXmlAnswer(text)?.replaceAll('$', '') === answer ? 1 : 0;
}
const trainer = await GRPOTrainer.create({
modelPath: join(homedir(), '.mlx-node', 'models', 'qwen3-0.6b'),
outputDir: 'outputs/grpo',
groupSize: 4,
lossType: 'grpo',
enableThinking: false,
rewardFunction: (outputs, answer: string | null) => {
return outputs.map(({ completion }) => score(completion.text, answer));
},
});
for (const { prompt, metadata } of await loadLocalGsm8kDataset('train', { limit: 100 })) {
const answer = extractGsm8kAnswer(String(metadata?.raw_answer));
const { step, meanReward } = await trainer.trainStep([prompt], answer);
console.log({ step, meanReward });
}
await trainer.saveCheckpoint('final');Run mlx download dataset first, in the folder you train from; it writes data/openai-gsm8k/. trainStep hands each question's answer to the reward, which checks the <answer> tag the prompt asks for. GRPOTrainer has the loss types grpo, dapo, dr_grpo and bnpo, and there is an SFTTrainer. Qwen3 and the Qwen3.5 family can be trained, on Apple Silicon. See docs/training.md.
@mlx-node/agent · model catalog and discovery for the coding agent · npm install @mlx-node/agent
import { homedir } from 'node:os';
import { join } from 'node:path';
import { discoverMlxModels, visibleCatalog } from '@mlx-node/agent';
// The models the first-run picker offers on a Mac or a machine without CUDA.
for (const entry of visibleCatalog()) console.log(entry.label, '-', entry.description);
// The chat models already on disk.
const local = await discoverMlxModels(join(homedir(), '.mlx-node', 'models'));
console.log(local.map((model) => model.agentModel.id));This package is a library. To run the agent itself, use mlx agent.
| Job | Models |
|---|---|
Chat and tool calls@mlx-node/lm |
Qwen3, Qwen3.5/3.6/3.8 dense, Qwen3.5/3.6 MoE, Gemma 4, LFM2/LFM2.5, Nemotron 3.5 Lightning, Muse-Glimmer, Inkling-2, K2-Horizon |
Models bigger than RAM@mlx-node/lm |
Qwen3.8-Flash-Next, DeepSeek V4.1 Flash, Hy4-flash (experts are read from the SSD) |
Images in chat@mlx-node/lm |
Qwen3.5/3.6/3.8, Gemma 4 (audio too), Inkling-2, Qwen3.8-Flash-Next, Hy4-flash |
OCR and documents@mlx-node/vlm |
PaddleOCR-VL, Qianfan OCR, PP-StructureV3 |
Speech to text@mlx-node/asr |
Qwen3-ASR: files, live streams, meetings |
Text to speech@mlx-node/tts |
Qwen3-TTS: preset voices, voice design, voice cloning |
Reranking, embeddings@mlx-node/rerank, @mlx-node/lm |
Jina Reranker v3 / v3.5, BGE-v2-M3 (not fully validated yet), Harrier |
PII redaction@mlx-node/privacy |
A port of openai/privacy-filter |
Decisions and extraction@mlx-node/lm |
CLEF, Clairic |
Training (GRPO and SFT)@mlx-node/trl |
Qwen3, Qwen3.5/3.6/3.8 dense, Qwen3.5/3.6 MoE. All other models are inference only |
Qwen3.5 to 3.8, Qwen3.8-Flash-Next, Gemma 4, Muse-Glimmer, Inkling-2, DeepSeek V4.1 Flash and Hy4-flash load GGUF files as they are: K-quant weights are repacked in memory and no second copy is written to disk. Several families also use speculative decoding (their own prediction heads or a small draft model). The full matrix is in docs/models.md.
- Against llama.cpp, same GGUF file. Qwen3.8-27B UD-Q4_K_XL prefill ran at 1.268x, 1.569x and 1.303x the speed of llama.cpp at 6,219, 18,754 and 32,488 prompt tokens. Decode was 1.051x, 1.138x and 0.999x. Median of 3, 2026-09-09, issue #142.
- Not every row wins. Gemma 4 12B prefill ran at 0.921x of llama.cpp at 7,733 prompt tokens, then 1.350x and 1.656x at longer prompts. 2026-09-10, same issue.
- Four chats on one model. Qwen3.8-27B with its DFlash2 draft produced 115.03 tok/s in total across four chats, which the record gives as 1.90x one chat alone. One trial, 2026-11-17, docs/concurrent-inference.md.
- After a restart. 25,264 of 25,276 tokens of a conversation came back from the disk cache, and prefill took 146 ms against 36,255 ms on the first start. Same run.
- A model bigger than RAM. DeepSeek V4.1 Flash, a GGUF of about 500 GB, peaked at 23.6 to 29.7 GiB of memory and decoded at 2.09 to 2.50 tok/s. It is slow, and it runs. 2026-10-28, docs/models.md.
| Platform | Backend | Status |
|---|---|---|
| macOS 26.2+, Apple Silicon | Metal | Inference, training, images and audio. npm binary and Portato |
| Linux arm64 (glibc), NVIDIA DGX Spark | CUDA 13 | Preview, inference only. Prebuilt npm binary and a Portato preview build |
| Windows ARM64, NVIDIA RTX Spark | CUDA 13.4 | Preview, inference only. Prebuilt npm binary and a Portato preview build |
x86_64 and Intel Macs are not supported. The CUDA npm binaries need the NVIDIA CUDA 13 runtime and cuDNN 9 on the machine. What works on CUDA, what does not, and the Linux and Windows build steps are in docs/cuda.md.
You need Node.js 22.19 or newer, Rust 1.89 or newer and, on a Mac, the macOS 26.2 SDK. Clone with git clone --recurse-submodules https://github.com/mlx-node/mlx-node.git, then run yarn install --immutable && yarn build. yarn build:native builds the Node addon; a plain cargo build does not. More in CONTRIBUTING.md and docs/architecture.md.
CLI · Models and ChatSession · Text to speech · Audio over HTTP · Reranking · Privacy filter · Training · Conversion and quantization · Concurrent inference · Performance notes · CUDA preview · Qwen3.8-Flash-Next · Portato updates · Architecture · Adding a model
The project's own code is under the MIT license. A few interface files are under the Arc Pro license and not the MIT license: the Arc Pro components of the website and the Control Panel's activity chart. THIRD_PARTY_NOTICES lists them.