Text Generation
Transformers
Safetensors
English
gemma4
image-text-to-text
gemma
mixture-of-experts
pruned
reap
fp8
vllm
conversational
compressed-tensors
Run this model with HF Jobs
Run KC-Informatics/Rook-26B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/KC-Informatics/Rook-26B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/KC-Informatics/Rook-26B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/KC-Informatics/Rook-26B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use KC-Informatics/Rook-26B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KC-Informatics/Rook-26B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KC-Informatics/Rook-26B") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("KC-Informatics/Rook-26B") model = AutoModelForMultimodalLM.from_pretrained("KC-Informatics/Rook-26B", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KC-Informatics/Rook-26B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KC-Informatics/Rook-26B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KC-Informatics/Rook-26B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/KC-Informatics/Rook-26B
- SGLang
How to use KC-Informatics/Rook-26B 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 "KC-Informatics/Rook-26B" \ --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": "KC-Informatics/Rook-26B", "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 "KC-Informatics/Rook-26B" \ --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": "KC-Informatics/Rook-26B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use KC-Informatics/Rook-26B with Docker Model Runner:
docker model run hf.co/KC-Informatics/Rook-26B
Add README.md for Rook-26B release
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566---
license: gemma
base_model:
- RedHatAI/gemma-4-26B-A4B-it-FP8-dynamic
- google/gemma-4-26B-A4B-it
tags:
- gemma
- gemma4
- mixture-of-experts
- pruned
- reap
- fp8
- vllm
language:
- en
pipeline_tag: text-generation
library_name: transformers
---

# Rook-26B
Gemma 4 26B-A4B (FP8 dynamic) pruned with **REAP-15** (Router-weighted Expert Activation Pruning, arXiv:2510.13999): the **20 lowest-saliency experts removed from every MoE layer (128 to 108 experts)** with **zero retraining**, cutting **3.6 GB** off disk and VRAM while preserving strong instruction following (**93.3% IFEval**) and full compatibility with `z-lab/gemma-4-26B-A4B-it-DFlash`.
## What was changed
Gemma 4 26B-A4B has 30 Mixture-of-Experts layers with 128 routed experts per layer (8 active per token).
- We measured each expert's REAP saliency score (router weight multiplied by expert output norm) across 16 diverse calibration prompts.
- In every layer, the 20 lowest-saliency experts were surgically removed and `num_experts` updated to `108`.
- Attention, embeddings, shared layers, and vision weights are completely untouched. Zero fine-tuning or gradient steps were required.
## Verified results (`AA-PUBLIC-180`, strictly `N=1`, deterministic grading)
| Metric | Gemma 4 26B FP8 (Base) | Community 4-bit Heretic AWQ | **Rook-26B (REAP-15 FP8)** |
|---|---:|---:|---:|
| Specialists per layer | 128 | 128 | **108** (-15.6%) |
| Download / weight size | 28.6 GB | ~17 GB | **25.1 GB** (**-3.6 GB** vs FP8) |
| 180-question public suite (`N=1`) | - | 99 / 180 (53.33%) | **127 / 180 (66.87%)** |
| IFEval (30 instruction-following tests) | - | - | **93.3%** |
*Paired comparison against the community 4-bit Heretic AWQ build: Rook-26B got 39 questions right that the 4-bit build missed vs 11 the other way (p < 0.0001). Includes `nudge.py` for single-pass forced closure on long reasoning chains.*
## What it is not
- **Not uncensored.** Rook keeps Gemma 4's original refusal behavior.
- **Built for VRAM savings, not speed.** Active experts per token remain 8, so decode speed stays similar while weight memory drops by 3.6 GB.
## How to run it
```bash
# 1. Serve Rook-26B with DFlash speculative decoding (vLLM 0.34+)
vllm serve KC-Informatics/Rook-26B --port 8000 \
--trust-remote-code --gpu-memory-utilization 0.90 \
--reasoning-parser gemma4 --enable-auto-tool-choice --tool-call-parser gemma4 \
--speculative-config '{"model": "z-lab/gemma-4-26B-A4B-it-DFlash", "method": "dflash", "num_speculative_tokens": 8}'
# 2. Optional forced-closure proxy (included in repo)
huggingface-cli download KC-Informatics/Rook-26B nudge.py --local-dir .
python nudge.py --upstream http://127.0.0.1:8000 --port 8001
```
## Licence and credit
Gemma Terms of Use, matching `google/gemma-4-26B-A4B-it` by Google. Starting FP8 checkpoint by Red Hat AI; DFlash draft model by z-lab. `nudge.py` is Apache 2.0 by KC Informatics.README.mdAdded+66