Run this model with HF Jobs
Run Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix 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/Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix. 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/Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix 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/Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix. 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 Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix
- SGLang
How to use Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix 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 "Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix with Docker Model Runner:
docker model run hf.co/Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix
These weights from google/gemma-4-26B-A4B-it-qat-q4_0-unquantized are quantized for Tenstorrent Tensix NPUs, with each format in its own folder.
Folders
| Folder | Formats | Size (GB, packed) | Mean KL to BF16 | Top-1 (%) |
|---|---|---|---|---|
bfp4-mlp/ |
MLP and routed experts bfloat4_b (GPTQ with per-block exponent search), attention bfloat8_b (round to nearest), router and per-expert scales, tied LM head, embedding, norms, vision and all other tensors bf16 | 15.826 | 0.06233 | 90.87 |
bfp8/ |
Attention, MLP and routed experts bfloat8_b (GPTQ), router and per-expert scales, tied LM head, embedding, norms, vision and all other tensors bf16 | 27.513 | 0.00567 | 97.39 |
| BF16 (Google checkpoint) | - | 50.47 | 0 | 100 |
| Q4_0 (llama.cpp) | - | 14.439 | 0.05293 | 91.55 |
KL and top-1 cover 8,048 positions of English and Korean text (WikiText-2 test, Korean Wikipedia), in the chat template. Q4_0 was made from the same checkpoint with llama.cpp v0.9.0 (cd959bae) and no importance matrix. Its SHA-256 is 0f70faabfedac04c31f7ef661601c3fca4fc80069cef7e9eaf509b4b0e1e3c85. Q4_0 is the reference because Google ships this QAT checkpoint as Q4_0.
How to run
Download one format.
hf download Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix --include "bfp4-mlp/*" --local-dir gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix
hf download Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix --include "bfp8/*" --local-dir gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix
from transformers import AutoTokenizer, Gemma4ForConditionalGeneration
d = "gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix/bfp4-mlp"
tok = AutoTokenizer.from_pretrained(d)
model = Gemma4ForConditionalGeneration.from_pretrained(d, dtype="bfloat16", device_map="auto")
messages = [{"role": "user", "content": "What is the capital of France?"}]
inputs = tok.apply_chat_template(messages, tokenize=True, add_generation_prompt=True,
return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=64)
print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Run on Tensix
Pack one matrix.
import json
import torch
import ttnn
from safetensors import safe_open
d = "gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix/bfp4-mlp"
name = "model.language_model.layers.0.mlp.down_proj.weight"
fmt = json.load(open(f"{d}/quant4.json"))["layers"]["0"]["mlp.down_proj"]["format"]
dtype = {"bfp4": ttnn.bfloat4_b, "bfp8": ttnn.bfloat8_b}[fmt]
shard = json.load(open(f"{d}/model.safetensors.index.json"))["weight_map"][name]
with safe_open(f"{d}/{shard}", "pt") as f:
w = f.get_tensor(name).t().contiguous()
device = ttnn.open_device(device_id=0)
w_tt = ttnn.as_tensor(w, dtype=dtype, layout=ttnn.TILE_LAYOUT,
device=device, memory_config=ttnn.DRAM_MEMORY_CONFIG)
assert torch.equal(ttnn.to_torch(w_tt).float(), w.float())
ttnn.close_device(device)
d=gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix/bfp4-mlp
python "$d/pack_tensix.py" "$d"
python "$d/verify_grid.py" "$d"
Add --device to pack_tensix.py to round-trip the packed values. The helpers cover the attention and shared MLP projections and skip the routed experts. For BFP8, use bfp8 in the local paths.
Updates
- 2026-11-29: Merged the BFP4-MLP and BFP8 repos into one repo with a folder per format.
- 2026-11-22: Corrected the BF16 size in the
bfp4-mlp/andbfp8/summaries to match the evaluation table. - 2026-11-13: First release of
bfp4-mlp/, followingbfp8/on 2026-11-12.
License
Apache 2.0, as declared by the base model. The root and each folder carry LICENSE and NOTICE. The scripts pack_tensix.py and verify_grid.py ship unchanged from tensix-bfp-gptq at commit 5c52065 under the same license.
Citation
@misc{gemmateam2026gemma4,
title={Gemma 4 Technical Report},
author={Gemma Team},
year={2026},
eprint={2607.02770},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2607.02770},
}
Model tree for Xylolabs/gemma-4-26B-A4B-it-qat-q4_0-unquantized-Tenstorrent-Tensix
Base model
google/gemma-4-26B-A4B