Downloads · 30 days
96
5% of all-time downloads
kai-os/Grug-12B
Grug-12B is a text generation model from kai-os. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
Downloads · 30 days
96
5% of all-time downloads
All-time downloads
2K
Public
Parameters
12B
24.2 GB on disk
Likes
68
Public
Click a slice to open those files.
.safetensors23.9 GB · 100%
From the Hugging Face model README

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.
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.
The data pipeline started from a recent, filtered reasoning pool and converted verbose traces into compact traces before SFT packing.
Source gate:
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:
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 was completion-only SFT: prompt tokens were masked with -100, and
only the assistant completion was trained.
Core settings:
google/gemma-4-12B-it.q_proj, k_proj, v_proj, o_proj, gate_proj,
up_proj, down_proj.No train or validation rows were skipped in the final run.
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.
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.
Thanks to Lambda, the inference provider, for compute credits that supported the dataset work, training, and evaluation.