Views
No views yet
mlx-community/LFM2-8B-A1B-8bit-MLXImportant memory note (single-device inference):
Although compute per token benefits from MoE (fewer active parameters), the full set of experts still resides in memory for typical single-GPU/CPU deployments. In practice this means RAM usage scales with total parameters, not with the smaller active count.
config.json (MLX), mlx_model*.safetensors (8-bit shards)tokenizer.json, tokenizer_config.jsonmodel_index.json)max_tokens or large batch sizes.~ total_params × 1 byte (8-bit). For 8B params → ~8.0 GB baseline.| Context window | Estimated peak RAM |
|---|---|
| 4k tokens | ~9.5–10.5 GB |
| 8k tokens | ~10.5–11.8 GB |
| 16k tokens | ~12.0–14.0 GB |
These ranges assume 8-bit weights, A1B MoE (all experts resident), batch size = 1, and standard generation settings.
On lower windows (≤2k), you may see ~9–10 GB. Larger windows or batches will increase KV-cache and peak RAM.
| Variant | Typical Peak RAM | Relative Speed | Typical Behavior | When to choose |
|---|---|---|---|---|
| 4-bit | ~7–8 GB | 🔥🔥🔥 | Better detail retention | If 3-bit drops too much fidelity |
| 6-bit | ~9–10.5 GB | 🔥🔥 | Near-max MLX quality | If you want accuracy under quant |
| 8-bit (this repo) | ~9.5–12+ GB | 🔥🔥 | Highest quality among quant tiers | When RAM allows and you want the most faithful outputs |
MoE caveat: MoE reduces compute per token, but unless experts are paged/partitioned across devices and loaded on demand, memory still follows total parameters. On a single Mac, plan RAM as if the whole 8B parameter set is resident.
1python -m mlx_lm.generate \
2 --model mlx-community/LFM2-8B-A1B-8bit-MLX \
3 --prompt "Summarize the following in 5 bullet points:\n<your text>" \
4 --max-tokens 256 \
5 --temperature 0.0 \
6 --device mps \
7 --seed 0