Repository navigation
Add optional Apple Silicon MLX encoder and Metal heads - #9
austindixson wants to merge 5 commits into
Conversation
Serve Qwen3 last-token embeddings via mlx-lm and run the released projection heads on Metal, so CLM can run on Mac without vLLM/CUDA.
|
Thanks for this, it made running CLM on a laptop practical. I tested it at 7bc936a on a MacBook Air M5 with 32 GB: 1. Long states lose their end (
|
…ds and vLLM truncate_prompt_tokens Co-authored-by: Austin Dixson <austindixson@users.noreply.github.com>
Co-authored-by: Austin Dixson <austindixson@users.noreply.github.com>
…pressure_level Co-authored-by: Austin Dixson <austindixson@users.noreply.github.com>
…-counting inactive Co-authored-by: Austin Dixson <austindixson@users.noreply.github.com>
|
Thanks @widike — all three items from your review are addressed, plus a follow-up on the memory free estimate. Tip is now
Follow-up (double-count): an earlier tip summed free + speculative + purgeable + inactive. On macOS purgeable pages already sit on the active/inactive queues, so that overstated reclaimable free (~1.1–1.3 GiB on a live Mac) and loosened the jetsam guard. In Live Mac check (Apple Silicon, tip Appreciate the careful review. |
Summary
Adds an opt-in Apple Silicon serving path using MLX:
clm-embed-mlxserves Qwen3 last-token embeddings (defaultmlx-community/Qwen3-8B-4bit) over the same/v1/embeddingsAPI CLM already usesclm-serve --device mlxruns the released projection head on Metal.[mlx]extra,scripts/setup_mlx.sh, andserve_mlx.shfor one-command Mac setupLinux / CUDA / vLLM defaults are unchanged. On Darwin,
vllmis skipped via a platform marker (same idea as #7).Relation to other Mac work
mlxdevice.Test plan
bash scripts/setup_mlx.sh && bash serve_mlx.shPOST /v1/system_onewith a typed Choice/Noul question returns a sensible distributionclm-serve --device cpu/ CUDA path still behaves as before on Linuxpip install -e '.[mlx]'does not pull vLLM on macOS