Instructions to use unsloth/Laguna-S-2.1-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/Laguna-S-2.1-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/Laguna-S-2.1-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("unsloth/Laguna-S-2.1-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use unsloth/Laguna-S-2.1-GGUF 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 unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M # Run inference directly in the terminal: llama cli -hf unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M # Run inference directly in the terminal: llama cli -hf unsloth/Laguna-S-2.1-GGUF:UD-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 unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf unsloth/Laguna-S-2.1-GGUF:UD-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 unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M
Use Docker
docker model run hf.co/unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M
- LM Studio
- Jan
- vLLM
How to use unsloth/Laguna-S-2.1-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/Laguna-S-2.1-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/Laguna-S-2.1-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M
- SGLang
How to use unsloth/Laguna-S-2.1-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "unsloth/Laguna-S-2.1-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/Laguna-S-2.1-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "unsloth/Laguna-S-2.1-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/Laguna-S-2.1-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use unsloth/Laguna-S-2.1-GGUF with Ollama:
ollama run hf.co/unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M
- Unsloth Desktop
- Pi
How to use unsloth/Laguna-S-2.1-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use unsloth/Laguna-S-2.1-GGUF with Docker Model Runner:
docker model run hf.co/unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M
- Lemonade
How to use unsloth/Laguna-S-2.1-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M
Run and chat with the model
lemonade run user.Laguna-S-2.1-GGUF-UD-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use unsloth/Laguna-S-2.1-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/Laguna-S-2.1-GGUF:UD-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 unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use unsloth/Laguna-S-2.1-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M
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 "unsloth/Laguna-S-2.1-GGUF:UD-Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Add UD-Q4_K_XL run instructions (build llama.cpp from PR #25165)
Browse files
README.md
CHANGED
|
@@ -156,6 +156,53 @@ cd llama.cpp && cmake -B build && cmake --build build -j
|
|
| 156 |
--spec-type draft-dflash --spec-draft-n-max 15 -fa on --jinja --port 8000
|
| 157 |
```
|
| 158 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 159 |
## Controlling reasoning
|
| 160 |
|
| 161 |
Laguna S 2.1 has native reasoning support and works best with *preserved thinking*:
|
|
|
|
| 156 |
--spec-type draft-dflash --spec-draft-n-max 15 -fa on --jinja --port 8000
|
| 157 |
```
|
| 158 |
|
| 159 |
+
### Running Unsloth's `UD-Q4_K_XL` with llama.cpp (PR #25165)
|
| 160 |
+
|
| 161 |
+
The GGUFs in this repo are Unsloth [Dynamic 2.0](https://docs.unsloth.ai/basics/unsloth-dynamic-2.0-ggufs)
|
| 162 |
+
quants (imatrix calibrated). Laguna support is not in a tagged llama.cpp release
|
| 163 |
+
yet, so build llama.cpp from
|
| 164 |
+
[ggml-org/llama.cpp#25165](https://github.com/ggml-org/llama.cpp/pull/25165):
|
| 165 |
+
|
| 166 |
+
```shell
|
| 167 |
+
git clone https://github.com/ggml-org/llama.cpp
|
| 168 |
+
cd llama.cpp
|
| 169 |
+
gh pr checkout 25165
|
| 170 |
+
# build with CUDA (drop -DGGML_CUDA=ON for a CPU-only build)
|
| 171 |
+
cmake -B build -DGGML_CUDA=ON
|
| 172 |
+
cmake --build build -j --config Release --target llama-cli llama-server
|
| 173 |
+
cd ..
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
Download the `UD-Q4_K_XL` shards (~40GB, split into 3 files):
|
| 177 |
+
|
| 178 |
+
```shell
|
| 179 |
+
huggingface-cli download unsloth/Laguna-S-2.1-GGUF \
|
| 180 |
+
--include "UD-Q4_K_XL/*" \
|
| 181 |
+
--local-dir Laguna-S-2.1-GGUF
|
| 182 |
+
```
|
| 183 |
+
|
| 184 |
+
Serve it with `llama-server` (pass the first shard; the remaining shards load
|
| 185 |
+
automatically):
|
| 186 |
+
|
| 187 |
+
```shell
|
| 188 |
+
./llama.cpp/build/bin/llama-server \
|
| 189 |
+
--model Laguna-S-2.1-GGUF/UD-Q4_K_XL/Laguna-S-2.1-UD-Q4_K_XL-00001-of-00003.gguf \
|
| 190 |
+
--jinja -fa on -ngl 99 --ctx-size 16384 --port 8000
|
| 191 |
+
```
|
| 192 |
+
|
| 193 |
+
Or run a one-off generation with `llama-cli`:
|
| 194 |
+
|
| 195 |
+
```shell
|
| 196 |
+
./llama.cpp/build/bin/llama-cli \
|
| 197 |
+
--model Laguna-S-2.1-GGUF/UD-Q4_K_XL/Laguna-S-2.1-UD-Q4_K_XL-00001-of-00003.gguf \
|
| 198 |
+
--jinja -ngl 99 -p "Write a Flappy Bird game in Python."
|
| 199 |
+
```
|
| 200 |
+
|
| 201 |
+
> [!NOTE]
|
| 202 |
+
> `-ngl 99` offloads all layers to GPU; lower it (or drop it) if you run out of
|
| 203 |
+
> VRAM. `UD-Q4_K_XL` is roughly 40GB, so it fits on a single 48GB+ GPU or splits
|
| 204 |
+
> across several GPUs.
|
| 205 |
+
|
| 206 |
## Controlling reasoning
|
| 207 |
|
| 208 |
Laguna S 2.1 has native reasoning support and works best with *preserved thinking*:
|