Text Generation
MLX
Safetensors
laguna
mxfp4
apple-silicon
Mixture of Experts
agentic-coding
quantized
conversational
custom_code
Instructions to use OsaurusAI/Laguna-XS.2-mxfp4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OsaurusAI/Laguna-XS.2-mxfp4 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("OsaurusAI/Laguna-XS.2-mxfp4") 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
- LM Studio
- Pi new
How to use OsaurusAI/Laguna-XS.2-mxfp4 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "OsaurusAI/Laguna-XS.2-mxfp4"
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": "OsaurusAI/Laguna-XS.2-mxfp4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use OsaurusAI/Laguna-XS.2-mxfp4 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 "OsaurusAI/Laguna-XS.2-mxfp4"
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 OsaurusAI/Laguna-XS.2-mxfp4
Run Hermes
hermes
- MLX LM
How to use OsaurusAI/Laguna-XS.2-mxfp4 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "OsaurusAI/Laguna-XS.2-mxfp4"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "OsaurusAI/Laguna-XS.2-mxfp4" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OsaurusAI/Laguna-XS.2-mxfp4", "messages": [ {"role": "user", "content": "Hello"} ] }'
OsaurusAI/Laguna-XS.2-mxfp4
Quantized poolside Laguna-XS.2 for Apple Silicon (MLX) — agentic-coding 33B-active-3B Mixture-of-Experts.
| Source | poolside/Laguna-XS.2 |
| Architecture | laguna (40 layers, 256 routed experts top-8 + 1 shared, hybrid SWA+full attention) |
| Quant format | MXFP4 (mlx 4-bit affine, group_size=32) |
| Bundle size on disk | 20.93 GB (21 safetensors shards) |
| License | Apache-2.0 (inherits from upstream) |
| Modalities | Text in / text out (no vision, no audio, no video) |
What's quantized
- All routed-expert linears (3D stacked), attention, dense layer-0 MLP, shared-expert, embed_tokens → mlx 4-bit affine (
bits=4 group_size=32) - lm_head + all RMSNorms + router gate +
e_score_correction_bias→ fp16 passthrough
Architecture notes (preserved verbatim from upstream)
- 40 layers; per-layer attention head count alternates 48 (full-attn) / 64 (SWA) with shared 8 KV heads (GQA)
- 1:3 ratio of full-attn ↔ sliding-window-attention (window = 512), explicit
layer_typeslist - Dual RoPE: full-attn = YaRN (base 500K, factor 32, original 4096, β_fast 64, β_slow 1, partial_rotary 0.5); SWA = default (base 10K, full rotary)
- 256 routed experts (top-8) + 1 shared expert; sigmoid + per-head gating (
g_proj);q_norm/k_normin attention - 131k context window
- Layer 0 dense MLP; layers 1-39 sparse MoE
Run on Apple Silicon
pip install mlx safetensors transformers
python -m jang_tools.laguna.runtime \
--src ~/.mlxstudio/models/OsaurusAI/Laguna-XS.2-mxfp4 \
--prompt "def fibonacci(n):" --max-new 64
The runtime auto-detects weight_format (mxtq / mxfp4 / bf16) and loads the matching path (jang_tools/laguna/weight_loader_bf16.py).
Build
Reproduce locally from the bf16 source:
python -m jang_tools.convert_laguna_mxfp4 \
~/.mlxstudio/models/_sources/Laguna-XS.2 \
~/.mlxstudio/models/OsaurusAI/Laguna-XS.2-mxfp4
Credits
Quantized by Jinho Jang (eric@osaurus.ai). MLX-native pipeline, runs on M-series Macs.
- Downloads last month
- 363
Model size
6B params
Tensor type
U32
·
F16 ·
Hardware compatibility
Log In to add your hardware
Quantized
Model tree for OsaurusAI/Laguna-XS.2-mxfp4
Base model
poolside/Laguna-XS.2