Run this model with HF Jobs
Run trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it 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/trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it. 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/trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it 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/trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it. 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 trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it") 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("trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it") model = AutoModelForMultimodalLM.from_pretrained("trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it", 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 trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it
- SGLang
How to use trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it 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 "trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it" \ --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": "trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it" \ --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": "trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it with Docker Model Runner:
docker model run hf.co/trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it
๐งฉ TranNhiem-DeepCompression-Gemma4-26B-A4B-it
The full Collaborative Deep Compression pipeline (conceptual). This release uses pruning (whole routed experts) and low-bit quantization (NVFP4); clustering is not applied (see ยง3).
Paper: Collaborative Deep Compression for Foundation Models (link coming soon) ยท Base model: Gemma-4-26B-A4B-it ยท Sibling release: TranNhiem-DeepCompression-Qwen3.6-35B-A3B
64% smaller (49 GB โ 17 GB), +29% batched throughput, 1.46ร tokens per joule โ keeps 99.8% of the original performance on average (โฅ 98.9% on each of 8 benchmarks).
โ ๏ธ Format: NVFP4 (4-bit weights and activations) on the routed experts. NVFP4 is the native 4-bit format of NVIDIA Blackwell GPUs: workstation RTX PRO 6000 Blackwell, DGX Spark (GB10) and GeForce RTX 50-series. Use vLLM โฅ 0.30.1. All numbers on this card were measured on GB200; other Blackwell GPUs should run the model, but their speed and kernel support were not tested (workstation/consumer Blackwell uses different FP4 kernels from B200/GB200). With older vLLM the experts fall back to a slower weight-only path (measured). Pre-Blackwell GPUs (Hopper, Ada, Ampere) have no FP4 tensor cores.
1. ๐ Model Introduction
This is Gemma-4-26B-A4B-it (a mixture-of-experts vision-language model) compressed with Collaborative Deep Compression (CDC): the compression stages are designed to work together, in a fixed order, and each is judged on the modalities the model serves, not on text alone.
Two stages were applied:
- Expert pruning (pillar A): each MoE layer keeps the 120 of its 128 experts that matter most for real text, image and video traffic.
- 4-bit experts (pillar C): the remaining routed experts are quantized to NVFP4 (4-bit weights and activations). Attention, the dense MLP, the router and the vision tower stay in bf16.
The result loads and serves in vLLM with native Blackwell FP4 kernels.
2. ๐ Model Summary
| Base model | Gemma-4-26B-A4B-it (Gemma4ForConditionalGeneration), image + video + text input |
| Architecture | MoE, 30 decoder layers, top-8 routing, expert intermediate size 704 |
| Experts per layer | 120 (from 128) |
| Precision | routed experts NVFP4 W4A4 (NVIDIA ModelOpt); attention, dense MLP, router, vision tower bf16 |
| Size on disk | 17 GB (bf16 base: 49 GB) |
| Weights in GPU memory | 17.3 GiB (bf16 base: 48.5 GiB) |
| Serving | vLLM โฅ 0.30.1 (native NVFP4 MoE kernel); Blackwell GPU for W4A4 (measured on GB200) |
3. ๐ฌ Deep Compression Method
| Pillar | Stage | Applied here | What it did |
|---|---|---|---|
| A | Pruning-aware compression | โ | Kept 120 / 128 experts per layer |
| B | Clustering-aware compression | โ | Not applied (see below) |
| C | Quantization-aware compression | โ | Routed experts โ NVFP4 W4A4 |
| D | Serving | โ | vLLM native NVFP4 MoE path |
Pillar A: multimodal expert pruning. Each expert is scored by how much it contributes when it is used: its router weight times the size of its output, averaged over the tokens routed to it. The scores come from 256 text conversations plus 256 image, multi-image and video conversations, because calibrating on text alone looks fine on MMLU but hides losses of 3โ5 points on image benchmarks. The 8 lowest-scoring experts per layer are removed, with no retraining. Keeping 120 is the measured knee: keeping 112 costs about 3.6 points on MMMU.
Pillar C: experts-only NVFP4. The routed experts hold almost all of the parameters, and they tolerate 4-bit weights and activations: experts-only NVFP4 matches bf16 within ยฑ0.8 points on all 8 benchmarks. Putting attention and the dense MLP into 4-bit as well costs 2โ4 points and is slower at batch, so they stay in bf16.
Why not pillar B (weight clustering) here. Clustered (codebook) weights need a lookup-table matrix kernel that vLLM does not ship, so a clustered model could not be served at speed. On these experts, clustering-aware training also did no better than simply snapping the weights to the codebook without training.
4. ๐ Evaluation Results
Accuracy (%) on the same serving stack. This model's row is the original score plus the mean paired change over 3 pruning-calibration seeds.
This model keeps 99.8% of the original model's performance on average (at least 98.9% on every benchmark) at about one third of the weight memory.
| MMLU | AI2D | ChartQA | MMBench | MMMU | MMStar | OCRBench | MVBench (video) | |
|---|---|---|---|---|---|---|---|---|
| Original bf16 model | 81.70 | 81.28 | 70.80 | 90.30 | 70.67 | 66.00 | 84.00 | 56.97 |
| This model | 80.96 | 80.86 | 70.00 | 89.48 | 71.33 | 66.24 | 84.27 | 57.10 |
| Performance retained | 99.1% | 99.5% | 98.9% | 99.1% | 100.9% | 100.4% | 100.3% | 100.2% |
Retained = this model's score รท the original's score. Values above 100% are within evaluation noise: treat them as "no measurable loss", not as an improvement.
Detailed change vs. the original, on the same serving stack (percentage points; paired item-by-item; mean ยฑ s.d. over 3 pruning-calibration seeds):
| MMLU | AI2D | ChartQA | MMBench | MMMU | MMStar | OCRBench | MVBench (video) |
|---|---|---|---|---|---|---|---|
| โ0.74 ยฑ 0.21 | โ0.42 ยฑ 0.33 | โ0.80 ยฑ 0.17 | โ0.82 ยฑ 0.09 | +0.66 ยฑ 0.70 | +0.24 ยฑ 0.40 | +0.27 ยฑ 0.31 | +0.13 ยฑ 0.62 |
- MMLU, ChartQA and MMBench cost about 0.75โ0.8 points on every seed. The other benchmarks are within noise, with the sign varying by seed.
- Re-evaluating one checkpoint moves these benchmarks by about 1 point, so differences below that are not meaningful.
5. โก Efficiency
One GB200 GPU, tensor-parallel 1, vLLM 0.30.1rc1, GPU memory utilisation 0.85. Throughput and energy are the median of 4 runs of 64 concurrent requests ร 512 generated tokens; power is the board power of the GPU used.
| bf16 base | This model | Change | |
|---|---|---|---|
| Single-stream decode (tokens/s) | 251 | 302 | +20% |
| Batched decode, 64 requests (tokens/s) | 9,771 | 12,557 | +29% |
| Inter-token latency, single stream | 3.96 ms | 3.29 ms | โ17% |
| Time to first token | 16 ms | 18 ms | โ |
| GPU power (batched) | 702 W | 617 W | โ12% |
| Energy efficiency (tokens per joule) | 13.9 | 20.4 | 1.46ร |
| Weights in GPU memory | 48.5 GiB | 17.3 GiB | โ64% |
| KV-cache capacity at the same memory budget | 484 K tokens | 629 K tokens | +30% |
| Max concurrent requests at 4 K context | 118 | 154 | +30% |
| Max concurrent requests at 32 K / 128 K context | 14.9 / 11.5 | 19.4 / 14.7 | +30% / +28% |
- Image-request batches are 11โ15% faster and video is about the same, because image and video encoding stays in bf16.
- Tensor parallelism trades energy for throughput. For the best tokens per joule, serve on one GPU.
6. ๐ Deployment
pip install "vllm>=0.30.1" # older vLLM serves the NVFP4 experts through a slower weight-only path
vllm serve trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it --max-model-len 32768
- Hardware: native 4-bit (W4A4) needs a Blackwell GPU (B200 / GB200 / B300, RTX PRO 6000 Blackwell, DGX Spark, RTX 50-series). Measured on GB200 only.
- Keep async scheduling on (the default). Turning it off costs about 40% single-stream speed on this model.
7. ๐ป Usage
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
resp = client.chat.completions.create(
model="trannhiem/TranNhiem-DeepCompression-Gemma4-26B-A4B-it",
messages=[{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": "https://example.com/chart.png"}},
{"type": "text", "text": "What trend does this chart show?"},
]}],
max_tokens=512,
)
print(resp.choices[0].message.content)
8. โ ๏ธ Limitations
- All measurements are on one GPU type (GB200). Speed and energy on other hardware will differ.
- Broader evaluation (added 2026-11-28): on a 28-benchmark profile (reasoning, knowledge, math, code, medical, documents, charts, video; paired against the bf16 base on the same items) this model scores โ0.56 pp overall with greedy decoding and โ0.15 pp with sampling (95 % CI of the sampled result includes 0); the few significant losses are small (MBPP, MMMU, MMLU-Pro, about โ2 to โ4 pp).
- Accuracy is reported on 8 benchmarks (knowledge, diagrams, charts, general and expert vision, OCR, video). The model was not re-evaluated for safety beyond the base model.
- Pruning removes 8 experts per layer permanently. Rare skills that only those experts served may degrade more than these benchmarks show.
9. ๐ License
Apache-2.0, inherited from the base model. This is a modified version of Gemma-4-26B-A4B-it: 8 routed experts per layer were removed and the remaining experts were quantized to NVFP4.
10. ๐ Citation
@article{cdc2026,
title = {Collaborative Deep Compression for Foundation Models},
author = {Tran, Van Nhiem},
year = {2026},
note = {Paper link coming soon}
}
11. ๐ฌ Contact
Trแบงn Nhiแปm ยท rick.tvn@foxconn.com WhatsApp: +886 934 311751
- Downloads last month
- 606