Laguna-S-2.1-MLX-2bit

MLX (Apple Silicon) conversion of poolside/Laguna-S-2.1, quantized with a mixed-precision 2-bit recipe: the routed experts (~96% of the weights) are 2-bit, while attention, token embedding, LM head, and the shared expert are 4-bit and the router gate is 8-bit (affine group quant, group size 64). Pure 2-bit is incoherent on real tasks; this recipe restores quality at almost no size cost since the experts dominate.

Code / loader: github.com/PipeNetwork/laguna-mlx

Laguna-S 2.1 is Poolside's 118B-total / ~8B-active sparse-MoE model (256 routed experts, top-10, + 1 shared expert), built for agentic coding and long-horizon work with a 1M-token context. It interleaves full-attention and sliding-window (512) layers, uses softplus per-head attention gating, per-head Q/K RMSNorm, and a sigmoid router with an aux-loss-free correction bias.

Quantizations

Variant Size Notes
8bit 116 GB near-lossless
6bit 89 GB high quality
4bit 62 GB balanced default
3bit 48 GB smallest footprint
2bit 35 GB mixed-precision, smallest
bf16 219 GB full precision

⚠️ Loading requires the bundled laguna.py loader

The laguna architecture is not in stock mlx-lm, so this repo bundles the numerically-validated MLX implementation as laguna.py. Register it once, then use mlx-lm normally:

pip install mlx mlx-lm
python - <<'PY'
import os, shutil, mlx_lm
from huggingface_hub import hf_hub_download
dst = os.path.join(os.path.dirname(mlx_lm.__file__), "models", "laguna.py")
shutil.copy(hf_hub_download("pipenetwork/Laguna-S-2.1-MLX-2bit", "laguna.py"), dst)
print("registered laguna ->", dst)
PY
mlx_lm.generate --model pipenetwork/Laguna-S-2.1-MLX-2bit \
    --prompt "Write a Rust function that reverses a linked list." --max-tokens 256

Needs an Apple-Silicon Mac with enough unified memory to hold the weights (≈ the size above).

Notes

  • Mixed precision: routed experts at 2-bit; attention, token embedding, LM head, and shared expert at 4-bit; MoE router gate at 8-bit. RMSNorms and the aux-loss-free correction bias stay full precision.
  • Sliding-window layers use a rotating KV cache (bounded at 512), so long-context decode stays memory-bounded.
  • Dual RoPE is reproduced exactly: full-attention layers use partial-rotary (0.5) YaRN (theta 5e5, factor 128, mscale 1.4852); sliding layers use plain RoPE (theta 1e4, full rotary).

License: OpenMDW-1.1 (inherits the base model).

Downloads last month
-
Safetensors
Model size
118B params
Tensor type
BF16
·
U32
·
MLX
Hardware compatibility
Log In to add your hardware

2-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for pipenetwork/Laguna-S-2.1-MLX-2bit

Quantized
(43)
this model