LFM2-8B-A1B β€” MLX 3-bit (Apple Silicon)

Maintainer / Publisher: Susant Achary
Upstream model: LiquidAI/LFM2-8B-A1B
This repo (MLX 3-bit): mlx-community/LFM2-8B-A1B-3bit-MLX

This repository provides an Apple-Silicon-optimized MLX build of LFM2-8B-A1B at 3-bit quantization.
3-bit is an excellent size↔quality sweet spot on many Macsβ€”very small memory footprint with surprisingly solid answer quality and snappy decoding.


πŸ”Ž What is LFM2-8B-A1B?

  • Architecture: Mixture-of-Experts (MoE) Transformer.
  • Size: ~8B total parameters with ~1B active per token (the β€œA1B” naming commonly indicates ~1B active params).
  • Why MoE? Per token, only a subset of experts is activated β†’ lower compute per token while retaining a larger parameter pool for expressivity.

Memory reality on a single device: Even though ~1B parameters are active at a time, all experts typically reside in memory in single-device runs. Plan RAM based on total parameters, not just the active slice.


πŸ“¦ What’s in this MLX build

  • config.json (MLX), mlx_model*.safetensors (3-bit shards)
  • Tokenizer: tokenizer.json, tokenizer_config.json
  • Metadata: model_index.json (and/or processor metadata as applicable)

Target: macOS on Apple Silicon (M-series) using Metal/MPS.


βœ… Intended use

  • General instruction following, chat, and summarization
  • RAG back-ends and long-context assistants on device
  • Schema-guided structured outputs (JSON) where low RAM is a priority

⚠️ Limitations

  • 3-bit is lossy: tiny improvements in latency/RAM come with some accuracy trade-off vs 6/8-bit.
  • For very long contexts and/or batching, KV-cache can dominate memoryβ€”tune max_tokens and batch size.
  • Add your own guardrails/safety for production deployments.

πŸ”’ RAM planning (3-bit, MoE, MLX)

You asked to assume and decide realistic ranges. The numbers below are practical starting pointsβ€”verify on your machine.

Rule-of-thumb components

  • Weights (3-bit): β‰ˆ total_params Γ— 0.375 byte β†’ for 8B params β‰ˆ ~3.0 GB
  • Runtime overhead: MLX graph/tensors/metadata β†’ ~0.6–1.0 GB
  • KV-cache: grows with context Γ— layers Γ— heads Γ— dtype β†’ ~0.8–2.5+ GB

Indicative peak RAM (batch=1)

Context window Estimated peak RAM
4k tokens ~4.4–5.5 GB
8k tokens ~5.2–6.6 GB
16k tokens ~6.5–8.8 GB

For ≀2k windows you may see ~4.0–4.8 GB. Larger windows/batches increase KV-cache and peak RAM.


🧭 Precision choices for LFM2-8B-A1B (lineup planning)

While this card is 3-bit, teams often publish multiple precisions. Use this table as a planning guide (8B MoE LM; actuals depend on context/batch/prompts):

Variant Typical Peak RAM Relative Speed Typical Behavior When to choose
3-bit (this repo) ~4.4–8.8 GB πŸ”₯πŸ”₯πŸ”₯πŸ”₯ Direct, concise, great latency Default on 8–16 GB Macs
6-bit ~7.5–12.5 GB πŸ”₯πŸ”₯ Best quality under quant Choose if RAM allows
8-bit ~9.5–12+ GB πŸ”₯πŸ”₯ Largest quantized size / highest fidelity When you prefer simpler 8-bit workflows

MoE caveat: MoE lowers compute per token; unless experts are paged/partitioned, memory still scales with total parameters on a single device.


πŸš€ Quickstart (CLI β€” MLX)

Deterministic generation

python -m mlx_lm.generate \
  --model mlx-community/LFM2-8B-A1B-3bit-MLX \
  --prompt "Summarize the following in 5 concise bullet points:\n<your text>" \
  --max-tokens 256 \
  --temperature 0.0 \
  --device mps \
  --seed 0
Downloads last month
98
Safetensors
Model size
8B params
Tensor type
U32
Β·
F32
Β·
MLX
Hardware compatibility
Log In to add your hardware

3-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for mlx-community/LFM2-8B-A1B-3bit-MLX

Quantized
(36)
this model

Collection including mlx-community/LFM2-8B-A1B-3bit-MLX