Downloads · 30 days
21
3% of all-time downloads
sahilchachra/lfm2-5-8b-a1b-optiq-5bpw-mlx
lfm2-5-8b-a1b-optiq-5bpw-mlx is a machine learning model from sahilchachra. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for mlx. The card lists the license as apache-2.0.
MLX quantization of LiquidAI/LFM2.5-8B-A1B for Apple Silicon.
Downloads · 30 days
21
3% of all-time downloads
All-time downloads
672
Public
Parameters
8.5B
8.9 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors8.9 GB · 100%
How the weights are stored.
U328.5B · 100%
From the Hugging Face model README
MLX quantization of LiquidAI/LFM2.5-8B-A1B for Apple Silicon.
Variant: OptiQ mixed-precision (target 5.0 bpw)
Disk size: 8469 MB
Quantized by: sahilchachra
Unlike uniform 4-bit quantization (which forces every layer onto the same bit grid and often collapses reasoning at low bit widths), this model was quantized with mlx-optiq using per-layer KL-sensitivity analysis:
lm_head, and a few middle blocks) get more bits; layers that tolerate aggressive quantization get fewer.optiq_mixed_precision (mlx-optiq)uniform_4bitNote on architecture: this base model mixes attention/MLP blocks with convolutional / state-space blocks. OptiQ's per-layer sweep only ranks the attention + feed-forward weights — the conv blocks stay at their original precision. The achieved bits/weight above is the average over the quantized components; the on-disk model size is correspondingly larger than a fully-quantized model at the same target bpw would be.
82 quantizable components total. OptiQ allocated bits non-uniformly based on KL sensitivity:
| Bits | Components | Share |
|---|---|---|
| 8-bit | 24 | 29.3% |
| 6-bit | 34 | 41.5% |
| 4-bit | 22 | 26.8% |
| 3-bit | 2 | 2.4% |
| Total | 82 | 100.0% |
Components kept at 8-bit (most sensitive to quantization):
model.layers.23.feed_forward.gatemodel.layers.22.feed_forward.gatemodel.layers.21.feed_forward.gatemodel.layers.20.feed_forward.gatemodel.layers.19.feed_forward.gatemodel.layers.18.feed_forward.gatemodel.layers.17.feed_forward.gatemodel.layers.16.feed_forward.gatemodel.layers.15.feed_forward.gatemodel.layers.14.feed_forward.gatemodel.layers.13.feed_forward.gatemodel.layers.12.feed_forward.gatemodel.layers.11.feed_forward.gatemodel.layers.10.feed_forward.gatemodel.layers.9.feed_forward.gatemodel.layers.8.feed_forward.gatemodel.layers.7.feed_forward.gatemodel.layers.6.feed_forward.gatemodel.layers.5.feed_forward.gatemodel.layers.4.feed_forward.gatemodel.layers.3.feed_forward.gatemodel.layers.2.feed_forward.gatemodel.layers.0.conv.out_projmodel.layers.0.conv.in_projNotice the pattern: the MoE feed-forward gates dominate the top tier. Gate weights pick which experts run for every token — small numerical drift here changes routing decisions and compounds through the rest of the network, so OptiQ pays the bits to keep them precise while compressing the experts themselves more aggressively.
Evaluated on Apple M5 Pro with MLX. Model loaded once; performance and quality measured in a single pass.
| This model | FP16 baseline | |
|---|---|---|
| Decode tok/s (steady-state) | 136.4 | 77.32 |
| Prefill tok/s (steady-state) | 355.98 | 227.43 |
| Decode tok/s (avg, long traces) | 132.19 | 76.34 |
| Peak memory (GB) | 9.141 | 17.142 |
| Disk size (MB) | 8469 | 16169 |
Warmed, short-prompt, chat-templated, thinking disabled. Represents steady-state decode for typical chat use; long thinking traces will be slower due to KV-cache growth.
| Benchmark | This model | FP16 baseline | n |
|---|---|---|---|
| MATH-500 (math reasoning) | 70.0% (answered 26/30) | 70.0% (answered 25/30) | 30 |
| IFEval (instruction following) | 84.1% | 79.5% | 44 |
| HumanEval (code, pass@1) | 76.7% | 73.3% | 30 |
| Level | This model | FP16 baseline |
|---|---|---|
| level 1 | 100.0% | 83.3% |
| level 2 | 83.3% | 100.0% |
| level 3 | 83.3% | 50.0% |
| level 4 | 66.7% | 66.7% |
| level 5 | 16.7% | 50.0% |
| Context length | Decode tok/s |
|---|---|
| ~128 tokens | 136.6 |
| ~256 tokens | 136.3 |
| ~512 tokens | 136.2 |
| ~1024 tokens | 135.9 |
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("sahilchachra/lfm2-5-8b-a1b-optiq-5bpw-mlx")
response = generate(model, tokenizer, prompt="Your prompt here", max_tokens=256, verbose=True)
| Model | Variant |
|---|---|
| sahilchachra/lfm2-5-8b-a1b-mxfp4-mlx | Block float MX FP4 |
| sahilchachra/lfm2-5-8b-a1b-optiq-5bpw-mlx | OptiQ mixed-precision (target 5.0 bpw) ← this model |
See LiquidAI/LFM2.5-8B-A1B for full model details and intended use.