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)# pip install -U transformers accelerate # 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=256) 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
Commit History
-
Add response_template to tokenizer_config.json (#50)
- Add response_template to tokenizer_config.json (e995bf4a66433e2e238e8d324b4f3381f2d2e832) - Update README.md (96f95c0ba6839f9c0fec351ade86e77987675095) Co-authored-by: Matthew Carrigan <Rocketknight1@users.noreply.huggingface.co>4d7ae49
-
Update README (#52)
- Update README (19abc8d8e4e3921cc6601f162b6d02208e8aeee6) - Fix audio example (88e58fb28c1195b53f555b162ec8992750054610)01e5b3e -
fix: chat template — null handling, reasoning preservation, turn-tag balance, input validation (#47)
- fix: chat template — null handling, reasoning preservation, turn-tag balance, input validation (6583d3282465ce0e2d78b94f5150c7bdd9d35034) - fix: restore model turn + thinking cue after tool responses (aab4a9eae6f41c08ee51c439470aa74be6fd81cf) - fix: emit empty thought-channel primer on historical assistant turns for APC (3856febefff13667db939ee029419572a4c124f1) - fix: prevent extra <turn|> when assistant has content + tool_calls + continuation (1f435d2471ac0802564ec2ed279db3bc2c6102d8) - fix: revert add_generation_prompt regression + preserve_thinking default (2b8275da43bdc461d296eaa4fe3048dec08e058a) - fix: render thinking channel regardless of tool_calls presence (ed8c4a5b353d4fc192cf03c5196222350a637731) - fix: update stale comment — thinking channel no longer tool-call-only (2798814f5820df30b8df05b063839354ff43c88e) - fix: remove APC primer from history, scope preserve_thinking to tool-call turns (9f0d182bb4f4d6ca488923a6a185020957721d70) - fix: remove APC primer from history, s…35b4173
-
Add Technical Report
Verified signature5305c1e
-
Update README.md
Verified signature20da991
-
Update README.md
Verified signature0643931
-
Add MMMU-Pro evaluation result (#44)
- Add MMMU-Pro evaluation result (fa9c2fe4153a53617e59fdab3a9d91f0725a46ef) Co-authored-by: Nathan Habib <SaylorTwift@users.noreply.huggingface.co>6e6f6ed
-
fix(chat_template): Emit multimodal placeholders in tool response content-parts (#38)
- fix(chat_template): Emit multimodal placeholders in tool response content-parts (c7db2e32b9cc7cc9e93b9cbd63e82b59bf0bba2b) Co-authored-by: Harshal Janjani <harshaljanjani@users.noreply.huggingface.co>b2a81a0
-
Fix lineage (#41)
- Fix lineage (2682f827946f19dcfacbb995508f883f95d212fb) Co-authored-by: Omar Sanseviero <osanseviero@users.noreply.huggingface.co>462a98a
-
fix(chat_template): update SI and tool call handling (#36)
- fix(chat_template): update SI and tool call handling (76f20cbad876e343bfe8ccd5cbee029cfc962d3f) Co-authored-by: Douglas Reid <dougreid@users.noreply.huggingface.co>4c55b52
-
Update response schema (#22)
- Update response schema (228ec8c19f9317381377f362531f92c0433c4245) Co-authored-by: Matthew Carrigan <Rocketknight1@users.noreply.huggingface.co>7d4c97e -
fix: prefix-preserving tool calls + dialog compliance (#21)
- fix: prefix-preserving tool calls + dialog compliance (a93744d63907b921f14019dc0e4af47df87f474d) Co-authored-by: Luciano Martins <lucianommartins@users.noreply.huggingface.co>1db3cff
-
Preparing for release!
Co-authored-by: Rocketknight1 <Rocketknight1@users.noreply.huggingface.co> Co-authored-by: RyanMullins <RyanMullins@users.noreply.huggingface.co> Co-authored-by: pcuenq <pcuenq@users.noreply.huggingface.co> Co-authored-by: bebechien <bebechien@users.noreply.huggingface.co> Co-authored-by: osanseviero <osanseviero@users.noreply.huggingface.co> Co-authored-by: douglas reid <douglas reid@users.noreply.huggingface.co> Co-authored-by: dougreid <dougreid@users.noreply.huggingface.co>47b6801