How to use from
Pi
Start the MLX server
# Install MLX LM:
uv tool install mlx-lm
# Start a local OpenAI-compatible server:
mlx_lm.server --model "pipenetwork/Laguna-S-2.1-MLX-bf16"
Configure the model in Pi
# Install Pi:
npm install -g @mariozechner/pi-coding-agent
# Add to ~/.pi/agent/models.json:
{
  "providers": {
    "mlx-lm": {
      "baseUrl": "http://localhost:8080/v1",
      "api": "openai-completions",
      "apiKey": "none",
      "models": [
        {
          "id": "pipenetwork/Laguna-S-2.1-MLX-bf16"
        }
      ]
    }
  }
}
Run Pi
# Start Pi in your project directory:
pi
Quick Links

Laguna-S-2.1-MLX-bf16

MLX (Apple Silicon) conversion of poolside/Laguna-S-2.1, unquantized bf16.

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-bf16", "laguna.py"), dst)
print("registered laguna ->", dst)
PY
mlx_lm.generate --model pipenetwork/Laguna-S-2.1-MLX-bf16 \
    --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

  • Quantized: attention / MLP / expert projections and the token embedding + LM head. Kept at higher precision: the MoE router gate (8-bit), RMSNorms, and the aux-loss-free correction bias.
  • 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
281
Safetensors
Model size
118B params
Tensor type
BF16
·
MLX
Hardware compatibility
Log In to add your hardware

Quantized

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-bf16

Quantized
(63)
this model