How to use from
llama.cpp
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf Myric/Laguna-S-2.1-APEX-GGUF:Q8_0
# Run inference directly in the terminal:
llama cli -hf Myric/Laguna-S-2.1-APEX-GGUF:Q8_0
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf Myric/Laguna-S-2.1-APEX-GGUF:Q8_0
# Run inference directly in the terminal:
llama cli -hf Myric/Laguna-S-2.1-APEX-GGUF:Q8_0
Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases
# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf Myric/Laguna-S-2.1-APEX-GGUF:Q8_0
# Run inference directly in the terminal:
./llama-cli -hf Myric/Laguna-S-2.1-APEX-GGUF:Q8_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf Myric/Laguna-S-2.1-APEX-GGUF:Q8_0
# Run inference directly in the terminal:
./build/bin/llama-cli -hf Myric/Laguna-S-2.1-APEX-GGUF:Q8_0
Use Docker
docker model run hf.co/Myric/Laguna-S-2.1-APEX-GGUF:Q8_0
Quick Links

Laguna-S-2.1 β€” APEX GGUF (with DFlash speculative decoding)

MoE-aware, mixed-precision APEX quantization of poolside/Laguna-S-2.1 β€” a 118B-total / ~8B-active open-weight agentic coding MoE (48 layers, 256 routed + 1 shared expert, top-10 routing, GQA with per-head softplus output gating, mixed sliding-window/global attention, 1M context).

APEX assigns quantization precision per tensor role and per layer instead of uniformly β€” keeping always-active shared experts and edge layers high-precision while compressing the sparse routed-expert middle layers hard. On a 256-expert MoE this is a large win: near-full-precision quality at a fraction of the size, and small enough to actually run this model locally.

Paired here with the DFlash speculative-decoding draft model for fast generation.

Disclaimer. Unofficial community quantization β€” not affiliated with or endorsed by Poolside or unsloth. Provided as-is, without warranty; validate before relying on it. Quality figures below are measured post-hoc (see Results). The i-mini (IQ2_S, 2-bit) tier is experimental and expected to degrade noticeably vs the larger tiers β€” treat it as a size/speed experiment, not a quality target. DFlash speculative decoding requires Poolside's llama.cpp fork (see Usage).

Results

Perplexity measured on wikitext-2-raw (test, 200 Γ— 512-token windows) with llama-perplexity. Pending β€” to be measured on-device; numbers below are filled in after the run.

File Size PPL Ξ” vs BF16
BF16 (reference baseline) 235 GB TBD β€”
APEX-i-quality 73.9 GB (5.03 BPW) TBD TBD
APEX-i-compact 54.4 GB (3.70 BPW) TBD TBD
APEX-i-mini (experimental) 43.6 GB (2.97 BPW) TBD TBD
DFlash draft (BF16) 2.2 GB β€” (speculative-decoding drafter)
DFlash draft (Q8_0) 1.13 GB β€” (drafter; same acceptance as BF16)
DFlash draft (Q4_K_M) 652 MB β€” (drafter, recommended; same acceptance as BF16)

DFlash speculative decoding β€” measured

Draft-quantization sweep on a DGX Spark (GB10, 128 GB unified memory) with Poolside's llama.cpp fork. Target = APEX-i-quality; single 512-token completion, temperature=0, --spec-draft-n-max 15, flash-attention on. Acceptance = draft_n_accepted / draft_n from server timings (deterministic at temperature=0); decode throughput is the reported predicted_per_second.

Draft (vs APEX-i-quality) Draft size Acceptance Decode tok/s Speedup
none (no speculation) β€” β€” 27.4 1.00Γ—
DFlash BF16 2.2 GB 27.5 % 31.1 1.13Γ—
DFlash Q8_0 1.13 GB 27.8 % 31.1 1.13Γ—
DFlash Q4_K_M (recommended) 652 MB 27.8 % 32.9 1.20Γ—

Quantizing the DFlash draft is essentially free: Q4_K_M matches BF16 acceptance at under a third of the size (and is marginally faster to run). These numbers are from a generic prompt; on the coding / agentic workloads Laguna is built for, DFlash acceptance and speedup are substantially higher β€” Poolside reports 2.5–3.7Γ— on HumanEval / MBPP / GSM8K (see the DFlash draft card).

Same sweep against the much coarser APEX-i-mini target (same hardware/settings):

Draft (vs APEX-i-mini) Draft size Acceptance Decode tok/s Speedup
none (no speculation) β€” β€” 35.2 1.00Γ—
DFlash BF16 2.2 GB 23.4 % 34.7 0.99Γ—
DFlash Q8_0 1.13 GB 23.4 % 36.7 1.04Γ—
DFlash Q4_K_M (recommended) 652 MB 24.2 % 38.5 1.09Γ—

Two effects show up on the smaller tier: acceptance is lower (23–24 % vs 27–28 %) β€” the more aggressively quantized target's output distribution diverges further from the draft's β€” and because i-mini already decodes fast, the speculation overhead barely pays for itself. The light Q4 draft is the only clearly net-positive one here (the BF16 draft's overhead makes it a wash), so Q4 is the right draft on every tier. As above, on real coding/agentic workloads the wins are larger than these generic-prompt figures.

Recommended serve command (Poolside fork, branch laguna):

./build/bin/llama-server \
  -m Laguna-S-2.1-APEX-i-quality.gguf \
  -md laguna-s-2.1-DFlash-Q4_K.gguf \
  --spec-type draft-dflash --spec-draft-n-max 15 \
  -fa on --jinja -ngl 999 -c 32768 \
  --host 0.0.0.0 --port 8000

Which file to pick

  • APEX-i-quality (73.9 GB) β€” recommended. Highest quality. Routed experts: edge layers (L0–4, L43–47) Q6_K, near-edge (L5–9, L38–42) Q5_K, middle (L10–37) IQ4_XS; shared expert Q8_0; attention Q6_K; dense layer 0 Q8_0. Diverse ("I") imatrix. Overall ~4.9 bpw. Fits the DGX Spark's 128 GB with room for the draft + KV cache.
  • APEX-i-compact (54.4 GB) β€” smaller and faster to decode (fewer bytes/token on bandwidth-bound generation) at some quality cost. Routed experts Q4_K/Q3_K, shared Q6_K, attention Q4_K. Good speed/quality compromise.
  • APEX-i-mini (43.6 GB, experimental) β€” smallest/fastest. Middle routed experts at IQ2_S (2-bit), near/edge Q3_K, shared Q4_K/Q5_K. Expect a real quality drop; a size/speed experiment, not a quality target.
  • laguna-s-2.1-DFlash-BF16.gguf (2.2 GB) β€” the DFlash speculative-decoding draft model (kept BF16 for best token-acceptance; not APEX-quantized). Used as the -md draft with any tier above. Ships from poolside/Laguna-S-2.1-GGUF.

Usage (llama.cpp)

⚠️ Always pass -c/--ctx-size explicitly. Laguna was trained with up to a 1,048,576-token (1M) context window. If you launch llama-server/llama-cli without -c, llama.cpp defaults the KV cache to the model's own trained context length β€” an attempt to allocate a KV cache sized for a million tokens, which can consume very large amounts of memory and stall or crash a machine with limited RAM/VRAM. Every example below sets -c 32768 deliberately; do the same and size it to your own hardware.

DFlash speculative decoding requires Poolside's llama.cpp fork (branch laguna) β€” it carries the --spec-type draft-dflash path. (Upstream llama.cpp has the laguna architecture and will run the APEX quant without speculative decoding, but not the DFlash draft path.)

# Build Poolside's fork (add -DGGML_CUDA=ON on the Spark / any NVIDIA box)
git clone --branch laguna https://github.com/poolsideai/llama.cpp
cd llama.cpp && cmake -B build -DGGML_CUDA=ON && cmake --build build -j

# Recommended: serve with DFlash speculative decoding (fastest)
./build/bin/llama-server \
  -m Laguna-S-2.1-APEX-i-quality.gguf \
  -md laguna-s-2.1-DFlash-BF16.gguf \
  --spec-type draft-dflash --spec-draft-n-max 15 \
  -fa on --jinja \
  -ngl 999 -c 32768 \
  --host 0.0.0.0 --port 8000

Recommended-settings notes:

  • -md laguna-s-2.1-DFlash-BF16.gguf + --spec-type draft-dflash β€” the DFlash draft embeds the target tokenizer and DFlash metadata and works directly as the draft model. This is the whole point of the pairing: big speedup on the coding / agentic workloads Laguna is built for.
  • --spec-draft-n-max 15 β€” clamped to the trained draft block size (15 draft tokens + 1). Leaving it higher has no effect.
  • -fa on β€” flash attention; recommended for Laguna's mixed SWA/global attention.
  • --jinja β€” use the model's chat template (native interleaved reasoning + tool calling). Required for correct agentic/tool behavior.
  • -ngl 999 β€” offload all layers. On the DGX Spark (GB10, 128 GB unified) the 73.9 GB i-quality quant + 2.2 GB draft + KV cache fit comfortably in unified memory (i-compact/i-mini leave even more headroom for context).
  • -c 32768 β€” context. Laguna supports up to 1M; size it to your memory budget (32k is a sane coding default; raise as headroom allows).

Without speculative decoding (any recent upstream llama.cpp with laguna support):

llama-server -m Laguna-S-2.1-APEX-i-quality.gguf -fa on --jinja -ngl 999 \
  -c 32768 --host 0.0.0.0 --port 8000

Method & notes

APEX is a bit-allocation recipe over stock llama-quantize --tensor-type-file (no kernel/format changes). Laguna-specific observations for this run:

  • No config patching needed. Laguna's routed-expert intermediate size is 1024 (256-divisible), so K-quants (Q6_K/Q5_K/IQ4_XS) apply directly to ffn_down_exps β€” unlike Moonlight (dim 1408), no IQ4_NL fallback is required.
  • Layer 0 is dense (mlp_only_layers=[0]) β€” kept at Q8_0 (generated with --dense-layers 1).
  • MTP drafter is a separate file. Laguna's multi-token-prediction speculator (DFlash) ships as its own GGUF, not embedded in the main model, so the APEX tensor-map covers the entire main model with nothing left unassigned.
  • Attention uses standard attn_q/k/v/output names (GQA, 48 q / 8 kv heads); the per-head softplus output gate, if present as a tensor, is covered at Q6_K.

Baseline: quantized from unsloth/Laguna-S-2.1-GGUF's BF16 conversion. The importance matrix is unsloth's β€” imatrix_unsloth.gguf_file, reused as-is rather than regenerated (thanks to the unsloth team for publishing it). It is bundled here for reproducibility.

Reproduce

# 1. Configs (48 layers, dense L0). Bundled as configs/laguna_s_*.txt
bash generate_config.sh --profile i-quality --layers 48 --dense-layers 1 -o laguna_s_i-quality.txt
bash generate_config.sh --profile i-compact --layers 48 --dense-layers 1 -o laguna_s_i-compact.txt
bash generate_config.sh --profile mini      --layers 48 --dense-layers 1 -o laguna_s_i-mini.txt

# 2. Quantize from the BF16 split (base type Q6_K catches token_embd/output;
#    llama-quantize auto-follows the 5-shard split from shard 1)
for tier in i-quality i-compact i-mini; do
  llama-quantize --tensor-type-file laguna_s_${tier}.txt \
    --imatrix imatrix_unsloth.gguf_file \
    Laguna-S-2.1-BF16-00001-of-00005.gguf \
    Laguna-S-2.1-APEX-${tier}.gguf Q6_K
done

Attribution & licenses

  • Base model + DFlash draft: Poolside (@poolside) β€” Laguna-S-2.1 and the laguna-s-2.1-DFlash-BF16.gguf draft (OpenMDW-1.1).
  • BF16 GGUF conversion and importance matrix: unsloth (@unsloth) β€” Laguna-S-2.1-GGUF (OpenMDW-1.1). This quant is built on unsloth's BF16 conversion and reuses unsloth's imatrix_unsloth.gguf_file β€” full credit to the unsloth team.
  • Quantization engine: llama.cpp by the ggml authors (@ggml-org) (MIT); DFlash speculative decoding via poolsideai/llama.cpp branch laguna.
  • APEX recipe & toolkit: Ettore Di Giacinto / LocalAI (@mudler) β€” localai-org/apex-quant (MIT).

License compatibility

Fully compatible. OpenMDW-1.1 (Poolside's base weights and unsloth's conversion/imatrix) is a permissive, MIT-like model license β€” it grants use, modification, and redistribution without restriction and imposes no copyleft. Its one substantive condition is license preservation: any redistribution of the model materials must carry (1) a copy of the OpenMDW-1.1 agreement and (2) all original copyright and origin notices. The tooling (APEX toolkit, llama.cpp) is MIT, which stacks with OpenMDW without conflict.

Accordingly this derivative is released under OpenMDW-1.1 (inherited from the base), and this repo ships the OpenMDW-1.1 license text plus the Poolside and unsloth origin/copyright notices (see LICENSE and NOTICE), alongside the MIT notices for the APEX toolkit and llama.cpp. The reused imatrix is bundled under the same terms.

This is an unofficial community quantization and is not affiliated with or endorsed by Poolside or unsloth.

Downloads last month
27,637
GGUF
Model size
118B params
Architecture
laguna
Hardware compatibility
Log In to add your hardware

8-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for Myric/Laguna-S-2.1-APEX-GGUF

Quantized
(78)
this model