Instructions to use cnuland/legunas21-custom with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use cnuland/legunas21-custom with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="cnuland/legunas21-custom", filename="laguna-s-2.1-DFlash-Q4_K_M-fixed.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use cnuland/legunas21-custom with 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 cnuland/legunas21-custom:Q4_K_M # Run inference directly in the terminal: llama cli -hf cnuland/legunas21-custom:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf cnuland/legunas21-custom:Q4_K_M # Run inference directly in the terminal: llama cli -hf cnuland/legunas21-custom:Q4_K_M
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 cnuland/legunas21-custom:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf cnuland/legunas21-custom:Q4_K_M
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 cnuland/legunas21-custom:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf cnuland/legunas21-custom:Q4_K_M
Use Docker
docker model run hf.co/cnuland/legunas21-custom:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use cnuland/legunas21-custom with Ollama:
ollama run hf.co/cnuland/legunas21-custom:Q4_K_M
- Unsloth Studio
How to use cnuland/legunas21-custom with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for cnuland/legunas21-custom to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for cnuland/legunas21-custom to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for cnuland/legunas21-custom to start chatting
- Atomic Chat new
- Docker Model Runner
How to use cnuland/legunas21-custom with Docker Model Runner:
docker model run hf.co/cnuland/legunas21-custom:Q4_K_M
- Lemonade
How to use cnuland/legunas21-custom with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull cnuland/legunas21-custom:Q4_K_M
Run and chat with the model
lemonade run user.legunas21-custom-Q4_K_M
List all available models
lemonade list
Laguna-S-2.1 on AMD Strix Halo (llama.cpp + Vulkan) β deployment kit
Working configuration, tuning notes, and benchmark data for running poolside/Laguna-S-2.1 (118B MoE, ~8B active) on an AMD Strix Halo iGPU (Radeon 8060S, RDNA3.5, unified memory) under OpenShift via the llama.cpp Vulkan backend (RADV).
Final serving stack: Myric APEX i-compact
quant (54.4 GB, MoE-aware mixed precision) + metadata-fixed DFlash Q4_K_M draft,
on poolside's llama.cpp fork (branch laguna).
Hardware: 16 GiB VRAM carve-out + ~55 GiB GTT on a 114 GiB node.
Files
| File | What it is |
|---|---|
laguna-s-2.1-DFlash-Q4_K_M-fixed.gguf |
The draft to use. Q4_K_M requant of poolside's corrected BF16 DFlash β includes the dflash.attention.sliding_window=512 metadata. |
deployment.yaml |
OpenShift Deployment (llama-server, Vulkan, node-pinned) |
bench_laguna.py |
Shallow benchmark script (server-side timings) |
speculative-cmath.patch |
One-line fix to build the poolside fork with GCC 15 |
Removed: earlier revisions of this repo mirrored community Q4/Q8 DFlash conversions made from poolside's pre-fix upload. Those files are missing the sliding-window metadata and silently collapse to <1% draft acceptance beyond a few K tokens of context (8 t/s at 45K on our hardware). Check git history if you need them; you don't.
Benchmarks (2026-07-23/24, Strix Halo, 114 GiB, Vulkan/RADV)
Shallow = 512-token code gen. Deep = 45K-token prompt, 256-token continuation.
| Config | Shallow decode | Deep (45K) decode | Draft acceptance |
|---|---|---|---|
| unsloth UD-IQ4_XS (57.5 GB), no spec | 32.4 t/s | ~15 t/s | β |
| APEX i-compact + broken Q4 draft | 41.5 t/s | 8.4 t/s | 44% shallow β 0.8% deep |
| APEX i-compact + fixed Q4 draft, n=4 | 42.7 t/s | 34.6 t/s | 42% shallow β 60% deep |
Deep-context decode improved 2.3Γ over the original deployment. The DFlash speedup grows with depth: the target slows (KV reads over 45K tokens) while the SWA-corrected draft's cost stays constant (512-token window), so drafting gets relatively cheaper exactly when you need it.
Looping smoke test on APEX i-compact: 3 tool-less diagnostic prompts + 1
adversarial physics puzzle β all terminated with finish_reason=stop, no unclosed
thinking blocks. The model still overthinks hard problems (~11K reasoning tokens
on the physics puzzle) β that is a model trait at any precision; give it
max_tokens β₯ 8k and consider a "think briefly, then act" system prompt.
The DFlash draft metadata bug (why your acceptance collapses at depth)
Poolside's day-one DFlash GGUF lacked sliding-window attention metadata; they fixed
it in discussion #12
("Correct DFlash config", 2026-07-22). Community Q4/Q8 conversions made from the
pre-fix file inherit the bug: fine at shallow depth, useless past ~2-4K tokens.
Diagnose by checking your draft GGUF for dflash.attention.sliding_window = 512;
fix by requantizing the current official BF16:
llama-quantize laguna-s-2.1-DFlash-BF16.gguf laguna-s-2.1-DFlash-Q4_K_M-fixed.gguf Q4_K_M 8
(Quantization preserves metadata β or just use the fixed file from this repo.)
Serving command (poolside fork, branch laguna)
llama-server \
-m Laguna-S-2.1-APEX-i-compact.gguf \
-md laguna-s-2.1-DFlash-Q4_K_M-fixed.gguf \
--spec-type draft-dflash --spec-draft-n-max 4 \
-ctkd f16 -ctvd f16 -ngld 99 \
--temp 0.7 --top-p 0.95 \
-c 65536 -ngl 99 -fa on \
--cache-type-k q8_0 --cache-type-v q8_0 \
--jinja --parallel 1
Hard-won details
- DFlash needs poolside's llama.cpp fork (poolsideai/llama.cpp,
branch
laguna). Upstream (b10087βb10103 tested) fails on any DFlash draft withexpected 76, got 69β the draft borrowstoken_embd/output.weightfrom the target. Applyspeculative-cmath.patchfor GCC 15 / Ubuntu 26.04. - Use the SWA-fixed draft (see above) and draft KV in f16 (
-ctkd f16 -ctvd f16) β quantized draft KV also collapses acceptance. --spec-draft-n-max 4measured best on bandwidth-limited hardware (poolside's 15, and even their updated 7, were net losses here with a Q4 draft).- unsloth GGUF metadata bug (if serving unsloth quants): they ship
laguna.rope.scaling.yarn_attn_factor = 1.4852, double-applied by llama.cpp. Fix:--override-kv laguna.rope.scaling.yarn_attn_factor=float:1.0. The APEX quants don't need this. - Sampling: the model card's
--temp 0.7 --top-p 0.95(the shipped generation_config's 1.0/1.0 measurably increases fabrications). No min-p. - Flash attention ON: 2.6Γ decode / 1.7Γ prefill vs off on RDNA3.5 Vulkan. The RDNA3.5 FA crash reports were ROCm-path; Vulkan/RADV ran clean.
- Vulkan env for Strix Halo:
AMD_VULKAN_ICD=RADV,VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.json, HIP/ROCR disabled. - Quant choice on unified memory: decode speed tracks file size almost linearly (bandwidth-bound). APEX's MoE-aware layout (shared expert Q6_K, attention Q4_K, middle routed experts compressed hard) kept quality while dropping 3 GB vs UD-IQ4_XS β and cured nothing that wasn't already fine, since looping was a pre-fix-GGUF/2-bit-quant phenomenon, not a 4-bit UD one.
License
OpenMDW-1.1, inherited from Laguna S 2.1. The fixed DFlash draft is a direct Q4_K_M requantization of poolside's official DFlash BF16 GGUF (current, post-fix revision); poolside does not endorse this redistribution.
- Downloads last month
- 71
4-bit
Model tree for cnuland/legunas21-custom
Base model
poolside/Laguna-S-2.1