← Back to Leaderboard
Ggoogle-deepmind

google-deepmind/gemma

JAX SDK for local Gemma inference and fine-tuning

Engineering Health (Methodology)
A+ · 92/100
Maintenance Activity
● Updated 8d ago
Latest Release
v4.0.1
Commercial License Check
Apache-2.0 · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption23/25
Release Cadence14/20
License Clarity20/20
Local AIGPUAPI
Total Stars
★ 5,901
24h Growth
+2
7d Growth
+23
Forks
1,062

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

google-deepmind/gemma Star History (2024-02-20 - 2026-12-04) ALL-TIME STAR HISTORY (2024-02 – 2026-12) +5.9k in 1018d · avg +6/day 6.2k 3.1k 0 2024-02-20: ★ 12024-04-27: ★ 1,9432024-06-29: ★ 2,1262024-08-31: ★ 2,2942024-11-02: ★ 2,3772025-01-04: ★ 2,4762025-03-08: ★ 2,5702025-05-10: ★ 3,1822025-07-12: ★ 3,4322025-09-13: ★ 3,6232025-11-15: ★ 3,7462026-01-17: ★ 3,8942026-03-21: ★ 4,0412026-05-23: ★ 5,1962026-07-25: ★ 5,5562026-09-26: ★ 5,7332026-12-04: ★ 5,901 ★ 5.9k 2024-02 2025-07 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Gemma is a Python SDK built on JAX. The gemma.gm interface separates model construction, checkpoint loading, and text sampling: instantiate a model in gm.nn, load matching weights with gm.ckpts.load_params, then pass both objects to gm.text.ChatSampler. This gives application code explicit control over the model–checkpoint pairing.

The package runs inside the Python process on the selected JAX backend. A ChatSampler configured with multi_turn=True supports successive chat calls; the integration surface is a Python object, not a network protocol. The source tree separates the library in gemma/ from runnable examples in examples/ and walkthroughs in colabs/ and docs/.

Key Capabilities & Differentiators

The same ChatSampler API works across Gemma 2, 3, 3n, and 4. The Gemma 4 example pairs gm.nn.Gemma4_E4B() with the GEMMA4_E4B_IT checkpoint. In the multimodal example, the caller places <|image|> markers in the prompt, passes two images through the images argument, and asks a follow-up question in a later turn.

A common sampler interface reduces integration changes across model generations, but does not imply that every checkpoint accepts images or has the same hardware requirements. Beyond inference, the project provides fine-tuning and sampling scripts in examples/ and tutorials for fine-tuning and LoRA sampling. JAX supports execution on CPU, GPU, and TPU.

Trade-offs & Limitations

The SDK is a good fit when you want direct model and parameter access for Gemma inference or adaptation in a JAX application. Compared with a standalone open-source inference server, it lets you call the model directly from Python but leaves network serving, concurrency limits, and monitoring to your application or a separate serving layer. It is not a substitute for a packaged endpoint.

A managed API reduces responsibility for accelerator setup and capacity; local execution gives you more control over where inference runs but makes sizing and runtime compatibility your responsibility. The library code is Apache-2.0. Evaluate the selected checkpoint’s terms separately before commercial hosting or redistribution; the code license alone does not answer those questions.

Hardware & Deployment Guide

Use Python 3.12 or newer, install JAX for the intended CPU, GPU, or TPU backend, then run pip install gemma. Download the weights separately and load the checkpoint that matches the model. The demonstrated deployment path is local or self-hosted Python execution; if remote callers need access, plan to put a service around that code rather than expecting the sampler to expose an endpoint.

For GPU sizing, the supplied references are 8 GB or more for the 2B checkpoint and 24 GB or more for the 7B checkpoint. Neither figure sizes the Gemma 4 E4B example. Test the exact checkpoint under expected context lengths, image inputs, and concurrency before choosing hardware. v4.0.0 introduced Gemma 4; v4.0.1 corrected the dialog dependency requirement to >= 1.1.0.

Runtime: gemma is a JAX-based Python package requiring Python 3.12 or newer.
Checkpoint integration: gm.nn.Gemma4_E4B() can be paired with gm.ckpts.CheckpointPath.GEMMA4_E4B_IT via gm.ckpts.load_params.
Chat API: gm.text.ChatSampler spans Gemma 2, 3, 3n, and 4 and exposes an explicit multi_turn option.
Image input: The chat example pairs <|image|> placeholders with an images argument and follows up in a second turn.
Adaptation: examples/ contains sampling and fine-tuning scripts; tutorials cover fine-tuning and LoRA sampling.
Release compatibility: v4.0.0 added Gemma 4, and v4.0.1 corrected the dialog requirement to >= 1.1.0.
Best For

Python/JAX teams that need local Gemma inference, multimodal chat with a compatible checkpoint, or a starting point for fine-tuning.

Skip If

You need a ready-to-run inference endpoint, managed accelerator capacity, or support for Python versions older than 3.12.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

Local AIGPUAPI
pip install gemma

Comparison vs. Top LLMs & Inference Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
gemma ★5.9k+23PythonApache-2.0JAX SDK for local Gemma inference and fine-tuning
DeepSpeed43.4k+33PythonApache-2.0PyTorch runtime for distributed training and inference under GPU memory constrai
agent-lightning19k+30PythonMITProxy-based reinforcement learning for agents in their existing harnesses
ludwig11.8k+6PythonApache-2.0YAML-first framework for fine-tuning, training, and serving LLMs and multimodal

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/google-deepmind/gemma.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

google-deepmind/gemma Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about gemma

How do I integrate Gemma into an application?

Instantiate a model such as gm.nn.Gemma4_E4B(), load its matching parameters with gm.ckpts.load_params, and pass both to gm.text.ChatSampler. Use multi_turn=True for a conversation. This is an in-process Python API; a network service must provide its own request and session handling.

Which accelerator and how much VRAM should I budget?

Gemma supports CPU, GPU, and TPU through JAX. The GPU sizing references are 8 GB or more for the 2B checkpoint and 24 GB or more for the 7B checkpoint. They are not requirements for every variant and do not establish a budget for Gemma 4 E4B. Measure peak memory with the target checkpoint, context length, image inputs, and expected concurrency.

Does Apache-2.0 cover commercial self-hosting of the weights?

The library code is Apache-2.0, but the model weights are downloaded separately. Check the terms of the exact checkpoint for commercial use, hosting, and redistribution rather than assuming the code license covers the weights.

When should I choose this SDK over an inference server or hosted API?

Choose Gemma when you want direct Python access to the model, its parameters, and Gemma-specific sampling or fine-tuning workflows. Prefer a standalone inference server when the main requirement is a network endpoint and serving operations, or a hosted API when you want to avoid managing accelerator capacity. This package does not establish a ready-made serving interface.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining google-deepmind/gemma? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature google-deepmind/gemma on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare