← all repositories
google/gemma_pytorch

Google’s Gemma, rebuilt for the PyTorch faithful

It is the canonical PyTorch home for Google’s Gemma models, letting you run text-only or multimodal inference on CPU, GPU, or TPU.

gemma_pytorch
Not currently ranked — collecting fresh signals.
star history

What it does This repository provides the official PyTorch model definitions and inference scripts for Google’s Gemma LLMs. It covers both vanilla PyTorch and PyTorch/XLA paths, letting you run text-only or multimodal inference on CPU, GPU, or TPU. The supported lineup stretches from the original 2B/7B weights up through Gemma 3’s new multimodal 4B, 12B, and 27B checkpoints, all hosted on Kaggle and Hugging Face.

The interesting bit Despite being the official implementation, the README admits this is not an officially supported Google product. It also ships with PyTorch/XLA routes for TPU inference and reserves 99 unused tokenizer slots—<unused0> through <unused98>—explicitly to assist later fine-tuning.

Key highlights

  • Covers Gemma 3 (multimodal 4B, 12B, 27B), Gemma 2, and original text-only variants.
  • Inference backends for both vanilla PyTorch and PyTorch/XLA, spanning CPU, GPU, and TPU.
  • Supports int8 quantization for leaner inference.
  • Tokenizer reserves 99 unused tokens (<unused0><unused98>) for training and fine-tuning workflows.
  • Model checkpoints are mirrored on Kaggle and Hugging Face Hub.

Caveats

  • Explicitly disclaimed as not an officially supported Google product, so enterprise SLAs need not apply.

Verdict Worth a look if you want Google’s Gemma weights running in native PyTorch—especially on TPU via XLA—or need multimodal inference without Hugging Face indirection. Skip it if you require vendor support or a polished, high-level API; this is reference code with a disclaimer, not a product.

Frequently asked

What is google/gemma_pytorch?
It is the canonical PyTorch home for Google’s Gemma models, letting you run text-only or multimodal inference on CPU, GPU, or TPU.
Is gemma_pytorch open source?
Yes — google/gemma_pytorch is open source, released under the Apache-2.0 license.
What language is gemma_pytorch written in?
google/gemma_pytorch is primarily written in Python.
How popular is gemma_pytorch?
google/gemma_pytorch has 5.7k stars on GitHub.
Where can I find gemma_pytorch?
google/gemma_pytorch is on GitHub at https://github.com/google/gemma_pytorch.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.