mlx-serve README

项目的 README,来自 github.com/ddalcu/mlx-serve。合并为一个 markdown 文件:README.md。

MLX-Serve, a local LLM and media server for Apple Silicon

MLX-Serve

Run open models on your Mac: chat, coding agents, images, video, music, speech and 3D. One native app and one local server that speaks the OpenAI, Anthropic and Ollama APIs. It runs offline, needs no Python and no account, and it's MIT licensed.

Release Downloads Stars License: MIT

Download for Mac · Homebrew · iPhone · Linux · mlxserve.com · 简体中文

Chatting with a local model, making a picture and coding with Claude Code, all on one Mac

Install

The app. Download MLX-Serve, drag it to Applications and open it. It needs macOS 26.2 or later on Apple Silicon, suggests a model that fits your Mac, and updates itself.

Homebrew.

brew tap ddalcu/mlx-serve https://github.com/ddalcu/mlx-serve
brew trust ddalcu/mlx-serve
brew install --cask mlx-serve   # the app
brew install mlx-serve          # or only the command-line server

The terminal, if you know Ollama:

mlx-serve run gemma4          # downloads Gemma 4 E4B, serves it and chats right here
mlx-serve pull gemma4:26b     # download only, resumable
mlx-serve serve               # serve everything you downloaded; models load when asked for

The server listens on http://localhost:11234. Point any OpenAI, Anthropic or Ollama client at it, or open that address in a browser for the built-in web console.

iPhone

MLX-Serve puts the same engine on your iPhone: chat with Gemma 4, clone your voice, and make pictures and music, all on the phone and offline. It needs an A17 Pro-class iPhone or newer with iOS 26.

Linux and Windows

Every release has Linux downloads for NVIDIA GPUs: x64 for RTX 20 to 50 cards, arm64 for DGX Spark, GH200 and Jetson Thor. On Windows with an NVIDIA card, one script builds it. Details are in docs/building.md.

What it does

What can my Mac run?

The app suggests a first model for your Mac's memory:

Memory Suggested model
16 GB Gemma 4 E4B
18–24 GB Gemma 4 12B
32 GB Qwen 3.8 27B
36 GB Qwen 3.8 27B 6-bit
48–64 GB Qwen 3.8 27B 8-bit
96 GB and up Qwen3.8-Flash-Next (125B, about 6B active per token)
128 GB Also GLM-5.3-Flash and DeepSeek-V4.1-Flash, their experts streamed from the SSD
256 GB Also GLM-5.3-Flash in memory (NVIDIA's FP4 pack)

Thousands more run too: any MLX model with a supported architecture, and any GGUF. The tier list ranks the popular ones, and docs/models.md lists every architecture.

Speed

Decode speed in v26.11.4 on an M5 Ultra with 256 GB, on a code prompt, with speculative decoding on:

Model Tokens per second
Qwen3.6 35B-A3B, 4-bit 436
Qwen3.8 27B, 4-bit 250
Gemma 4 E4B, 4-bit 197
Gemma 4 26B-A4B, 4-bit 186
Qwen3.8-Flash-Next, 4.7 bits 164

On an M4 Max, the same models decode 10% to 47% faster than they did in v26.8. Every release is measured the same way in benchmarks.md; speculative decoding and tuning are in docs/performance.md.

Docs

Build from source

You need Xcode 26.2 or later and Homebrew:

git clone --recurse-submodules https://github.com/ddalcu/mlx-serve && cd mlx-serve
./app/build.sh

The script fetches the pinned Zig, builds MLX and llama.cpp, and signs the app ad hoc. There's no Python anywhere in the build. Server-only builds are in docs/building.md.

Community

Questions, ideas and things you made: the community chat on X and GitHub issues. Builds and deep dives go out on YouTube and X.

Thank you

Thank you to the sponsors who back mlx-serve: @jcprichard, @skudinov, @davidfekke, @lojza3d, @cpko, @d-b, @alinselea, @sbusso, @Yue-Hao, @HLGRL, @iTAGXX, @abeansits, @VincentRK, @davecrist, @djnmrjnvc, @travishaby, Ivan Fioravanti, Patrik Svancara, Jaroslav, Marius, Johnny Dang, @R0xr1te and two supporters who gave anonymously. If it's useful to you, you can support it on GitHub Sponsors or Buy Me a Coffee. Nothing is paywalled: it's MIT now and stays MIT.

Thank you also to everyone who sends code, reports and ideas. The contributors page shows the code side, and the changelog thanks people release by release.

Acknowledgements

mlx-serve builds on MLX, mlx-c, mlx-lm, llama.cpp, antirez/ds4, mlx-stream, Sushi, jinja.cpp, nlohmann/json, stb_image, libwebp, Hugging Face tokenizers and Zig. It runs the open models their authors published, and the app uses the Anthropic and MCP Swift SDKs.

Licenses and required notices are in NOTICE. If we missed you, please open a PR.

Star history

GitHub star history for ddalcu/mlx-serve

ddalcu%2Fmlx-serve | Trendshift

If mlx-serve is useful to you, a star helps other people find it.

License

MIT, see LICENSE. Bundled third-party code keeps its own license: NOTICE lists it with the required attributions, and LICENSE-APACHE-2.0 has the Apache license text.

mlx-serve (ddalcu/mlx-serve)

正在搜索数据库…

这是什么?mlx-serve 是一个面向 Apple Silicon Mac 的原生本地推理服务器,可运行 MLX 和 GGUF 语言模型,并提供兼容 OpenAI、Anthropic 和 Ollama 的 API,还能生成图像、视频、音乐、语音和 3D 模型,全程无需 Python 或云连接。
这是命令行服务器,还是桌面应用?两者都是:核心是一个单一的 Zig 二进制 HTTP 服务器,同一个二进制文件也被打包进 MLX Core——一个已签名的 macOS 菜单栏应用,具备聊天、智能体模式、MCP 工具调用和模型管理功能,前端用 Swift 构建。
我怎么让它跑起来?下载适用于 Apple Silicon 的已签名、已公证的 MLX-Serve.app,通过 Homebrew 安装,或在终端中像 Ollama 那样运行它;从源码构建需要带 Metal Toolchain 的 Xcode 26.2+,并由一个负责获取 Zig、MLX 和 llama.cpp 的脚本驱动。
我需要 Python 或特定 macOS 版本吗?无论构建还是运行时都不需要任何 Python;你只需要 Apple Silicon 上的 macOS 26.2+,如果从源码构建还需要带 Metal Toolchain 组件的 Xcode 26.2+。
它能在 Intel Mac 或其他操作系统上运行吗?不能——它是专门为 macOS 26.2+ 上的 Apple Silicon 构建的;没有 Windows、Linux 或 Intel Mac 版本。
为什么 mlx-serve 比 LM Studio 或 Ollama 更快?它使用自定义 Metal 内核、四种不同的投机解码方式(PLD、draft companions、Gemma 4 drafter、原生 Qwen MTP)、连续批处理和 KV 缓存量化,在相同的 MLX 权重下实测解码速度比 LM Studio 快 26%。
它能运行 DeepSeek V4 Flash 这样的大模型吗?可以,DeepSeek V4 Flash(284B 参数)通过一个名为 antirez/ds4 的专用引擎获得支持,这是被比较的其他工具(LM Studio、Ollama、mlx-lm)都做不到的。
Agent Sandbox 功能是什么?这是一个单独的开关,把智能体的每条 shell 命令都路由到一个可在不到一秒内启动的隔离 Linux 虚拟机中,这样智能体就能运行命令而不会碰到你 Mac 的真实文件系统。
除文本外它还能生成什么其他媒体?图像、视频、音乐、支持声音克隆的语音以及 3D 模型,全部在 MLX 上原生实现,既可以通过聊天请求,也可以通过专用的 /v1/images、/v1/audio、/v1/video 和 /v1/3d HTTP 端点。
作者
ddalcu
大小
155.7 MB
星标
2.5K
时长
9个月
提交 · 90 天