Instructions to use linuxid10t/Laguna-XS.2-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use linuxid10t/Laguna-XS.2-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="linuxid10t/Laguna-XS.2-GGUF", filename="Laguna-XS.2-Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use linuxid10t/Laguna-XS.2-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf linuxid10t/Laguna-XS.2-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf linuxid10t/Laguna-XS.2-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf linuxid10t/Laguna-XS.2-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf linuxid10t/Laguna-XS.2-GGUF: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 linuxid10t/Laguna-XS.2-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf linuxid10t/Laguna-XS.2-GGUF: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 linuxid10t/Laguna-XS.2-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf linuxid10t/Laguna-XS.2-GGUF:Q4_K_M
Use Docker
docker model run hf.co/linuxid10t/Laguna-XS.2-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use linuxid10t/Laguna-XS.2-GGUF with Ollama:
ollama run hf.co/linuxid10t/Laguna-XS.2-GGUF:Q4_K_M
- Unsloth Studio new
How to use linuxid10t/Laguna-XS.2-GGUF 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 linuxid10t/Laguna-XS.2-GGUF 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 linuxid10t/Laguna-XS.2-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for linuxid10t/Laguna-XS.2-GGUF to start chatting
- Pi new
How to use linuxid10t/Laguna-XS.2-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf linuxid10t/Laguna-XS.2-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "linuxid10t/Laguna-XS.2-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use linuxid10t/Laguna-XS.2-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf linuxid10t/Laguna-XS.2-GGUF:Q4_K_M
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 linuxid10t/Laguna-XS.2-GGUF:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use linuxid10t/Laguna-XS.2-GGUF with Docker Model Runner:
docker model run hf.co/linuxid10t/Laguna-XS.2-GGUF:Q4_K_M
- Lemonade
How to use linuxid10t/Laguna-XS.2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull linuxid10t/Laguna-XS.2-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Laguna-XS.2-GGUF-Q4_K_M
List all available models
lemonade list
llm.create_chat_completion(
messages = "No input example has been defined for this model task."
)Laguna-XS.2 GGUF
GGUF quantizations of poolside/Laguna-XS.2.
Converted and tested with a patched fork of llama.cpp that implements LLM_ARCH_LAGUNA from scratch.
Requires the custom fork. Upstream llama.cpp does not support this architecture. Fork: https://github.com/linuxid10t/llama.cpp-add-laguna
Files
| File | Quant | Size | Notes |
|---|---|---|---|
Laguna-XS.2-f16.gguf |
f16 | ~67 GB | Full precision, reference |
Laguna-XS.2-Q4_K_M.gguf |
Q4_K_M | ~20 GB | Recommended for most users |
Usage
git clone https://github.com/linuxid10t/llama.cpp-add-laguna
cd llama.cpp-add-laguna && cmake -B build && cmake --build build -j$(nproc)
./build/bin/llama-cli \
-m Laguna-XS.2-Q4_K_M.gguf \
--ctx-size 131072 \
--temp 0 \
-p "The capital of France is"
Chat / thinking mode
# Thinking on (default) β model prefills <think> and generates a reasoning trace
./build/bin/llama-cli -m Laguna-XS.2-Q4_K_M.gguf -cnv --ctx-size 32768
# Thinking off β direct answer, no reasoning trace
./build/bin/llama-cli -m Laguna-XS.2-Q4_K_M.gguf -cnv --ctx-size 32768 --reasoning off
The chat template, thinking-mode prefix, EOT token (</assistant>, token 24), and streaming
parser are all handled automatically β no manual prompt engineering needed.
Architecture
| Property | Value |
|---|---|
| Parameters | 33B total, ~3B active per token |
| Layers | 40 (10 global + 30 SWA, 3:1 pattern) |
| Attention heads | 64 (global layers) / 48 (SWA layers) |
| KV heads | 8 (GQA) |
| Q/K norm | RMSNorm per head |
| Attention gate | Head-wise softplus gate on o_proj input, SWA layers only |
| SWA window | 512 tokens |
| Experts | 256 routed (top-8) + 1 shared |
| Dense layers | Layer 0 only |
| MoE router | Sigmoid + e_score_correction_bias (added at selection, not routing) |
| Routing scale | moe_routed_scaling_factor with weight normalization |
| Global RoPE | YaRN: base 500K, factor 32, original_max 4096, Ξ²_fast 64, Ξ²_slow 1, partial_rotary 0.5 |
| SWA RoPE | Default: base 10K, full rotary |
| Context length | 131,072 tokens |
Implementation Notes
Attention gate: SWA layers have an extra self_attn.g_proj that produces a per-head scalar.
This is applied as a softplus gate to the SDPA output before o_proj. Global layers have no gate.
Partial rotary: Global layers rotate only the first half of head dimensions (matching
partial_rotary_factor=0.5). SWA layers use full rotary. This is handled via llama.cpp's
existing n_rot_full / 2 mechanism.
Dual RoPE: Global and SWA layers use entirely different RoPE configs. The fork adds
per-layer-type YaRN siblings to llama_hparams / llama_cparams and selects at graph
build time via hparams.is_swa(il).
MoE routing: Router logits pass through sigmoid (not softmax), biased by a per-expert
e_score_correction_bias that is added only during top-k selection, not during weight
computation. Routing weights are L1-normalized before scaling by moe_routed_scaling_factor.
Thinking mode prefill: The chat template injects <think> as the generation prompt prefix
when thinking is enabled. The streaming parser is patched to treat this as a delimiter-style
boundary (not a generated token), so the <think> tag never appears in streaming output.
Stop token: </assistant> is token 24, a regular vocabulary token (not a special token).
The fork adds it to antiprompt so the stop-word erase logic strips it before output.
Tested
- Greedy decode on
"The capital of France is"β" Paris.\nThe capital of Germany is"β - 10K-token prompt (exercises SWA layers) β no corruption β
- 35K needle-in-haystack (
SWORDFISH99) β correctly retrieved (exercises global YaRN layers) β
Known Limitations
- Numerical validation against HF Transformers not yet done (requires CUDA/ROCm).
- Q4_K_M vs f16 top-1 token agreement not formally checked (f16 GGUF exceeds available RAM for full eval).
- Downloads last month
- 116
4-bit
16-bit
Model tree for linuxid10t/Laguna-XS.2-GGUF
Base model
poolside/Laguna-XS.2
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="linuxid10t/Laguna-XS.2-GGUF", filename="", )