Instructions to use pipenetwork/Laguna-S-2.1-MLX-3bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use pipenetwork/Laguna-S-2.1-MLX-3bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("pipenetwork/Laguna-S-2.1-MLX-3bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use pipenetwork/Laguna-S-2.1-MLX-3bit with 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-3bit"
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-3bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use pipenetwork/Laguna-S-2.1-MLX-3bit with Hermes Agent:
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-3bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default pipenetwork/Laguna-S-2.1-MLX-3bit
Run Hermes
hermes
- OpenClaw new
How to use pipenetwork/Laguna-S-2.1-MLX-3bit with OpenClaw:
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-3bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "pipenetwork/Laguna-S-2.1-MLX-3bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- MLX LM
How to use pipenetwork/Laguna-S-2.1-MLX-3bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "pipenetwork/Laguna-S-2.1-MLX-3bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "pipenetwork/Laguna-S-2.1-MLX-3bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pipenetwork/Laguna-S-2.1-MLX-3bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
Laguna-S-2.1-MLX-3bit
MLX (Apple Silicon) conversion of poolside/Laguna-S-2.1, quantized to 3-bit (affine group quant, group size 64; router gate kept at 8-bit).
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-3bit", "laguna.py"), dst)
print("registered laguna ->", dst)
PY
mlx_lm.generate --model pipenetwork/Laguna-S-2.1-MLX-3bit \
--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
- -
3-bit
Model tree for pipenetwork/Laguna-S-2.1-MLX-3bit
Base model
poolside/Laguna-S-2.1