Instructions to use Dzluck/Grug-12B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dzluck/Grug-12B-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Dzluck/Grug-12B-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Dzluck/Grug-12B-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Dzluck/Grug-12B-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 Dzluck/Grug-12B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Dzluck/Grug-12B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Dzluck/Grug-12B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Dzluck/Grug-12B-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 Dzluck/Grug-12B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Dzluck/Grug-12B-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 Dzluck/Grug-12B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Dzluck/Grug-12B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/Dzluck/Grug-12B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Dzluck/Grug-12B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Dzluck/Grug-12B-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": "Dzluck/Grug-12B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Dzluck/Grug-12B-GGUF:Q4_K_M
- SGLang
How to use Dzluck/Grug-12B-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 "Dzluck/Grug-12B-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": "Dzluck/Grug-12B-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 "Dzluck/Grug-12B-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": "Dzluck/Grug-12B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Dzluck/Grug-12B-GGUF with Ollama:
ollama run hf.co/Dzluck/Grug-12B-GGUF:Q4_K_M
- Unsloth Studio
How to use Dzluck/Grug-12B-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 Dzluck/Grug-12B-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 Dzluck/Grug-12B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Dzluck/Grug-12B-GGUF to start chatting
- Pi
How to use Dzluck/Grug-12B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Dzluck/Grug-12B-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": "Dzluck/Grug-12B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Dzluck/Grug-12B-GGUF with Docker Model Runner:
docker model run hf.co/Dzluck/Grug-12B-GGUF:Q4_K_M
- Lemonade
How to use Dzluck/Grug-12B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Dzluck/Grug-12B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Grug-12B-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Dzluck/Grug-12B-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 Dzluck/Grug-12B-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 Dzluck/Grug-12B-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Dzluck/Grug-12B-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Dzluck/Grug-12B-GGUF: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 "Dzluck/Grug-12B-GGUF: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"
This is quantized version of kai-os/Grug-12B created using llama.cpp
Grug 12B is a compact-reasoning fine-tune of google/gemma-4-12B-it.
It was trained to keep the useful information from a reasoning trace while
making the trace shorter, denser, and less verbose.
This repository is published as merged Transformers/safetensors model weights. It was trained with QLoRA, then merged into the base model for release.
What Changed
The training target is a terse internal-reasoning style: short high-density steps, fewer filler words, and explicit preservation of key constraints, branching decisions, invariants, edge cases, and final-answer checks.
The goal is lower reasoning-token usage relative to the base model while preserving answer quality. It is not meant to hide uncertainty or remove needed reasoning.
Training Data
The data pipeline started from a recent, filtered reasoning pool and converted verbose traces into compact traces before SFT packing.
Source gate:
- Run date: June 30, 2026.
- Default freshness cutoff: 45 days. Sources older than May 16, 2026 were rejected unless manually allowed.
- Allowed train licenses: MIT, Apache-2.0, CC-BY-4.0, CC0-1.0.
- Hard reject terms included OpenAI, ChatGPT, GPT-5, Claude, Anthropic, Opus, Sonnet, and Gemini.
- Soft-risk sources marked as synthetic/distill were manually reviewed or rejected depending on provenance and license.
Final verified source mix:
| Source | License | Domain | Verified rows |
|---|---|---|---|
hotdogs/uka-glm-5.2 |
MIT | agent code | 1,617 |
Scale-or-Reason/general-reasoning-ift-pairs |
MIT | general reasoning | 1,305 |
samcheng0/lumia-reasoning-sft-v1 |
Apache-2.0 | code reasoning | 1,103 |
HSH-Intelligence/verified-math-reasoning-3k |
Apache-2.0 | math | 672 |
kd13/CodeDebug-Instruct-v2-Reasoning |
MIT | code debug | 600 |
Madarabr/cortex-adaptive-thinking |
Apache-2.0 | adaptive reasoning | 300 |
CL-From-Nothing/code_rose_initial_1_7B_SFT_10K_rollouts_Qwen3-4B-Thinking-2507_k12_t0.7_maxtok12288 |
Apache-2.0 | code reasoning | 143 |
Row counts:
- Normalized recent reasoning pool: 8,680 rows.
- Selected verbose reasoning set: 6,144 rows.
- Compact raw transform output: 6,144 rows.
- Verified compact rows: 5,740 rows.
- Rejected compact rows: 404 rows.
- Packed SFT split: 5,166 train / 287 validation / 287 test.
The compact reasoning transform was generated with
cyankiwi/Qwen3.6-35B-A3B-AWQ-4bit served by vLLM. Rows were checked for
compression ratio, answer preservation, and obvious loss of critical reasoning
information before training.
Training Procedure
Training was completion-only SFT: prompt tokens were masked with -100, and
only the assistant completion was trained.
Core settings:
- Base model:
google/gemma-4-12B-it. - Method: QLoRA / PEFT LoRA, merged into full model weights for upload.
- Quantization during training: 4-bit NF4 with BF16 compute.
- Max sequence length: 6,144.
- LoRA rank: 16.
- LoRA alpha: 32.
- LoRA dropout: 0.05.
- Target modules:
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj. - Batch size: 1.
- Gradient accumulation: 16.
- Learning rate: 8e-5.
- Max steps: 100.
- Eval steps: 50.
- Save steps: 50.
- Train runtime: about 35 minutes 20 seconds on one A100.
- Final eval loss: 0.8895.
No train or validation rows were skipped in the final run.
Local Evaluation
Small local EOS-only math proxy eval, no generation token cap:
| Model | Rows | Total generated tokens | Avg generated tokens | Proxy accuracy | Numeric last-match rate |
|---|---|---|---|---|---|
google/gemma-4-12B-it base |
36 | 8,227 | 228.53 | 91.7% | 86.1% |
| Grug 12B | 36 | 2,482 | 68.94 | 100.0% | 100.0% |
This is a small proxy eval, not a broad benchmark. Treat it as a smoke test showing the intended token-efficiency direction, then run your own benchmark.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "kai-os/Grug-12B"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
model.eval()
messages = [
{"role": "user", "content": "If a shirt is $80 and goes 25% off, what is the sale price?"}
]
inputs = tokenizer.apply_chat_template(
messages,
return_tensors="pt",
add_generation_prompt=True,
).to(model.device)
with torch.no_grad():
output = model.generate(inputs, do_sample=False, max_new_tokens=512)
print(tokenizer.decode(output[0], skip_special_tokens=True))
For token-efficiency tests, compare against the base model with the same prompt, same decoding settings, and no artificial token cap unless your deployment requires one.
Limitations
- This is an experimental fine-tune.
- It may over-compress reasoning on tasks that need longer derivations.
- It inherits the base model's limitations and safety behavior.
- The reported eval is small and local.
- The dataset includes synthetic and distilled reasoning traces from the listed open datasets; review source licenses and provenance before using this in commercial or sensitive settings.
Acknowledgements
Thanks to Lambda, the inference provider, for compute credits that supported the dataset work, training, and evaluation.
- Downloads last month
- 228
4-bit
5-bit
6-bit
8-bit
16-bit
Model tree for Dzluck/Grug-12B-GGUF
Datasets used to train Dzluck/Grug-12B-GGUF
hotdogs/uka-glm-5.2
samcheng0/lumia-reasoning-sft-v1
Evaluation results
- Grug-12B proxy accuracy on Local 36-row math reasoning evalself-reported1.000
- Grug-12B total generated tokens on Local 36-row math reasoning evalself-reported2482.000
- Grug-12B average generated tokens on Local 36-row math reasoning evalself-reported68.944
