feat(mac): native Apple Silicon run (Metal) + BACKEND={llamacpp|mlx} - #15
Open
soobrosa wants to merge 2 commits into
Open
feat(mac): native Apple Silicon run (Metal) + BACKEND={llamacpp|mlx}#15soobrosa wants to merge 2 commits into
soobrosa wants to merge 2 commits into
Conversation
…{llamacpp|mlx}
Adds a Docker-free way to run the extractor on an Apple Silicon Mac: Homebrew
llama.cpp serves the model on Metal (:8080), the FastAPI app runs in a local uv
venv (:3000), and the v5-nano dedup embedder stays on CPU. A BACKEND knob can
swap llama.cpp for Apple's mlx-lm for ~6x faster prefill, with KV-bits autodetect
and context auto-cap. app.py's request model label is now MODEL_NAME-configurable
(default 'qwen3.6' unchanged) so mlx_lm.server can match the loaded model.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…stream) Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
soobrosa
marked this pull request as ready for review
June 14, 2026 16:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a Docker-free, no-NVIDIA way to run the Knowledge Graph Extractor on an Apple Silicon Mac, plus an opt-in faster MLX backend. No change to the extraction/UI/scheduler logic: the model stays decoupled behind the OpenAI-compatible
LLAMA_URL.scripts/mac-run.sh- launches Homebrewllama-server(Metal) on:8080, waits for/health, then starts the app (python app.py) on:3000. Mirrors thedocker-compose.ymlllama flags (--ctx-size,--spec-type draft-mtp,--cache-reuse) with Metal-appropriate values (--flash-attn on,-ngl 999).BACKEND={llamacpp|mlx}knob -llamacppis the default;BACKEND=mlxserves:8080withmlx_lm.serverinstead, for ~6x faster prefill (the bottleneck on large docs/zips, since each round re-reads the full document). Auto-detects--kv-bitssupport and auto-caps context to fp16-KV OOM headroom.app.py- the requestmodellabel is nowMODEL_NAME-configurable (default"qwen3.6", unchanged for the llama.cpp/CUDA path).mlx_lm.servermatches themodelfield against the loaded model, so the MLX path pins it to the model dir.docs/MAC.md- full setup (deps, model download, run, memory tiers, MLX setup + caveats)..env.example/README.md- documented the Mac knobs and linked the guide.Why
The only documented path today is a single NVIDIA L4 via Docker. This lets people run the whole thing locally on a 32 GB+ Apple Silicon Mac.
Test notes
Tested on an M3 Pro / 36 GB,
llama.cppbuild 9430 (Homebrew). Q3_K_XL wires ~17 GB;draft-mtpspeculative decoding works on build >= 9430. The CUDA/Docker path is untouched (defaultBACKEND, defaultMODEL_NAME). Opened as draft for your review of the defaults and whether the MLX backend is in scope.