Skip to content
magicnightPublic

About

macMLX brings local LLM inference to Apple Silicon with a first-class native macOS experience. No cloud, no telemetry, no Electron — just your Mac running models at full speed.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

91 stars

Watchers

1 watching

Forks

Latest commit

 

History

838 Commits

Folders and files

Repository files navigation

macMLX

English · 简体中文

Native macOS LLM inference, powered by Apple MLX.

macMLX runs local LLMs on Apple Silicon with a first-class native macOS experience — no cloud, no telemetry, no Electron. A polished SwiftUI app for newcomers, a proper CLI for developers, and an always-on OpenAI-compatible API for everything else.


Why macMLX?

MLX inference and a CLI used to be the whole pitch — but as of 2026 both LM Studio and Ollama ship MLX engines on Apple Silicon, and LM Studio has the lms CLI. So the honest comparison is the combination: a genuinely native macOS GUI, an always-on API, and zero Python in one ~50 MB app.

macMLX LM Studio Ollama oMLX
Native macOS GUI ✅ SwiftUI Electron menu-bar only ✅ SwiftUI (v0.4+)
Swift-native in-process engine ✅ ❌ ❌ ❌ (Python core)
MLX inference ✅ ✅ ✅ (preview) ✅
CLI ✅ ✅ lms ✅ launcher only
Resumable downloads + mirrors ✅ ⚠ partial ⚠ partial ❌
OpenAI-compatible API ✅ always-on ✅ ✅ ✅
Zero Python required ✅ ✅ ✅ ❌

Where macMLX stands alone: the inference engine itself is Swift, running in-process — oMLX's native app (v0.4+) fronts a Python core, ours has no Python anywhere in one ~50 MB DMG. On top of that: a proper CLI/TUI sharing the same Swift core, and owning frontier model architectures in pure Swift (the DeepSeek V3.2 port) instead of waiting for upstream.

Requirements

macOS 14.0 (Sonoma) or later · Apple Silicon (M1 or later) · no Python required.

Installation

Download macMLX-vX.X.X.dmg from Releases, mount it, and drag macMLX.app to /Applications. The DMG isn't notarized yet (#19), so clear Gatekeeper on first launch:

xattr -cr /Applications/macMLX.app    # clear quarantine
open /Applications/macMLX.app

(Or right-click the app → Open → Open.)

Feature highlights (v0.2 → v0.11)

Nineteen releases since the v0.1 MVP, by area. This section tracks the latest shipped state — new features land here first, then get a one-line roadmap entry below.

  • Engine & models — in-process MLX Swift engine (text + 15 VLM architectures with dedicated OCR-model recognition, models to ~70B; Gemma 4 E4B and dense Qwen3.5/3.6 take images while their text requests keep the prompt cache, tool calls and replayed reasoning, the other Gemma 4 sizes run text-only); continuous batching (2.5-3.2× aggregate throughput under concurrent clients, engages only under real concurrency); tiered KV prompt cache (RAM + SSD) with longest-common-prefix reuse across agent turns; speculative decoding (draft models + acceptance-rate telemetry); multi-model pool with LRU eviction, LoRA adapter inference, MCP server (macmlx mcp serve); pure-Swift architecture ports — DeepSeek V3.2, Mellum2, Solar-Open, GLM-5.1 — registered as external overlays and parity-verified against the Python reference (support tiers). Runs on a controlled minimal fork of mlx-swift carrying five upstream-merged fixes, dropped once an mlx-swift release vendors a core that contains all five.
  • Downloads — resumable across cancels and app quits, live speed/ETA, HuggingFace mirror support, Hub-commit update detection.
  • Chat — conversation sidebar (rename, delete, rewind), streaming Markdown, per-message actions, per-model Parameters Inspector, collapsible <think> reasoning blocks.
  • Audio — speech-to-text and text-to-speech in-process on MLX through mlx-audio-swift (POST /v1/audio/transcriptions, POST /v1/audio/speech, OpenAI-shaped, with formats reported honestly); in the app, transcription is a cancellable attachment in the chat composer and playback is a button on each reply; audio checkpoints get their own model-library scan. Unit-tested, not yet validated against real checkpoints on our hardware.
  • API — always-on OpenAI-compatible server plus the OpenAI Responses API (/v1/responses, stateless — Codex runs against it), Ollama (NDJSON) and Anthropic (/v1/messages with thinking blocks and mid-conversation system turns, plus /v1/messages/count_tokens — Claude Code runs against it) compatibility; structured output (response_format json_object / JSON-schema subset with nested objects, arrays, $ref, any root type, Unicode literals and numeric bounds, constrained decoding); tools pass-through with tool_calls responses; logit_bias, logprobs, stream_options.include_usage with prompt-cache hits in usage, XTC sampler, per-request LoRA adapters, KV-cache quantization; max_completion_tokens; /v1/embeddings + /v1/rerank (mlx-swift-lm's MLXRerankers when the checkpoint is a reranker — encoder cross-encoders, Qwen3 rerankers, Jina v3 — bi-encoder fallback otherwise), rerankers and embedders counted in the model pool's memory budget and unloadable by id, optional bearer auth, model aliases + idle TTL, reasoning_content separation, and an earlier turn's reasoning replayed to the chat template on chat, Responses and Anthropic (Codex's and Claude Code's tool loops included), model cold-swap by ID, stall watchdog, CORS + probe endpoints; concurrent clients batch onto one model instead of queuing serially (requests that offer tools take the single-stream path, since tool calls are only parsed there).
  • CLI — native ANSI dashboards for pull / serve / run, PID coordination shared with the GUI.
  • Activity, Benchmark & Logs tabs — a live Activity panel with sudoless Apple-Silicon readouts (GPU occupancy, memory bandwidth, thermal/memory pressure, per-rail power) and the current inference bottleneck with advice, fusing hardware counters with the engine's own prefill/decode phase (the signal an external monitor can't reach); Benchmark's local tok/s · TTFT · peak memory with a community leaderboard, now attributing each run's decode bottleneck; a Pulse-backed log viewer with MLX stdout/stderr teed in.

Full per-release detail: CHANGELOG.md.

Quickstart

GUI — launch macMLX; the setup wizard picks the engine and model directory; download a model from the built-in HuggingFace browser; load and chat.

CLI

macmlx pull mlx-community/Qwen3-8B-4bit     # download
macmlx run Qwen3-8B-4bit "Hello, world"      # single prompt
macmlx serve                                 # API on :8000
macmlx ps / stop                             # status / shutdown

Connecting external tools

The OpenAI-compatible server runs on http://localhost:8000/v1 whenever a model is loaded (or macmlx serve is running). Point any OpenAI client (Cursor, Continue, Cline, Open WebUI, Zed, Raycast, …) at that base URL with any key.

curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"Qwen3-8B-4bit","messages":[{"role":"user","content":"Hi"}]}'

Codex talks to the Responses API (/v1/responses). Add macMLX as a provider in ~/.codex/config.toml, with a tool-calling model:

model = "Qwen3.6-27B-4bit"
model_provider = "macmlx"
[model_providers.macmlx]
name = "macMLX"
base_url = "http://127.0.0.1:8000/v1"
wire_api = "responses"
# Only with bearer auth on: Codex sends this variable's value as the key.
# env_key = "MACMLX_API_KEY"

macMLX keeps no responses, so a client must send the whole conversation each turn (Codex does); previous_response_id is rejected. Requests are served one at a time, so Codex sub-agents queue rather than run in parallel.

Claude Code talks to the Anthropic Messages API (/v1/messages). Point it at macMLX with a tool-calling model:

export ANTHROPIC_BASE_URL=http://127.0.0.1:8000
export ANTHROPIC_API_KEY=sk-local   # any value
# With bearer auth on, set ANTHROPIC_AUTH_TOKEN to the key instead.
export ANTHROPIC_MODEL=Qwen3.6-27B-4bit
export ANTHROPIC_DEFAULT_OPUS_MODEL=Qwen3.6-27B-4bit
export ANTHROPIC_DEFAULT_SONNET_MODEL=Qwen3.6-27B-4bit
export ANTHROPIC_DEFAULT_HAIKU_MODEL=Qwen3.6-27B-4bit
# Older name of the Haiku setting, for older Claude Code versions.
export ANTHROPIC_SMALL_FAST_MODEL=Qwen3.6-27B-4bit
claude

Map every alias: one left unmapped makes Claude Code request a claude-* model id, which macMLX answers with a 404.

Inference engines

Engine Status Notes
MLX Swift (default) ✅ Shipping Apple's mlx-swift-lm, in-process. Text + 14 VLM architectures, models to ~70B, tiered KV cache + model pool + LoRA.
SwiftLM (100B+ MoE) 🔓 Reopenable Subprocess path, unblocked since sandbox-off (#12 / #13) — not yet committed.
Python mlx-lm 🔓 Reopenable Subprocess path for max model coverage, in exchange for uv on PATH.

Every engine hides behind one InferenceEngine protocol — the GUI never knows which one runs.

Architecture

macMLX.app (SwiftUI)   macmlx (CLI)
        └──── MacMLXCore ────┘        (Swift SPM package)
                  │
           InferenceEngine → MLXSwiftEngine (in-process)
                  │
           HummingbirdServer → http://localhost:8000/v1
                  │
           Apple Silicon (Metal / ANE)

Data lives under ~/.mac-mlx/ (models, conversations, params, logs, settings) — a dotfile under real $HOME, so the sandboxed app reads/writes without entitlements while staying visible to power users.

Building from source

git clone https://github.com/magicnight/mac-mlx && cd mac-mlx
brew bundle                              # dev tools
open macMLX/macMLX.xcodeproj             # GUI  (or: xcodebuild -scheme macMLX build)
swift build --package-path macmlx-cli    # CLI
swift test  --package-path MacMLXCore    # tests (~3s)

Roadmap

This section is the project's single roadmap, kept current per release: when a 0.x ships, it moves from a future section up to Shipped, and the feature highlights above get updated to match. Everything else — plan documents under docs/superpowers/, design specs, .claude/features/ — is either historical or a pointer back here.

  • Shipped (v0.1 → v0.11.0) — native GUI + menu bar + CLI + OpenAI API (v0.1); download & chat polish (v0.2); Benchmark, Logs, chat history, API cold-swap, Ollama compat, sandbox-off (v0.3); the v0.5 engine leap — VLMs, tiered KV cache, model pool, LoRA, MCP server + client pool, chat tool routing; server hardening, embeddings + rerank, and the stability wave (v0.5.1-0.5.3); the DeepSeek V3.2 pure-Swift port, parity-verified at 1e-4; the v0.6 agent backend — continuous batching (2.5-3.2× under concurrency), longest-common-prefix prompt-cache reuse, structured output, speculative decoding, the API-compat pack; the Track G model wave and per-model chat-template overrides (v0.6.1-0.6.2); v0.7.0 silicon-metrics observability — the sudoless Activity panel, the phase-fused bottleneck classifier, per-run benchmark attribution, and OCR-model recognition; v0.8.0, the tiered SSD KV cache hardened end to end — bounded, weight-fingerprinted, restart-surviving with cross-session longest-prefix reuse, and non-blocking; and v0.9.0 — in-process speech-to-text and text-to-speech (/v1/audio/*, plus transcription and playback in the app), a true cross-encoder /v1/rerank, MTP drafter detection, the app finally linking the controlled MLX fork, and thirteen upstream MLX correctness fixes; and v0.10.0 — the response_format schemas Apple's @Generable emits (nested objects, arrays, $ref, any root, Unicode literals, numeric bounds) plus include_usage and max_completion_tokens, unloads that actually return memory, rerankers and embedders inside the pool budget, /v1/rerank on MLXRerankers, the MLX fork rebased on mlx-swift 0.32.3, audio downloads kept in the app's cache, and a DMG built from the committed lockfiles; and v0.11.0, a local agent backend — the OpenAI Responses API (/v1/responses, which Codex runs against), Claude Code compatibility on /v1/messages with thinking and count_tokens, the reasoning round trip, reuse of each agent turn's history on hybrid and sliding-window models, Xcode 27 and Apple's Foundation Models client checked end to end (setup and limits), images on Gemma 4 E4B and dense Qwen3.5/3.6, and JSON null reaching the chat template instead of failing the request. Per-tag detail in CHANGELOG.md.
  • Next release (on main) — nothing yet; see [Unreleased] in CHANGELOG.md.
  • In progress — MTP decoding for the Qwen3.5-family checkpoints that ship an MTP head, taken together with the mlx-swift-lm 3.33 move; and lower memory use, starting with KV-cache quantization that works together with the prompt cache (today a request with kv_bits bypasses the prompt cache).
  • Queued — the next pure-Swift architecture port, done the way DeepSeek V3.2 was, for a new family mlx-swift-lm does not cover yet; measure, then decide on .balanced prefill chunking; return to upstream mlx-audio-swift once a release keeps every audio download in the cache it is given and sends its token clients to HF_ENDPOINT (the fork now sits on v0.2.1, and only those fixes separate it from upstream).
  • Later — a community benchmarks service; Apple's built-in model as a macMLX engine on macOS 27; evaluate a model-tier mapping panel for Claude Code / Codex; custom Metal kernels only if profiling demands it.
  • Reopenable (feasible since sandbox-off) — Python / SwiftLM subprocess engines (#12 / #13); signed + notarized DMG (#19, needs a paid developer account). The Homebrew formula is rendered and attached to every release, but the tap repository itself is not published yet (#20).

Contributing · License

Issues and PRs welcome — see CONTRIBUTING.md. Apache 2.0 (LICENSE).

Acknowledgements

MLX + mlx-swift-lm (Apple), Swama, SwiftLM, oMLX, Hummingbird, Sparkle, Pulse, SwiftTUI. Full citations: CITATIONS.bib.

About

macMLX brings local LLM inference to Apple Silicon with a first-class native macOS experience. No cloud, no telemetry, no Electron — just your Mac running models at full speed.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

91 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages