Run this model with HF Jobs
Run Xylolabs/gemma-4-26B-A4B-it-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-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-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-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-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-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-Tenstorrent-Tensix")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Xylolabs/gemma-4-26B-A4B-it-Tenstorrent-Tensix", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Xylolabs/gemma-4-26B-A4B-it-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-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-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-Tenstorrent-Tensix
- SGLang
How to use Xylolabs/gemma-4-26B-A4B-it-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-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-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-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-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-Tenstorrent-Tensix with Docker Model Runner:
docker model run hf.co/Xylolabs/gemma-4-26B-A4B-it-Tenstorrent-Tensix
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("Xylolabs/gemma-4-26B-A4B-it-Tenstorrent-Tensix", device_map="auto")These weights from google/gemma-4-26B-A4B-it 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/ |
Attention, MLP and routed-expert projections bfloat4_b; routers, LM head, embedding, norms, vision and the rest bf16 | 15.271 | 0.14638 | 87.24 |
bfp8/ |
Attention, MLP and routed-expert projections bfloat8_b; routers, LM head, embedding, norms, vision and the rest bf16 | 27.513 | 0.00804 | 96.97 |
| BF16 (google/gemma-4-26B-A4B-it) | - | 50.47 | 0 | 100 |
| Q4_K_M (llama.cpp) | - | 16.796 | 0.1249 | 88.16 |
KL and top-1 cover 8,048 positions of English and Korean text (WikiText-2 test, Korean Wikipedia), in the chat template. Q4_K_M was made from the same checkpoint with llama.cpp v0.9.0 (cd959bae) and no importance matrix; its sha256 is 2289deaba79c84dfa5727922ac0e7aee2a4807cc5b438faebdb75644e4856c7c.
How to run
hf download Xylolabs/gemma-4-26B-A4B-it-Tenstorrent-Tensix --include "bfp4/*" --local-dir gemma-4-26B-A4B-it-Tenstorrent-Tensix
hf download Xylolabs/gemma-4-26B-A4B-it-Tenstorrent-Tensix --include "bfp8/*" --local-dir gemma-4-26B-A4B-it-Tenstorrent-Tensix
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "gemma-4-26B-A4B-it-Tenstorrent-Tensix/bfp4"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16", device_map="auto")
messages = [{"role": "user", "content": "What is the capital of France?"}]
inputs = tok.apply_chat_template(messages, 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-Tenstorrent-Tensix/bfp4"
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)
python gemma-4-26B-A4B-it-Tenstorrent-Tensix/bfp4/pack_tensix.py gemma-4-26B-A4B-it-Tenstorrent-Tensix/bfp4
python gemma-4-26B-A4B-it-Tenstorrent-Tensix/bfp4/verify_grid.py gemma-4-26B-A4B-it-Tenstorrent-Tensix/bfp4
Add --device to round-trip the packed values. The helpers cover the attention and shared MLP projections and skip the routed experts.
To use another format, download its folder the same way and substitute its local path.
Updates
- 2026-11-29: Merged the BFP4 and BFP8 repos into one repo with a folder per format.
- 2026-11-12: bfp8/: First release.
- 2026-11-11: bfp4/: First release.
License
Apache 2.0, as the base model's card says; its repository has no LICENSE file, so LICENSE holds the standard
text. The changes are listed in NOTICE. pack_tensix.py and verify_grid.py are by Xylolabs under the same
license. pack_tensix.py and verify_grid.py ship unchanged from
tensix-bfp-gptq at 5c52065.
Each folder carries its own LICENSE and NOTICE.
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},
}
# 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-Tenstorrent-Tensix")