Quickstart

Install the mlx command, download a small model and get a first answer.

What you need

  • Node.js 22.19 or newer.
  • On a Mac: Apple Silicon and macOS 26.2 or newer. The prebuilt binary does not load on older versions of macOS.
  • Linux arm64 and Windows ARM64 with an NVIDIA GPU are a preview. See Platforms.

If you want an app and not a terminal, Portato bundles everything on this page.

Install

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

This gives you the mlx command. mlx --help lists every command.

Download a model

bash
mlx download model --model Qwen/Qwen3-0.6B

The model goes to ~/.mlx-node/models/qwen3-0.6b. Set MLX_MODELS_DIR to use another folder.

You can skip the convert hint

The download ends with a hint to run mlx convert. This model does not need it. mlx serve and the library load the folder as it is.

Some models on Hugging Face need a login. mlx download --set-token stores your token in the system keychain.

Start the server

bash
mlx serve --port 8080

The server listens on 127.0.0.1 and loads the model on its first request. Without --port it picks a free port and prints it.

Send a request

Run this in a second terminal. The curl form is for macOS and Linux shells; on Windows, send the same JSON to the same URL with any HTTP client.

bash
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."}'

The model id is the folder name. GET /v1/models lists the ids the server found. The reply is JSON; its output list holds the model's reasoning and then its message.

Use it from TypeScript

bash
npm install @mlx-node/lm
ts
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);

reasoningEffort: 'none' turns thinking off. Without it, this small model can spend a whole turn thinking and return no text.

Where to go next

  • @mlx-node/cli: the mlx command. Download other models, run a coding agent.
  • @mlx-node/lm: streaming, tool calls, images, embeddings.
  • @mlx-node/server: routes, auth, memory and cache flags.
  • Models: what runs, and a first model for real work.

Libraries

The repository is a monorepo: one app, ten packages and the native engine. Each package has its own page.

The ten public packages and their pages
Package Use it for
@mlx-node/cli The mlx command
@mlx-node/lm Chat sessions, tool calls, images in chat, embeddings
@mlx-node/server The HTTP server, from the command or from your code
@mlx-node/vlm OCR and document pipelines
@mlx-node/asr Speech to text
@mlx-node/tts Text to speech
@mlx-node/rerank Reranking
@mlx-node/privacy Finding and masking personal data
@mlx-node/trl Training
@mlx-node/agent The model catalog and model discovery for the coding agent

@mlx-node/core holds the internal native bindings. The packages above load it for you, so you do not install it yourself.

Portato is the desktop app built from the same repository.

Go deeper