Loading...
Loading...
Compare original and translation side by side
mlx-lmmlx-lmundefinedundefined
Verify which backend is bound before debugging: both can serve OpenAI-
compatible endpoints on user-chosen ports, and a client request hitting the
wrong backend silently produces correct-looking but unrelated output.
---
在调试前,先确认实际绑定的是哪个后端:两者都可以在用户指定的端口提供兼容 OpenAI 的 endpoint,而客户端请求如果命中错误的后端,会静默返回看似合理却与目标无关的输出。
---| Concern | mlx-lm | oMLX |
|---|---|---|
| Install | | DMG (macOS app bundle) |
| Process model | One model per | Built-in registry; multi-model |
| Config surface | Minimal CLI flags | Rich per-model JSON ( |
| Feature flags | | turboquant_kv, dflash, MTP, specprefill, thinking budget |
| Tool calling | Format depends on chat template | Per-model parser (configurable) |
| Models > RAM | Not supported (OOM on load) | OptiQ proxy build (sensitivity-driven quant) |
| GUI | None | Native macOS app + menu bar |
| Default port | 8080 | 8000 |
| Best for | Library-first scripts, embedding in Python | Long-running daemon, multiple models, GUI ops |
Skill bias: the depth here leans oMLX — feature flags, cache controls, upstream bug patterns. mlx-lm coverage is lighter and focuses on the shared substrate.
| 关注点 | mlx-lm | oMLX |
|---|---|---|
| 安装方式 | | DMG(macOS app bundle) |
| 进程模型 | 每个 | 内置 registry;支持多模型 |
| 配置范围 | 精简的 CLI flags | 丰富的 per-model JSON( |
| 功能开关 | | turboquant_kv、dflash、MTP、specprefill、thinking budget |
| 工具调用 | 格式取决于 chat template | per-model parser(可配置) |
| 模型占用超过 RAM | 不支持(加载时 OOM) | OptiQ proxy build(基于敏感度进行量化) |
| GUI | 无 | 原生 macOS app + 菜单栏 |
| 默认端口 | 8080 | 8000 |
| 最适合 | 以库优先的脚本、嵌入 Python | 长时间运行的 daemon、多模型、GUI 运维 |
Skill 偏好: 本文更深入地偏向 oMLX——功能开关、缓存控制、上游 bug 模式。对 mlx-lm 的覆盖较轻,主要聚焦于两者共享的基础层。
| Symptom | Likely cause | First move |
|---|---|---|
| OOM during model load | Model + KV scratch > available RAM | Smaller quant; OptiQ proxy (oMLX); free other apps |
| OOM during long-context inference | KV cache growth | Enable |
| Crash / hang at batch > 1 | Architecture cache shape mismatch | Pin |
| Tool calls return as plaintext content | Parser doesn't recognize the model's tool-call JSON shape | See upstream-bug-patterns; check |
| Throughput regression after config change | Feature flag interaction | Bisect via bench, one flag at a time |
| Server hangs on startup | Large checkpoint loading from cold disk | Wait; tail |
| Wrong / garbled outputs | Quantization too aggressive, or wrong chat template | Reduce |
| First request slow, rest fast | Cold prefix cache | Enable |
| Output cut off mid-sentence | | Raise |
references/symptoms.md| 症状 | 可能原因 | 首要操作 |
|---|---|---|
| 模型加载时 OOM | 模型 + KV scratch 超过可用 RAM | 使用更小的量化版本;使用 OptiQ proxy(oMLX);退出其他应用以释放内存 |
| 长上下文推理期间 OOM | KV cache 增长 | 启用 |
| batch > 1 时崩溃或挂起 | 架构的缓存形状不匹配 | 将 |
| 工具调用以纯文本 content 返回 | Parser 无法识别模型的工具调用 JSON 结构 | 参见 |
| 修改配置后吞吐量回退 | 功能开关之间相互作用 | 每次只修改一个开关,通过 benchmark 进行二分排查 |
| 服务器启动时挂起 | 正在从冷磁盘加载大型 checkpoint | 等待;跟踪 |
| 输出错误或乱码 | 量化过于激进,或 chat template 错误 | 降低 |
| 第一次请求较慢,后续请求较快 | 冷 prefix cache | 启用 |
| 输出在句子中间被截断 | | 提高 |
references/symptoms.md--max-concurrent-requests--max-concurrent-requests 8dflashturboquant_kvreferences/bench-methodology.mdturboquant_kv_bits=4.0references/upstream-bug-patterns.md--max-concurrent-requests--max-concurrent-requests 8dflashturboquant_kvreferences/bench-methodology.mdturboquant_kv_bits=4.0references/upstream-bug-patterns.mdreferences/symptoms.mdreferences/omlx-feature-flags.mdreferences/bench-methodology.mdreferences/upstream-bug-patterns.mdreferences/symptoms.mdreferences/omlx-feature-flags.mdreferences/bench-methodology.mdreferences/upstream-bug-patterns.md