Native Apple Silicon (Metal) support — scripts/mac-run.sh + docs/MAC.md - #2
Conversation
…s/MAC.md Additive Mac path alongside the existing NVIDIA/Docker deployment; no application code changes (the model is decoupled behind LLAMA_URL). scripts/mac-run.sh launches the Homebrew llama.cpp (Metal) server + the FastAPI app, honouring the existing MODEL_FILE/CTX_SIZE/SPEC_ARGS/CHAT_TEMPLATE_FILE knobs with Mac defaults (flash-attn on, -ngl 999, SPEC_ARGS empty since current Homebrew builds lack draft-mtp). docs/MAC.md explains the non-MTP GGUF requirement and the flag differences; README gains a short Apple Silicon section; .env.example gains a Mac note. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…9430) MTP draft-mtp is now supported by Homebrew llama.cpp build 9430. The MTP GGUF loads cleanly (the blk.40 failure was a build-8890 issue). Benchmarked 37.5 vs 30.5 tok/s (~1.23x) at 72% draft acceptance on M3 Pro. - mac-run.sh: SPEC_ARGS now defaults to --spec-type draft-mtp --spec-draft-n-max 2 - docs/MAC.md: MTP GGUF is the recommended download; non-MTP noted as fallback - README: updated Apple Silicon section with MTP instructions - .env.example: updated Mac note for MTP Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
|
Thanks for the detailed feedback! I dug into all three claims on an M3 Pro / 36 GB. Summary: the speed claims hold up, but the "MLX hangs at >86K" blocker is wrong, it's a memory ceiling, not a kernel hang, and it's removable. The 86K "hang" is a fp16-KV memory OOM. At default fp16 KV, MLX OOMs between ~78K and ~92K actual tokens on 36 GB, a genuine Your speed numbers check out. Prefill ~533 t/s vs llama.cpp ~90 → ~5.9x (matches your ~5x). Decode ~39.5 t/s, at or above llama.cpp's MTP ~37.5. Prefill is the metric the dataroom's compaction loop is bound by, so this is the win that matters. MTP via MTPLX works once tooling matches the model contract. My first attempt was garbage purely due to a version mismatch (mtplx 0.3.7 vs a Correctness held up (it's a factual dataroom, so I gated on this): greedy parity 9/10 vs llama.cpp (sole diff a synonym), and Shipped as opt-in: #4. A |

Summary
Adds a native Apple Silicon (Mac, Metal) run path alongside the existing NVIDIA/Docker deployment. The model is served by Homebrew's
llama.cpp(Metal); the FastAPI app, Pi agent, and v5-nano embedder run in a localuvvirtualenv.Purely additive — zero application-code changes (4 files, +230/-0). The original Docker/NVIDIA flow and README are untouched. This works because the model is already decoupled behind the OpenAI-compatible
LLAMA_URL, so the only Mac-specific concerns are which GGUF to use, thellama-serverflags, and installing the deps the Docker image normally bundles.What's included
scripts/mac-run.sh— launchesllama-server(Metal) +server.app, honouring the existingMODEL_FILE/CTX_SIZE/SPEC_ARGS/CHAT_TEMPLATE_FILEknobs with Mac defaults.docs/MAC.md— full setup guide plus a "what changed vs NVIDIA/Docker" table.README.md— a short "Run on Apple Silicon" section (NVIDIA path unchanged)..env.example— a brief Mac note.Mac-specific choices (with rationale)
unsloth/Qwen3.6-35B-A3B-GGUF): the...-MTP-GGUFvariant ships an extra speculative-draft head (blk.40) that current Homebrewllama.cpploads as a normal layer, failing withmissing tensor 'blk.40.ssm_conv1d.weight'.SPEC_ARGSempty (no--spec-type draft-mtp): current Homebrew builds'--spec-typeonly hasngram-*. Left as an opt-in env var so it re-enables automatically once a Metal build supports it.--flash-attn on(build wantson|off|auto, not1) and-ngl 999(unified memory: all layers on Metal).server/requirements.txt, which assumed the CUDA base image); embedder kept on CPU to leave Metal memory for the LLM.Tested
M3 Pro / 36 GB, macOS,
llama.cppbuild 8890. Model loads in ~30s; an end-to-end job (Jina search/read, dataroom build, zip output, live dashboard) verified. ~22-25 GB wired;CTX_SIZE=65536fits comfortably.