Instructions to use google/gemma-4-26B-A4B-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google/gemma-4-26B-A4B-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="google/gemma-4-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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("google/gemma-4-26B-A4B-it") model = AutoModelForMultimodalLM.from_pretrained("google/gemma-4-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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- AMD Developer Cloud
- Local Apps Settings
- vLLM
How to use google/gemma-4-26B-A4B-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "google/gemma-4-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": "google/gemma-4-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/google/gemma-4-26B-A4B-it
- SGLang
How to use google/gemma-4-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 "google/gemma-4-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": "google/gemma-4-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 "google/gemma-4-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": "google/gemma-4-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 google/gemma-4-26B-A4B-it with Docker Model Runner:
docker model run hf.co/google/gemma-4-26B-A4B-it
GGUF available — Cerebellum v3 (11 GB, ablation-guided mixed-precision)
Ablation-guided mixed-precision GGUF quant for running this model in llama.cpp / ollama:
deucebucket/Gemma-4-26B-A4B-it-Cerebellum-v3-GGUF — 11 GB
We ran 90 individual ablation experiments to measure which tensors are sensitive vs. tolerant across this MoE architecture and assigned precision accordingly — 99 per-tensor overrides on top of Q3_K_M with bartowski's imatrix.
Benchmarks (RTX 3090):
| Benchmark | Cerebellum v3 (11 GB) | Q3_K_M (13 GB) | Q4_K_M (16 GB) |
|---|---|---|---|
| WikiText PPL | 19,826 | 42,369 | 27,362 |
| HumanEval pass@1 | 67.1% | 62.2% | 59.8% |
| ARC-Challenge | 95.5% | 95.2% | 96.7% |
| HellaSwag | 83.8% | 86.6% | 85.2% |
| MMLU-Redux | 71.3% | 73.7% | 72.7% |
53% better PPL than Q3_K_M, 28% better than Q4_K_M, at 5 GB smaller. Fits a 24 GB GPU with room for 4K context. Method details in the model card.
Thanks for bringing this to our attention!
Apologies for the late reply.
The technical details on the ablation-guided mixed-precision for Cerebellum v3 are very interesting.
It seems like the link provided for the GGUF model is currently showing a 404 error. Could you please provide an updated or corrected link so we can take a closer look at the model and method details?
Thanks for bringing this to our attention!
Apologies for the late reply.
The technical details on the ablation-guided mixed-precision for Cerebellum v3 are very interesting.
It seems like the link provided for the GGUF model is currently showing a 404 error. Could you please provide an updated or corrected link so we can take a closer look at the model and method details?
https://huggingface.co/deucebucket/Gemma-4-26B-A4B-it-Cerebellum-v6-GGUF
a couple of changes since then, but hopefully improvements.
hey, following up since you said you wanted a closer look (and my last comment got truncated mid-table, fixing that here).
current 26B builds, both 11.7 GB, measured on an RTX 3090 with llama.cpp. per-question results are in each repo's benchmark_results folder:
- Gemma-4-26B-A4B-it-Cerebellum-v6-GGUF — current file is v6.1 (same tensor allocation as v6, updated chat-template metadata)
- Gemma-4-26B-A4B-it-Heretic-Cerebellum-GGUF — same recipe on coder3101's heretic checkpoint, kept separate on purpose
measured scores:
- v6/v6.1: ARC-Challenge 95.56, HellaSwag 84.55, MMLU-Redux 71.33
- heretic: ARC-Challenge 95.48, HellaSwag 83.49, MMLU-Redux 71.42, HumanEval+ 89.63 (chat harness, thinking off)
the rest of the family is covered too: E4B v2, an E4B heretic, and E2B v2.