Text Generation
Transformers
Safetensors
gemma4_unified
image-text-to-text
fine-tuned
qlora
reasoning
compact-reasoning
gemma-4
conversational
Eval Results (legacy)
Instructions to use kai-os/Grug-12B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kai-os/Grug-12B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kai-os/Grug-12B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("kai-os/Grug-12B") model = AutoModelForMultimodalLM.from_pretrained("kai-os/Grug-12B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use kai-os/Grug-12B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kai-os/Grug-12B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kai-os/Grug-12B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kai-os/Grug-12B
- SGLang
How to use kai-os/Grug-12B 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 "kai-os/Grug-12B" \ --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": "kai-os/Grug-12B", "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 "kai-os/Grug-12B" \ --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": "kai-os/Grug-12B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use kai-os/Grug-12B with Docker Model Runner:
docker model run hf.co/kai-os/Grug-12B
Clean public metadata and model card wording
Browse files
README.md
CHANGED
|
@@ -11,7 +11,6 @@ tags:
|
|
| 11 |
- qlora
|
| 12 |
- reasoning
|
| 13 |
- compact-reasoning
|
| 14 |
-
- grugthink
|
| 15 |
- gemma-4
|
| 16 |
datasets:
|
| 17 |
- hotdogs/uka-glm-5.2
|
|
@@ -48,17 +47,11 @@ model-index:
|
|
| 48 |
|
| 49 |
Grug 12B is a compact-reasoning fine-tune of `google/gemma-4-12B-it`.
|
| 50 |
It was trained to keep the useful information from a reasoning trace while
|
| 51 |
-
making the trace shorter,
|
| 52 |
|
| 53 |
This repository is published as merged Transformers/safetensors model weights.
|
| 54 |
It was trained with QLoRA, then merged into the base model for release.
|
| 55 |
|
| 56 |
-
|
| 57 |
-
## GGUF
|
| 58 |
-
|
| 59 |
-
A llama.cpp `Q4_K_M` GGUF release is available in the adjacent repo:
|
| 60 |
-
[`kai-os/Grug-12B-GGUF`](https://huggingface.co/kai-os/Grug-12B-GGUF).
|
| 61 |
-
|
| 62 |
## What Changed
|
| 63 |
|
| 64 |
The training target is a terse internal-reasoning style: short high-density
|
|
@@ -69,6 +62,22 @@ The goal is lower reasoning-token usage relative to the base model while
|
|
| 69 |
preserving answer quality. It is not meant to hide uncertainty or remove needed
|
| 70 |
reasoning.
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
Final verified source mix:
|
| 73 |
|
| 74 |
| Source | License | Domain | Verified rows |
|
|
|
|
| 11 |
- qlora
|
| 12 |
- reasoning
|
| 13 |
- compact-reasoning
|
|
|
|
| 14 |
- gemma-4
|
| 15 |
datasets:
|
| 16 |
- hotdogs/uka-glm-5.2
|
|
|
|
| 47 |
|
| 48 |
Grug 12B is a compact-reasoning fine-tune of `google/gemma-4-12B-it`.
|
| 49 |
It was trained to keep the useful information from a reasoning trace while
|
| 50 |
+
making the trace shorter, denser, and less verbose.
|
| 51 |
|
| 52 |
This repository is published as merged Transformers/safetensors model weights.
|
| 53 |
It was trained with QLoRA, then merged into the base model for release.
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
## What Changed
|
| 56 |
|
| 57 |
The training target is a terse internal-reasoning style: short high-density
|
|
|
|
| 62 |
preserving answer quality. It is not meant to hide uncertainty or remove needed
|
| 63 |
reasoning.
|
| 64 |
|
| 65 |
+
## Training Data
|
| 66 |
+
|
| 67 |
+
The data pipeline started from a recent, filtered reasoning pool and converted
|
| 68 |
+
verbose traces into compact traces before SFT packing.
|
| 69 |
+
|
| 70 |
+
Source gate:
|
| 71 |
+
|
| 72 |
+
- Run date: June 30, 2026.
|
| 73 |
+
- Default freshness cutoff: 45 days. Sources older than May 16, 2026 were
|
| 74 |
+
rejected unless manually allowed.
|
| 75 |
+
- Allowed train licenses: MIT, Apache-2.0, CC-BY-4.0, CC0-1.0.
|
| 76 |
+
- Hard reject terms included OpenAI, ChatGPT, GPT-5, Claude, Anthropic, Opus,
|
| 77 |
+
Sonnet, and Gemini.
|
| 78 |
+
- Soft-risk sources marked as synthetic/distill were manually reviewed or
|
| 79 |
+
rejected depending on provenance and license.
|
| 80 |
+
|
| 81 |
Final verified source mix:
|
| 82 |
|
| 83 |
| Source | License | Domain | Verified rows |
|