# google/gemma_pytorch

The official PyTorch implementation of Google's Gemma models

Repository: https://github.com/google/gemma_pytorch
Canonical: https://ross.abutalabs.com/products/gemma_pytorch
Homepage: https://ai.google.dev/gemma
Language: Python
License: Apache-2.0
License Family: permissive
Topics: gemma, google, pytorch
Archived: true
Last push: 2025-05-30T20:45:51+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 24, release rhythm 35, longevity 66
- inputs: {"age_days": 925, "days_push": 460, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5719, forks 602 (observed 2026-08-28T04:09:28.244908+00:00)

## What it is
The official PyTorch implementation of Google's Gemma family of open large language models, including text-only and multimodal variants. It provides model and inference code supporting CPU, GPU, and TPU via PyTorch and PyTorch/XLA.

## Use cases
- run gemma models locally with pytorch
- inference for gemma 3 on gpu
- run gemma on tpu with pytorch xla
- load gemma checkpoints from kaggle or hugging face
- run multimodal gemma 4b 12b 27b inference
- fine-tune or experiment with gemma model architecture

## When to choose
- you want the official reference implementation of Gemma in PyTorch
- you need inference across CPU, GPU, and TPU including PyTorch/XLA
- you want to run Gemma 1/2/3 or CodeGemma checkpoints directly
- you need multimodal Gemma 3 support in PyTorch

## When to avoid
- you want a high-performance production serving stack with batching and quantization
- you prefer using Gemma through Hugging Face Transformers or vLLM
- you need training/fine-tuning pipelines, which this repo does not focus on
- you use a framework other than PyTorch such as JAX or TensorFlow

## Facets
- artifact type: library
- maturity: active
- function: llm-inference, machine-learning, deep-learning
- domain: large-language-models, deep-learning, artificial-intelligence
- platform: python, cloud
- tags: gemma, pytorch, google, tpu, open-weights, inference, multimodal, gpu, linux

## Member repositories
- google/gemma_pytorch (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:28.244908+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:53:28.331877+00:00, confidence not recorded.
  - readme: https://github.com/google/gemma_pytorch (fetched 2026-08-28T04:09:28.244908+00:00, sha 2be5ec835d25)
  - homepage: https://ai.google.dev/gemma (fetched 2026-08-29T08:49:01.869006+00:00, sha 458fc3b379e2)
  - site_page: https://deepmind.google/about (fetched 2026-08-29T08:49:01.879344+00:00, sha ae485140138c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
