Rapid-MLX 是什么?

Rapid-MLX 是基于 Apple MLX 的本地 AI 推理引擎,号称 Apple Silicon(M1-M4)上最快——比 Ollama/llama.cpp 快 2-4x、缓存命中 TTFT 低至 0.08s;提供 drop-in 的 OpenAI 兼容 API(localhost:8000/v1),任何接 ChatGPT 的 app(Cursor、Claude Code、Aider、LangChain 等)改个地址即用,强项是 100% tool calling(17 个 tool parser)、prompt cache、reasoning separation 和 smart cloud routing。

⭐ 2,936 Stars 🍴 346 Forks Python Apache-2.0 作者: raullenchai 商业引流:低
来源:README 首段 + Features + pyproject 查看 GitHub 仓库 →

为什么值得关注

Mac 用户本地跑 LLM 主流是 Ollama/llama.cpp,但它们没有充分吃透 Apple Silicon。Rapid-MLX 基于 Apple 官方 MLX 框架做推理,在 M 系芯片上比 Ollama 快 2-4x、缓存 TTFT 0.08s,且把 coding agent 最看重的能力做透——100% tool calling + 17 个 tool parser(适配各模型的工具调用格式)、reasoning separation(分离思考与回答)、prompt cache(缓存前缀省时)。它是 drop-in OpenAI API,Cursor/Claude Code/Aider 改个 base URL 就能用本地模型,还有 smart cloud routing(本地搞不定时路由到云)、DFlash 投机解码、多模态(vision extras)。配套大量 benchmark/evals/reports + Model-Harness Index(MHI,测各模型在各 agent harness 上的表现)。2.4K★ 反映 Mac 用户对「比 Ollama 更快、tool calling 更靠谱、能直接喂给 Claude Code/Cursor」的本地推理引擎的需求。

来源:README 首段 / Works With / Features / Benchmarks

核心功能

MLX 推理,Apple Silicon 上比 Ollama 快 2-4x

基于 Apple 官方 MLX + mlx-lm 框架做推理,充分利用 M1-M4 的统一内存和 Metal,号称比 Ollama/llama.cpp 快 2-4x、缓存命中 TTFT 0.08s。核心是 vllm_mlx(vLLM 风格的 MLX 服务层),支持连续批处理等优化。

来源:README 首段 / Benchmarks + pyproject(mlx/mlx-lm)+ vllm_mlx/ 目录
drop-in OpenAI API + 广泛兼容

rapid-mlx serve 起一个 OpenAI 兼容服务在 localhost:8000,任何接 ChatGPT API 的 app 改 base URL 到 /v1 即用。MHI(Model-Harness Index)测过的 agent harness 包括 Claude Code、Cursor、Aider 等,也兼容 PydanticAI、LangChain 及各 UI/IDE 客户端。

来源:README Quick Start / Works With(Agent Harnesses MHI-tested)
100% tool calling + 17 个 tool parser

工具调用是它的强项——100% tool calling 成功率,内置 17 个 tool parser 适配不同模型族的工具调用输出格式(Qwen/DeepSeek/Nemotron 等),这正是 Cursor/Claude Code 等 coding agent 高度依赖的能力,比很多本地引擎在 tool calling 上更可靠。

来源:README desc / Features(Tool Calling)
reasoning separation + prompt cache

reasoning separation 把模型的思考过程与最终回答分离(便于 agent 只取答案);prompt cache 缓存共享前缀,让重复上下文的请求 TTFT 大幅降低(缓存命中 0.08s)。两者都针对 agent 高频、长上下文场景优化。

来源:README Features(Reasoning Separation / Prompt Cache)
smart cloud routing + DFlash 投机解码 + 多模态

smart cloud routing 在本地模型搞不定时路由到云模型(本地为主、云兜底);DFlash speculative decoding 做单用户投机解码加速;多模态经 [vision] extras 支持 Gemma 4 / Qwen-VL 等图像理解模型。

来源:README Features(Smart Cloud Routing / DFlash / Multimodal)
丰富模型阵容 + 按内存推荐 + MHI 评测

按 Mac 内存推荐模型(16GB 轻量 → 96GB+ 最佳),覆盖 Qwen 3.5/3.6、Nemotron Nano、coding MoE、vision 等,copy-paste 命令即拉即跑;Model-Harness Index(MHI)系统测各模型在各 agent harness 上的实际表现,evals/reports/tests 大量验证。多种安装(Homebrew/pip/一行脚本,含自动装 Python)。

来源:README Choose Your Model / MHI / Quick Start

技术架构

Rapid-MLX 是 Python 项目,核心在 vllm_mlx/(204 文件)——一个 vLLM 风格的 MLX 推理服务层,基于 Apple 的 mlx + mlx-lm(0.31+ 用 ArraysCache 原生批处理支持混合模型)+ transformers 5.0,用 FastAPI 暴露 OpenAI 兼容端点。围绕 Apple Silicon 做优化:统一内存、Metal、连续批处理、prompt cache(前缀缓存)、DFlash 投机解码。tool calling 层有 17 个 parser 适配不同模型的工具调用格式,reasoning separation 分离思考与回答,smart cloud routing 做本地/云分流。配套 evals/(99)+ reports/(87)+ tests/(153)+ harness/ 构成 Model-Harness Index(MHI)——系统化测各模型在 Claude Code/Cursor/Aider 等 harness 上的真实表现,这套评测体系是它敢喊「最快 + 100% tool calling」的底气。数据流:rapid-mlx serve 起 FastAPI 服务 → 加载 MLX 模型 → OpenAI 兼容请求进来 → prompt cache 命中则快速 TTFT、否则 MLX 推理 → tool parser 解析工具调用 → reasoning separation 拆分输出。设计判断:押注「MLX 是 Apple Silicon 上最优推理后端」+「把 tool calling/reasoning/cache 这些 agent 刚需做透」+「drop-in OpenAI 兼容」三点,精准服务「Mac 上给 Claude Code/Cursor 喂本地模型」的人群,且用 MHI 把模型×harness 的兼容性量化,比单纯喊快更可信。代价是只服务 Apple Silicon(不跨平台)、且高频迭代(v0.6.64、一天多版)说明仍在快速演进。

来源:tree(vllm_mlx/evals/reports/tests/harness)+ pyproject + README Features

项目知识图谱

知识图谱:项目核心节点(中心)+ 核心功能(内环六边形)+ 关键技术依赖(外环 chip) mlx ≥0.29 + mlx-lm ≥0.31(ArraysCache 原生批处理)— Apple Silicon 推理mlx ≥0.29 + m… transformers ≥5.0 — 模型支持transformers… fastapi — OpenAI 兼容 API 服务fastapi mlx-vlm([vision] extras)— 多模态mlx-vlm([visi… 17 tool parsers + prompt cache + DFlash 投机解码 + cloud routing17 tool parser… MLX 推理,Apple Silicon 上比 Ollama 快 2-4xMLX 推理,Apple Sil… drop-in OpenAI API + 广泛兼容drop-in OpenAI API… 100% tool calling + 17 个 tool parser100% tool calling +… reasoning separation + prompt cachereasoning separatio… smart cloud routing + DFlash 投机解码 + 多模态smart cloud routing… 丰富模型阵容 + 按内存推荐 + MHI 评测丰富模型阵容 + 按内存… Rapid-MLX 项目本体 核心功能 关键依赖

中心为项目本体,内环 = 核心功能模块,外环 = 关键技术依赖;按 deep.json 中的 core_features 与 tech_stack.key_deps 自动生成

技术栈

语言Python 3.10+框架MLX(Apple ML 框架)+ mlx-lm + FastAPI(OpenAI 兼容服务);核心 vllm_mlx(vLLM 风格 MLX 服务)
mlx ≥0.29 + mlx-lm ≥0.31(ArraysCache…transformers ≥5.0fastapimlx-vlm([vision] extras)— 多模态17 tool parsers + prompt cache + DFl…
仅 Apple Silicon(M1-M4);安装 Homebrew(raullenchai/rapid-mlx)/ pip(rapid-mlx,文本 ~460MB,vision +322MB)/ 一行脚本(自动装 Python);rapid-mlx serve <model> 起 localhost:8000;Apache-2.0;v0.6.x 一天多版高频迭代;mise + pre-commit 工程链
来源:pyproject.toml + README Quick Start + tree

快速上手

# 安装(仅 Apple Silicon) brew install raullenchai/rapid-mlx/rapid-mlx # 推荐,无 Python 版本问题 # 或 pip(需 Python 3.10+;macOS 自带 3.9 要先装新版) pip install rapid-mlx # 或一行脚本(自动装 Python) curl -fsSL https://raullenchai.github.io/Rapid-MLX/install.sh | bash # 多模态:pip install 'rapid-mlx[vision]' # 起一个 OpenAI 兼容服务 rapid-mlx serve qwen3.5-4b # 按内存挑模型(16GB→96GB+ 见 README) # 服务在 http://localhost:8000,把任何 app 的 base URL 指向 http://localhost:8000/v1 即用 # 接 Claude Code / Cursor / Aider:base URL 改成 http://localhost:8000/v1 # vision:rapid-mlx serve gemma-4-26b(需 [vision] extras) # 模型推荐与 copy-paste 命令见 README Choose Your Model;评测见 MHI / Benchmarks
来源:README Quick Start / Choose Your Model 原文

使用场景

1. Mac 上给 coding agent 喂本地模型:把 Claude Code/Cursor/Aider 的 base URL 指向 Rapid-MLX,本地跑模型、无云费用、tool calling 可靠;2. 追求 Apple Silicon 最快本地推理:受够 Ollama 的速度,用 MLX 后端拿 2-4x 提速和 0.08s 缓存 TTFT;3. tool calling 重度场景:17 个 parser + 100% tool calling 对依赖函数调用的 agent 友好;4. 长上下文/重复请求:用 prompt cache 缓存前缀大幅降 TTFT;5. 本地+云混合:smart cloud routing 本地搞不定时路由到云;6. 多模态:用 vision extras 跑 Gemma 4/Qwen-VL 做图像理解;7. 选型评估:用 MHI 看各模型在各 agent harness 上的真实表现再决定用哪个模型。

来源:README Works With / Features / MHI

优势与局限

优势

  • 押注 MLX 吃透 Apple Silicon:基于 Apple 官方 MLX 做推理,比 Ollama/llama.cpp 快 2-4x、缓存 TTFT 0.08s,是 Mac 本地推理的速度优势方
  • tool calling 做得透:100% tool calling + 17 个 parser 适配不同模型格式,正中 Cursor/Claude Code 等 coding agent 的刚需,比很多本地引擎可靠
  • drop-in 兼容、接入零成本:OpenAI 兼容 API,任何接 ChatGPT 的 app 改 base URL 即用,MHI 测过 Claude Code/Cursor/Aider 等多个 harness
  • 针对 agent 场景的优化齐全:prompt cache(降 TTFT)、reasoning separation(拆思考/回答)、smart cloud routing(本地+云)、DFlash 投机解码、多模态
  • 评测体系扎实:Model-Harness Index(MHI)+ 大量 evals/reports/tests 量化模型×harness 兼容性和性能,比空喊「最快」可信;安装多渠道、按内存推荐模型

局限

  • 只服务 Apple Silicon:MLX 是 Apple 专属,Rapid-MLX 不跨平台(无 Linux/Windows/CUDA),受众限于 Mac 用户,与跨平台的 Ollama/llama.cpp 定位不同
  • 稳定性 / 高频迭代:v0.6.x 且一天多版(v0.6.62-64 同日),说明仍在快速演进,API/行为可能变,生产用需锁版本
  • 性能声明依赖条件:「2-4x 快」「0.08s TTFT」取决于具体芯片、模型、量化、是否缓存命中,对你的机器和模型需自测;benchmark 是其自有数据
  • 依赖上游 MLX 生态:mlx/mlx-lm/transformers 版本耦合紧(README 注明 mlx-lm 0.31+、transformers 5.0 的兼容要求),上游变更可能影响;模型支持范围受 mlx-lm 支持的模型限制
  • 可维护性 / 单作者:raullenchai 主导,734 文件含大量 evals/reports,长期维护与社区贡献能力待观察;多模型 × 多 harness 的 MHI 维护面大
  • 本地推理固有约束:受 Mac 内存限制能跑的模型大小有上限(README 按 16-96GB 推荐),大模型需高配 Mac;cloud routing 缓解但要配云 provider 和承担其成本
来源:综合 README + pyproject + tree + MLX 平台特性

最新版本

v0.6.64(2026-05-21),同日还有 v0.6.62/63,发版极频繁(一天多个)。仓库 2026-02-25 创建,pyproject 版本 0.6.64,仍处 0.6.x 早期但迭代非常活跃。基于 mlx-lm 0.31+ 与 transformers 5.0。

来源:GitHub Releases API(v0.6.62-64)+ pyproject version

总结评价

如果你用 Mac(Apple Silicon)想给 Claude Code/Cursor/Aider 喂本地模型、又嫌 Ollama 慢,Rapid-MLX 是当前最对路的选择:MLX 后端比 Ollama 快 2-4x、100% tool calling + 17 parser、drop-in OpenAI API 改 base URL 即用,还有 prompt cache / reasoning separation / cloud routing。务实建议:1) brew 安装最省心(避开 Python 版本问题),rapid-mlx serve <model> 起服务后把 agent 的 base URL 指 localhost:8000/v1;2) 按你的 Mac 内存挑模型(README 有 16-96GB 推荐表),大模型要高配;3) 「2-4x 快/0.08s TTFT」是其自有 benchmark,对你的芯片和模型自测一遍;4) 它只服务 Apple Silicon,要跨平台请用 Ollama/llama.cpp;5) v0.6.x 一天多版、依赖 MLX 生态版本紧耦合,生产锁版本、留意 mlx-lm/transformers 兼容;6) tool calling 是它强项,依赖函数调用的 agent 优先试它;想看模型在你用的 harness 上表现,查 MHI。

来源:综合分析

常见问题

Rapid-MLX 是什么?

Rapid-MLX 是基于 Apple MLX 的本地 AI 推理引擎,号称 Apple Silicon(M1-M4)上最快——比 Ollama/llama.cpp 快 2-4x、缓存命中 TTFT 低至 0.08s;提供 drop-in 的 OpenAI 兼容 API(localhost:8000/v1),任何接 ChatGPT 的 app(Cursor、Claude Code、Aider、LangChain…

Rapid-MLX 有哪些核心功能?

Rapid-MLX 的核心功能包括:MLX 推理,Apple Silicon 上比 Ollama 快 2-4x、drop-in OpenAI API + 广泛兼容、100% tool calling + 17 个 tool parser、reasoning separation + prompt cache、smart cloud routing + DFlash 投机解码 + 多模态。

Rapid-MLX 为什么最近很受关注?

Mac 用户本地跑 LLM 主流是 Ollama/llama.cpp,但它们没有充分吃透 Apple Silicon。Rapid-MLX 基于 Apple 官方 MLX 框架做推理,在 M 系芯片上比 Ollama 快 2-4x、缓存 TTFT 0.08s,且把 coding agent 最看重的能力做透——100% tool calling + 17 个 tool parser(适配各模型的工具调用格式)、reasoning…

Rapid-MLX 适合哪些使用场景?

1. Mac 上给 coding agent 喂本地模型:把 Claude Code/Cursor/Aider 的 base URL 指向 Rapid-MLX,本地跑模型、无云费用、tool calling 可靠;2. 追求 Apple Silicon 最快本地推理:受够 Ollama 的速度,用 MLX 后端拿 2-4x 提速和 0.08s 缓存 TTFT;3.

透明度声明
本页内容由 AI(大语言模型)基于以下公开材料自动生成:GitHub README、代码目录结构、依赖文件、Release 信息。 分析时间: 2026-05-22 11:29. 质量评分: 100/100.

数据来源:README、GitHub API、依赖文件