Repository navigation
Learning notes: LFM2.5-24B-A2B on an M1 Max 32 GB (MLX 6-bit, 128K, ~69 tok/s) #5
jellydn
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Learning notes from running Liquid AI's LFM2.5-24B-A2B on a 32 GB MacBook Pro (M1 Max, 32-core GPU), tuning it with the inference-optimisation skill, and adding a second lab-passed proof to the Local AI registry: sybil-solutions/local-ai-registry#475. This is the third model in the series, after Inkling 2 Mini (#3) and Qwen3.8-27B (#4). It ran on the same Mac with the same
bench.pysettings and the same quality prompts.TL;DR
How the model works
Quant, engine, and why that build
LiquidAI/LFM2.5-24B-A2B-MLX-6bit@1deec53e, 19.5 GB, affine 6-bit with group size 64 = 6.5 bits per weight). The 8-bit export (~25 GB) would leave no room for a KV cache inside the 25 GiB Metal budget.mlx-lm 0.32.2onmlx 0.32.4, run through the registry's small launcher (mlx-lm-lfm2.5-serve.py). The launcher adds a token-count route and lists only the served model, and it applies the model's own sampling defaults (temperature 0.1, top-k 50, repetition penalty 1.05).How to run it on an M1 Max 32 GB
Why the defaults fail
mlx_lm.servercaps answers at 512 tokens by default, which cuts off a thinking model mid-thought. Hence--max-tokens 131072.mlx_lm.serverlists every MLX model in your HF cache on/v1/models, and a client that picks the first entry makes it load a different model. The launcher lists only the served one.Performance (M1 Max, 32-core GPU, macOS 26.6.2, AC power)
Decode runs at 40% of the bandwidth ceiling, and prefill at ~51% MFU.
24-core vs 32-core: the same launch on two GPUs
Decode depends on memory bandwidth, which is the same on both machines, so it moves little. Prefill depends on compute and scales with the number of GPU cores.
What the optimisation skill tried
Every candidate ran between controls, median of 6. The controls stayed within 1%.
--prefill-step-size 4096--prefill-step-size 1024/512--kv-bits 8The pinned launch was already at the plateau.
Quality: the same 6 prompts for Inkling 2 Mini and LFM2.5
Practical prompts with answers that a script can check: two coding tasks run against hidden tests (interval merging, and fixing a buggy
lower_bound), a SQL query run in SQLite, a counting problem, a scheduling puzzle with one unique answer, and a Python mutable-default trace. Each model used its recommended sampling and was asked once.2 3 3 3These prompts are too easy to separate the two models, but the style differs. Inkling gives short, direct answers. LFM thinks 2.8× longer, yet it still finishes 16% sooner because it decodes ~3.4× faster.
The three models on this Mac
Lessons
Evidence and the hill-climb log:
data/sources/apple-m1-max-32gb/lfm2.5-24b-a2b-32core/in #475.All reactions