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.
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.
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
python
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
34model_id ="kai-os/Grug-12B"56tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)7model = AutoModelForCausalLM.from_pretrained(8 model_id,9 torch_dtype=torch.bfloat16,10 device_map="auto",11 trust_remote_code=True,12)13model.eval()1415messages =[16{"role":"user","content":"If a shirt is $80 and goes 25% off, what is the sale price?"}17]18inputs = tokenizer.apply_chat_template(19 messages,20 return_tensors="pt",21 add_generation_prompt=True,22).to(model.device)2324with torch.no_grad():25 output = model.generate(inputs, do_sample=False, max_new_tokens=512)2627print(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.