EmbeddingGemma 2 is outNew · Oct 6

Byte for byte, the most capable open models

Gemma 4 is Google DeepMind's open-weight model family, built from the same research as Gemini 3 and released under Apache 2.0. Five sizes span a phone and a datacenter rack - with reasoning, native multimodality, function calling and up to 256K of context in every one.

Apache 2.0 · Commercial use permitted · Weights are free, you pay only for compute

Gemma 4 31B
Dense · 256K context
17.5 GB
Gemma 4 26B A4B
MoE · ~3.8B active
14.4 GB
Gemma 4 12B
Unified · encoder-free
6.7 GB
Gemma 4 E4B
Edge · laptops & GPUs
4.5 GB
Gemma 4 E2B
On-device · phones
2.9 GB

Sizes shown at Q4_0 quantisation · mobile builds are smaller still

5
Model sizes, E2B through 31B dense
256K
Context window on 12B, 26B and 31B
140+
Languages supported out of the box
1B+
Downloads across the Gemma family
Text Images Audio Video PhoneE2B · offline LaptopE4B · 12B Server26B A4B · 31B Gemma 4 open weights · Apache 2.0
Any mix of inputs in, one model family, running wherever your hardware is.
Overview

What is Gemma 4?

Gemma 4 is a family of open-weight generative AI models from Google DeepMind, launched in spring 2026 and built from the same research as Gemini 3. Unlike Gemini, which you reach through an API, Gemma's weights are yours to download, run offline, fine-tune and ship inside your own products under Apache 2.0.

The name comes from the Latin gemma, "precious stone". The family spans five sizes - from E2B, which fits on a phone, to the 31B dense flagship - and every one of them reasons with a configurable thinking mode, calls tools natively and understands images. The smaller E2B, E4B and 12B models also take audio and video.

The family

Five models, one architecture family

Pick by the hardware you actually have. Every model shares the same tokenizer, chat template, thinking mode and function-calling interface, so moving up or down a size is a config change, not a rewrite. See the full model guide and detailed specs.

Flagship
Gemma 4 31B
Dense

The strongest model in the family, ranked #3 among open models on the Arena text leaderboard at launch. All 31B parameters active on every token - the choice when quality matters more than throughput.

  • Context256K
  • ModalitiesText + Image
  • Memory (BF16)69.9 GB
  • Memory (Q4_0)17.5 GB
Efficient
Gemma 4 26B A4B
Mixture of Experts

26B total parameters, but only about 3.8B activate per token. Near-31B quality at a fraction of the inference cost, which makes it the default pick for high-volume serving.

  • Context256K
  • Active params~3.8B / token
  • Memory (BF16)57.7 GB
  • Memory (Q4_0)14.4 GB
Unified
Gemma 4 12B
Unified · encoder-free

Text, vision and audio in a single backbone with no separate encoders. Native audio input in a mid-sized open model, approaching 26B benchmarks on under half the memory. Fits a 16GB laptop. More on the 12B.

  • Context256K
  • ModalitiesText·Img·Aud·Vid
  • Memory (BF16)26.7 GB
  • Memory (Q4_0)6.7 GB
Edge
Gemma 4 E4B
Effective 4B

Built for laptops, single consumer GPUs and higher-end handsets. Full multimodal input including audio transcription and translation, at a size that fits comfortably in 8GB of VRAM when quantised.

  • Context128K
  • Raw params4.5B
  • Memory (Q4_0)4.5 GB
  • Mobile build2.5 GB
On-device
Gemma 4 E2B
Effective 2B

The phone-class model. Ships through LiteRT-LM, MediaPipe and the Android AICore preview, with a mobile build just over a gigabyte - offline, private, and fast enough for interactive use. See the Android guide and mobile downloads.

  • Context128K
  • Raw params2.3B
  • Memory (Q4_0)2.9 GB
  • Mobile build1.1 GB
Specialised
Gemma variants
Domain models

EmbeddingGemma 2 (740M) for on-device multimodal embeddings, DiffusionGemma (26B A4B) for fast text diffusion, TranslateGemma (4B / 12B / 27B) for machine translation and MedGemma 1.5 (4B) for medical imaging and clinical text. Plus FunctionGemma, ShieldGemma and T5Gemma v2 across the wider ecosystem.

  • EmbeddingGemma 2Oct 6, 2026
  • DiffusionGemmaJun 10, 2026
  • TranslateGemmaJan 15, 2026
  • MedGemma 1.5Jan 13, 2026
  • LicenseVaries by model

Memory needs for every size and precision are in the system requirements.

Capabilities

What you get in every size

The interface is identical across the family. Prototype on E4B on your laptop, deploy on 31B in production, and none of your prompting or tool schemas need to change. Go deeper on features, capabilities, prompting and the known limitations.

🧠

Configurable thinking

A thinking mode that emits reasoning traces before responding, and can be dialled down or off when you need latency instead of depth.

🛠️

Native function calling

Tool schemas and strict structured JSON output are trained in, not prompted in - with July's patches fixing the JSON reliability issues agent builders hit at launch.

👁️

Multimodal input

Images at variable aspect ratio and resolution across the family; E2B, E4B and 12B add native video and audio understanding.

🌍

140+ languages

A 262K-entry SentencePiece vocabulary trained for genuine multilingual coverage, including audio transcription and translation on the edge models.

📜

256K context

Long-context retrieval and reasoning on 12B, 26B and 31B; 128K on the edge models - enough for whole codebases and long document sets.

⚡

Multi-token prediction

Every size ships with a matching MTP draft model for speculative decoding - faster generation with no quality loss - plus FlashAttention 4 support on Hopper GPUs.

💻

Code generation

80.0% on LiveCodeBench v6 for the 31B, with native tool calling for agentic workflows. More in the coding section.

🔓

Apache 2.0, genuinely

Open weights, commercial use, redistribution and fine-tuning permitted. No usage caps, no revenue thresholds, no acceptable-use rider.

Requirements

Gemma 4 system requirements

Memory is what matters. If the model fits in your RAM or GPU memory, it will run - the smallest Gemma 4 needs under 3 GB, the largest about 17.5 GB at 4-bit.

  • Memory2.9 GB to 17.5 GB for 4-bit weights, plus headroom for context.
  • GPUOptional. A GPU or Apple silicon is much faster; CPU-only works for the small models.
  • Operating systemWindows, macOS and Linux; Android and iOS for the mobile builds.
  • Disk spaceAbout the same as the memory figure for each model you download.
Phone 8 GB laptop 16 GB laptop 24 GB GPU Workstation Gemma 4 E2B2.9 GB Gemma 4 E4B4.5 GB Gemma 4 12B6.7 GB Gemma 4 26B A4B14.4 GB Gemma 4 31B17.5 GB 08 GB16 GB24 GB Memory for 4-bit weights · leave headroom for context
Each step up in model size needs a step up in memory.

What each model needs

Model16-bit8-bit4-bitMobileComfortable hardware for 4-bit
Gemma 4 E2B11.4 GB5.7 GB2.9 GB1.1 GBRecent phone, or any 8 GB computer
Gemma 4 E4B17.9 GB8.9 GB4.5 GB2.5 GB8 GB laptop, or a 6-8 GB GPU
Gemma 4 12B26.7 GB13.4 GB6.7 GB-16 GB laptop or Mac, or a 12 GB GPU
Gemma 4 26B A4B57.7 GB28.8 GB14.4 GB-24 GB GPU, or 32 GB Apple silicon
Gemma 4 31B69.9 GB34.9 GB17.5 GB-24 GB GPU, or 32 GB+ Apple silicon

Memory figures are Google's, from the Gemma 4 model overview, and cover loading the weights only. The "comfortable hardware" column is this site's guidance: the weights plus room for the operating system and a working context.

📏

Context costs memory

The figures cover weights only. Long prompts and chats grow the cache on top, so a 256K context needs far more than a short conversation.

🧩

26B A4B loads in full

Only about 4B parameters are active per token, but all 26B must sit in memory. It is fast to run, not small to load.

🍎

Apple silicon

Macs share memory between CPU and GPU, so a 16 GB Mac handles 12B well. See the Mac guide.

📱

Phones and small devices

E2B and E4B have dedicated mobile builds from 1.1 GB. See the Android guide and QAT builds.

Download

Gemma 4 download

Every Gemma 4 model is a free download under Apache 2.0 - no sign-up fee, no usage caps. Pick the size that fits your memory, then grab it from Hugging Face or pull it with one Ollama command.

ModelBest forHugging FaceOllama
Gemma 4 E2B Phones, browsers, edge devices google/gemma-4-E2B-it ollama pull gemma4:e2b
Gemma 4 E4B Laptops, single consumer GPU google/gemma-4-E4B-it ollama pull gemma4:e4b
Gemma 4 12B 16 GB laptops, native audio google/gemma-4-12B-it ollama pull gemma4:12b
Gemma 4 26B A4B High-volume serving (MoE) google/gemma-4-26B-A4B-it ollama pull gemma4:26b-a4b
Gemma 4 31B Maximum quality google/gemma-4-31B-it ollama pull gemma4:31b

Links go to the instruction-tuned (-it) checkpoints, the ones you want for chat. Download sizes vary by source - see the Ollama and LM Studio tables - and memory needs are in the system requirements.

🤗

Hugging Face

All official checkpoints, model cards and GGUF files. Fetch any repo with hf download google/gemma-4-12B-it.

Open the Gemma 4 collection →

🦙

Ollama

The quickest route on Windows, macOS and Linux. One command downloads the model and starts a local, OpenAI-compatible server.

See every gemma4 tag →

🗜️

QAT 4-bit builds

Google's quantization-aware-trained checkpoints: the same download size as regular 4-bit, with quality closer to full precision. In Ollama, add -it-qat to the tag.

QAT collection → · QAT guide

📊

Kaggle & LM Studio

Kaggle hosts the same weights with free notebook GPUs. LM Studio gives you a desktop app that searches, downloads and runs Gemma 4 with no terminal.

Kaggle → · LM Studio →

offline $ ollama run gemma4:12b pulling 8.0 GB 100% >>> Why is the sky blue? Sunlight scatters off air molecules, and blue light scatters the most.
One command to download, then it answers with the network switched off.
Local

Run Gemma 4 locally

Because the weights are open, Gemma 4 can run entirely on your own computer. After the first download there is no internet connection, account or API key involved.

  • PrivatePrompts and files never leave your machine.
  • OfflineWorks on a plane, in a lab, or behind a firewall.
  • No usage feesNo per-token charges or rate limits - just your hardware.
  • Yours to changeSwap sizes, adjust settings, or fine-tune your own copy.

If something goes wrong

It is very slow

The model is probably spilling out of GPU memory into system RAM. Drop down a size, or use a QAT 4-bit build.

Out of memory

Close other apps, shorten the context window, or pick a smaller model. The VRAM guide has the numbers.

Strange or broken replies

Re-pull the model to get the July 2026 chat-template fixes, and keep Google's recommended sampling settings from how to use it.

Pick a local runtime

RuntimeBest forHow you use itGuide
OllamaMost people - one command, then a local APITerminal + background serverGoogle's Ollama guide
LM StudioAnyone who prefers a desktop appPoint-and-click GUILM Studio section
llama.cppMaximum control, CPU-only machines, GGUF filesCommand line / C++ libraryGoogle's llama.cpp guide
MLXApple silicon MacsPython or command lineGoogle's MLX guide
TransformersPython projects, research, fine-tuningPython libraryGoogle's Transformers guide
LiteRT-LMPhones and edge devicesMobile and embedded runtimeLiteRT-LM overview

Step-by-step setup is in the Ollama and LM Studio sections; commands for Transformers, vLLM, llama.cpp and MLX are under More ways to run it. On a Mac see the Mac guide; on a phone see the Android guide.

Ollama

Gemma 4 Ollama

Ollama is the most popular way to run Gemma 4 on your own machine. It downloads the model with one command, keeps it ready in the background, and gives every app on your computer a local API to talk to.

  • One commandollama run gemma4 downloads and starts a chat.
  • Every sizeTags for E2B, E4B, 12B, 26B A4B and 31B, plus QAT builds.
  • Local APIServed at localhost:11434 for your own apps.
  • Images tooAdd an image path to your prompt to ask about a picture.
$ ollama pull gemma4:12b pulling weights pulling template pulling params success $ ollama list NAME SIZEgemma4:12b 8.0 GB Ollama server localhost:11434 Chat app Code editor Your script
Pull once, then every app on your machine can use the model.

Gemma 4 tags on Ollama

ModelTagDownloadQAT tagQAT downloadContext
Gemma 4 E2Bgemma4:e2b4.6 - 7.5 GBgemma4:e2b-it-qat4.3 GB128K
Gemma 4 E4Bgemma4:e4b6.6 - 9.5 GBgemma4:e4b-it-qat6.1 GB128K
Gemma 4 12Bgemma4:12b7.7 - 8.0 GBgemma4:12b-it-qat7.2 GB256K
Gemma 4 26B A4Bgemma4:26b-a4b16 - 19 GBgemma4:26b-a4b-it-qat16 GB256K
Gemma 4 31Bgemma4:31b19 - 20 GBgemma4:31b-it-qat19 GB256K

Sizes as listed on Ollama's gemma4 tags page in October 2026; a range means the tag has more than one build. Plain gemma4 is the default tag and is listed at the same size and context as gemma4:e4b. gemma4:26b is a shorter name for the 26B A4B. Ollama also publishes 8-bit, full-precision and MLX builds, and a hosted gemma4:cloud tag.

Everyday commands

ollama pull gemma4:12b          # download a model
ollama run gemma4:12b           # chat in the terminal
ollama run gemma4 "roses are red" # one-off prompt
ollama list                     # models you have
ollama ps                       # models loaded right now
ollama stop gemma4:12b          # unload from memory
ollama rm gemma4:12b            # delete to free disk

# Ask about an image: put its path in the prompt
ollama run gemma4 "caption this image ./photo.png"

To call the local server from your own code, see the API section.

🗜️

Prefer the QAT tags

The -it-qat tags are Google's quantization-aware builds: slightly smaller downloads that hold quality better at 4-bit. See the QAT guide.

🔄

Keep it up to date

Run ollama pull again from time to time. Refreshed weights and chat-template fixes, like July 2026's, arrive as updates to the same tag.

🧭

Not a terminal person?

Use the LM Studio desktop app instead, or compare every option in the runtime selector.

LM Studio

Gemma 4 LM Studio

LM Studio is a free desktop app for running models locally with no terminal. It is the easiest way to try Gemma 4 on Windows, macOS or Linux: search, download, chat.

  1. Install LM Studio

    Download the installer for your system from lmstudio.ai, run it and open the app.

  2. Find Gemma 4

    Open the model downloader with Ctrl + Shift + M (Cmd on Mac) and search for "Gemma".

  3. Pick a size and download

    Choose the variant that fits your memory - the app shows the download size - and click Download. Not sure? Start with 12B on a 16 GB machine.

  4. Load it and chat

    Press Ctrl / Cmd + L, select your Gemma model, and start typing. Everything runs on your computer.

  5. Optional: turn on the local API

    In the Developer tab, load the model and start the server to call Gemma 4 from your own code through an OpenAI-compatible endpoint.

LM Studio gemma 4 google/gemma-4-12b 7.40 GB · vision · tool use · reasoning Download Loaded ✓ Explain MoE in one line running offline
Search, download, chat - no command line needed.

Gemma 4 models in LM Studio

ModelIdentifierSize
Gemma 4 E2Bgoogle/gemma-4-e2b4.20 GB
Gemma 4 E4Bgoogle/gemma-4-e4b5.90 GB
Gemma 4 12Bgoogle/gemma-4-12b7.40 GB
Gemma 4 26B A4Bgoogle/gemma-4-26b-a4b15.60 GB
Gemma 4 31Bgoogle/gemma-4-31b19.00 GB

Identifiers and sizes from LM Studio's Gemma 4 page. Add -qat to an identifier for its QAT build, which is the same size. LM Studio lists 4 GB of RAM as the minimum for the smallest model and up to 19 GB for the largest.

Prefer the command line?

# LM Studio ships a CLI called lms
lms get google/gemma-4-12b      # download
lms load google/gemma-4-12b     # load into memory
lms server start                # start the local API

The server speaks the OpenAI format on port 1234 by default - calling it works the same way as in the API section, with the address swapped.

🍎

GGUF or MLX

LM Studio runs Gemma 4 in GGUF (llama.cpp) format on any system and in MLX format on Apple silicon. See the Mac guide.

🗜️

Choose the QAT builds

Each size has a -qat version at the same download size, trained to hold quality at 4-bit. Details in the QAT guide.

🧰

Vision, tools and reasoning

LM Studio lists tool use, vision input and reasoning for Gemma 4. Compare other ways to run it in the runtime selector or the install guide.

More runtimes

More ways to run it

Beyond Ollama and LM Studio: copy-paste starting points for Python, production serving, llama.cpp and Apple silicon. If you pulled weights before mid-July 2026, re-pull them for the chat-template and tool-calling fixes. Not sure which to use? Try the runtime selector.

from transformers import pipeline
import torch

pipe = pipeline(
    "text-generation",
    model="google/gemma-4-12B-it",
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

messages = [
    {"role": "system", "content": "You are a precise technical assistant."},
    {"role": "user", "content": "Summarise this paper in five bullets."},
]

out = pipe(messages, max_new_tokens=512)
print(out[0]["generated_text"][-1]["content"])

# Multimodal: pass image or audio content blocks in the same messages list.
# Thinking mode is controlled through the chat template kwargs.
# Production serving with an OpenAI-compatible API
pip install vllm

vllm serve google/gemma-4-26B-A4B-it \
  --max-model-len 262144 \
  --enable-auto-tool-choice \
  --tool-call-parser gemma4 \
  --reasoning-parser gemma4 \
  --tensor-parallel-size 2

# On Hopper GPUs, FlashAttention 4 (July 2026) gives
# +25-70% prefill throughput and up to -31% time-to-first-token.
# Official QAT Q4_0 GGUF for CPU + GPU offload
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
cmake -B build && cmake --build build --config Release -j

# Pull a GGUF straight from Hugging Face and serve it
./build/bin/llama-server \
  -hf google/gemma-4-12B-it-qat-q4_0-gguf \
  --ctx-size 32768 \
  --n-gpu-layers 99 \
  --port 8080
# Apple silicon - fastest path on an M-series Mac
pip install mlx-lm

mlx_lm.generate \
  --model mlx-community/gemma-4-12B-it-4bit \
  --prompt "Transcribe and summarise the attached audio." \
  --max-tokens 1024

# 12B Q4 needs roughly 6.7 GB, so it fits a 16 GB Mac
# alongside everything else you have open.

Model identifiers change - check the Hugging Face collection before copying these verbatim. Setup help: install guide · Mac setup · API section.

How to use

How to use Gemma 4

Once a model is downloaded, using it well comes down to four steps and a handful of settings Google recommends in the model card. Here is the short version.

  1. Choose where to run it

    No install: try the playground or Google AI Studio. On your own machine: Ollama or LM Studio. In an app: Transformers, vLLM or a hosted API. Unsure? Use the runtime selector.

  2. Start a chat

    With Ollama it is one command: ollama run gemma4:12b. Type a message and you are talking to the model, fully offline. The chat guide covers the other ways in.

  3. Give it a system prompt

    Gemma 4 supports the system role natively. Use it to set the role, tone and output format once, then keep user messages short and specific. More in the prompting guide.

  4. Turn thinking on for hard problems

    Thinking mode makes the model reason before it answers - worth it for maths, code and multi-step tasks, unnecessary for quick chat. In Transformers, pass enable_thinking=True to the chat template.

# Chat with a system prompt and thinking switched on
messages = [
    {"role": "system", "content": "You are a careful maths tutor."},
    {"role": "user", "content": "Why is 0.1 + 0.2 not 0.3?"},
]

text = processor.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
    enable_thinking=True,   # False for fast replies
)

# Recommended sampling for every use case
# temperature=1.0, top_p=0.95, top_k=64

The chat-template call is from Google's thinking guide; load the processor and model as shown in the Transformers tab under More ways to run it.

Settings worth getting right

🎚️

Sampling

Google recommends one configuration across all use cases: temperature=1.0, top_p=0.95, top_k=64. Start there before tuning anything.

🧠

Thinking in multi-turn chats

Keep only the final answer in the conversation history. Earlier reasoning should be dropped before the next user turn - except on tool-call turns, where it is kept.

🖼️

Images

Put the image before the text in your prompt. Pick a token budget - 70, 140, 280, 560 or 1120 - low for captioning and classification, high for OCR and small text.

🎙️

Audio and video

On E2B, E4B and 12B. Put audio after the text. Clips are limited to 30 seconds of audio and 60 seconds of video at one frame per second, so split longer recordings.

🛠️

Tools and JSON

Function calling is built in: describe your tools, let the model choose a call, run it, and return the result. See capabilities for the format.

🤝

Use it in your tools

Any app that speaks the OpenAI API can point at a local Gemma 4 server. You can even pair it with Claude Code - and check the limitations first.

API

Gemma 4 API

There is no single "Gemma 4 API" - because the weights are open, you choose who serves them. Call Google's hosted endpoint, a third-party provider, or your own machine, and get the same model behind each one.

  • Hosted by GoogleThe Gemini API serves Gemma 4 31B and 26B A4B with an AI Studio key.
  • Third-party providersOpenRouter, Together and Fireworks offer OpenAI-compatible endpoints.
  • Your own serverOllama, vLLM and llama.cpp expose a local OpenAI-compatible API.
  • Drop-in compatibleMost OpenAI client code works by changing the base URL and model name.
POST /v1/chat/completions streamed tokens { } Your app Gemma 4 hosted or local Gemini API OpenRouter Ollama vLLM
One request format, whichever endpoint you point it at.

Hosted: Gemini API

# pip install google-genai  ·  set GEMINI_API_KEY
from google import genai

client = genai.Client()

response = client.models.generate_content(
    model="gemma-4-31b-it",
    contents="Explain MoE routing in two sentences.",
)

print(response.text)

Local: OpenAI-compatible

# pip install openai  ·  ollama pull gemma4:12b
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:11434/v1",
    api_key="ollama",  # any string works locally
)

response = client.chat.completions.create(
    model="gemma4:12b",
    messages=[{"role": "user", "content": "Hello!"}],
)

print(response.choices[0].message.content)

Where to call it

EndpointModel IDAPI styleGood to know
Gemini API (Google AI Studio)gemma-4-31b-it
gemma-4-26b-a4b-it
Google GenAI SDK / RESTKey from AI Studio. Thinking, system instructions, images, function calling, Search grounding.
OpenRoutergoogle/gemma-4-31b-itOpenAI-compatibleOne key, routed across multiple providers.
Together · Fireworkssee provider catalogOpenAI-compatibleServerless and dedicated endpoints.
Vertex AI · Amazon Bedrocksee cloud consoleCloud SDKsFor teams already on Google Cloud or AWS.
Ollama (local)gemma4:12bOpenAI-compatible · localhost:11434/v1Free, offline, any size you have pulled.
vLLM (self-hosted)google/gemma-4-26B-A4B-itOpenAI-compatibleHigh-throughput serving on your own GPUs.

Model IDs, prices and rate limits differ by provider and change often - check each provider's catalog before you ship. For a cost comparison see pricing; to run your own endpoint see the self-hosting guide.

users.py Gemma 4 · local 1# sort users by signup date, newest first 2def sort_users(users): 3return sorted( 4users, 5key=lambda u: u.signup_date, 6reverse=True, 7) $ pytest -q 3 passed in 0.04s
A comment in, working code out - generated on your own machine.
Coding

Gemma 4 coding

Gemma 4 is a capable coding model you can run privately: it writes, explains and refactors code, calls tools natively for agent workflows, and keeps your source on your own hardware.

  • 80.0% on LiveCodeBench v6The 31B's score on fresh, contamination-resistant coding problems.
  • 256K contextRoom for large files and multi-file context on 12B, 26B A4B and 31B.
  • Built-in tool callingRun tests, read files and search docs from an agent loop.
  • Private by defaultRun locally and proprietary code never leaves your machine.

Coding benchmarks by size

ModelLiveCodeBench v6Codeforces ELOTau2 (agentic)
Gemma 4 31B80.0%215076.9%
Gemma 4 26B A4B77.1%171868.2%
Gemma 4 12B72.0%165969.0%
Gemma 4 E4B52.0%94042.2%
Gemma 4 E2B44.0%63324.5%

Source: Google's Gemma 4 model card. Tau2 is an average over three runs.

🎯

Which size for coding?

31B for the best results. 26B A4B when speed matters. 12B is the pick for a 16 GB laptop. E4B and E2B score much lower, so keep them for small completions and simple scripts.

🧩

In your editor

Serve a model with Ollama, LM Studio or vLLM, then point any coding extension that accepts an OpenAI-compatible endpoint at it. Setup is in the API section.

🤖

Coding agents

Function calling lets Gemma 4 drive agent loops. It can back Claude Code as a local sidekick or stand-in, with trade-offs on long agentic tasks.

🧠

Turn thinking on

Reasoning before answering helps most on debugging, algorithms and multi-step changes. Switch it off for quick autocomplete-style replies. See how to use it.

⚡

Fast infilling

DiffusionGemma, the experimental text-diffusion sibling, is aimed at latency-critical work like in-line editing and code infilling - faster output, lower benchmark quality.

⚖️

Know the ceiling

Frontier hosted models are still stronger on large, long-running coding tasks. A common setup: Gemma 4 locally for everyday edits, a hosted model for the hardest jobs.

Deploy

From a phone to a GPU cluster

The same weights run across the whole range. What changes is the runtime. See the self-hosting guide and downloads.

📱

On-device

E2B and E4B ship through LiteRT-LM, MediaPipe and the Android AICore Developer Preview. Fully offline, no data leaves the handset, mobile builds from 1.1 GB.

☁️

Google Cloud

Vertex AI Model Garden for managed endpoints, Cloud Run for serverless GPU serving, and GKE when you need full control over autoscaling and topology.

🅰️

AWS

In Amazon SageMaker JumpStart since April 2026, on Amazon Bedrock since June, and in AWS GovCloud (US-West) through Bedrock since July for regulated US public-sector workloads.

🐳

Self-hosted

vLLM and SGLang for high-throughput serving, NVIDIA NIM and NeMo for enterprise GPU stacks, TGI and plain Docker for everything in between.

🎯

Fine-tuning

LoRA and QLoRA through TRL, PEFT and Unsloth; full fine-tuning with JAX or Keras. Apache 2.0 means you own and can redistribute the result.

🧪

Experimentation

Kaggle Notebooks give you free GPU time, Google AI Studio gives you a playground and an API key, and LM Studio gives you a desktop GUI with no terminal required.

Ecosystem support

Hugging Face TransformersOllamallama.cpp MLXvLLMSGLangUnsloth LM StudioNVIDIA NIMNVIDIA NeMo KerasJAXTRL / PEFT Vertex AICloud RunGKE SageMaker JumpStartAmazon Bedrock LiteRT-LMMediaPipeAndroid AICore KaggleOpenRouterTogetherFireworks
Performance

Benchmarks from the technical report

Instruction-tuned checkpoints, thinking mode enabled. At launch in April 2026 the 31B ranked #3 among open models on the Arena text leaderboard and the 26B A4B #6. Full benchmark breakdown.

AIME 2026

Competition mathematics
31B Dense89.2
26B A4B MoE88.3
12B Unified77.5

GPQA Diamond

Graduate-level science reasoning
31B Dense84.3
26B A4B MoE82.3
12B Unified78.8

MMLU Pro

Broad knowledge and reasoning
31B Dense85.2
26B A4B MoE82.6
12B Unified77.2

LiveCodeBench v6

Contamination-free code generation
31B Dense80.0
26B A4B MoE77.1
12B Unified72.0

Vision benchmarks

BenchmarkWhat it measures31B26B A4B12B
MMMU ProMultimodal understanding76.973.869.1
MathVisionVisual mathematical reasoning85.682.479.7

Source: Gemma 4 Technical Report (arXiv:2607.02770). Training data cutoff January 2025.

Versus

Gemma 4 comparison

Two questions come up more than any other: is Gemma 4 worth the upgrade from Gemma 3, and how is it different from Gemini? Here are both, side by side.

Gemma 4 vs Gemma 3

Gemma 4 is a generational jump rather than a refresh: a more permissive license, double the context, audio and video input, a thinking mode, and much higher scores on reasoning, coding and agent benchmarks.

Gemma 4Gemma 3
ReleasedMarch 31, 2026March 10, 2025
SizesE2B, E4B, 12B, 26B A4B, 31B270M, 1B, 4B, 12B, 27B
LicenseApache 2.0Gemma Terms of Use
Max context256K (128K on E2B / E4B)128K (32K on 270M / 1B)
InputsText, image, video; audio on E2B, E4B, 12BText and image
Thinking modeYes, configurableNo
System roleNativeFolded into the user turn
Function callingBuilt inPrompt-based
ArchitecturesDense, Mixture-of-Experts, encoder-free UnifiedDense

MMLU Pro

Knowledge and reasoning
Gemma 4 31B85.2
Gemma 3 27B67.6

AIME 2026

Competition maths
Gemma 4 31B89.2
Gemma 3 27B20.8

LiveCodeBench v6

Code generation
Gemma 4 31B80.0
Gemma 3 27B29.1

GPQA Diamond

Graduate science
Gemma 4 31B84.3
Gemma 3 27B42.4

Tau2

Agentic tool use
Gemma 4 31B76.9
Gemma 3 27B16.2

MMMU Pro

Multimodal understanding
Gemma 4 31B76.9
Gemma 3 27B49.7

Scores from Google's Gemma 4 model card. Gemma 3 27B has no thinking mode, so its column is reported without thinking; Gemma 4 figures are with thinking on. Gemma 3 still has one thing Gemma 4 lacks - a tiny 270M model. More on the Gemma 3 page.

Gemma 4 vs Gemini

They come from the same Google DeepMind research - Gemma 4 is built on Gemini 3 technology - but they are different products. Gemma is the open model you own and run; Gemini is the larger, closed model Google runs for you.

Gemma 4Gemini
What it isOpen-weight models you downloadProprietary models you access as a service
How you get itHugging Face, Kaggle, Ollama - or a hosted APIGemini app, Gemini API, Google Cloud
LicenseApache 2.0Google's API and product terms
Runs offline / on-deviceYes - phone, laptop or your own serversNo - cloud only
Your dataStays on your hardware when self-hostedSent to Google's cloud for processing
Fine-tune and modifyFull access to the weightsNo access to the weights
CostFree weights; pay only for computePer-token API pricing or a subscription
Raw capabilityStrong for its sizeHigher - the frontier models
Scale and upkeepYou run and scale it (or pick a host)Fully managed by Google
Current line-upE2B, E4B, 12B, 26B A4B, 31BGemini 3.x family, such as 3.8 Flash and 3.1 Pro

Pick Gemma 4 if…

You need privacy, offline use or on-device AI, want to fine-tune, or have enough volume that owning the compute beats paying per token.

Pick Gemini if…

You want the strongest answers available with nothing to install or maintain, and sending data to a cloud API is acceptable.

Use both

Run Gemma 4 locally for routine work and hand only the hardest requests to Gemini. See the full comparison and Gemma 4 vs Qwen 3.5.

Gemini's model line-up changes frequently; names here reflect Google's model list as of October 2026.

Comparison

How Gemma 4 stacks up

The honest summary: frontier closed models still lead on absolute capability. Gemma 4's argument is that it is the most capable thing you can actually download, own, and run on a phone.

ModelWeightsLicenseMax contextMultimodalRuns on-device
Gemma 4 (Google) OpenApache 2.0256K Text·Image·Audio·VideoYes - down to 1.1 GB
Llama 4 (Meta) OpenCommunity licenseLongText·ImageLimited
Qwen 3.6 (Alibaba) OpenApache 2.0LongText·ImagePartial
DeepSeek OpenMIT / customLongMostly textRarely
Gemini (Google) ClosedAPI termsVery longFullNo
GPT (OpenAI) ClosedAPI termsLongFullNo
Claude (Anthropic) ClosedAPI termsLongText·ImageNo

Competitor rows are a positioning summary, not benchmarked head-to-head results - capabilities of hosted models change frequently. Verify current specs against each vendor's documentation. More: full comparison · Gemma 4 vs Qwen 3.5 · pricing · Gemma 3.

Pricing

Gemma 4 pricing

The model itself costs nothing. What you pay for is the compute that runs it - either your own hardware, or a hosted provider's per-token rate, which starts at a few cents per million tokens.

Weights
$0

Free to download, use commercially, fine-tune and redistribute under Apache 2.0.

Run it yourself
$0 / token

On hardware you already own there is no per-token fee - only electricity and your time.

Hosted 26B A4B, from
$0.042 in

$0.22 per million output tokens at the cheapest provider on OpenRouter.

Hosted 31B, from
$0.09 in

$0.34 per million output tokens at the cheapest provider on OpenRouter.

Hosted API prices, per million tokens

ModelWhereInputOutput
Gemma 4 26B A4BLowest on OpenRouter (Darkbloom)$0.042$0.22
Gemma 4 26B A4BDeepInfra, via OpenRouter$0.07$0.34
Gemma 4 26B A4BGoogle Vertex AI, via OpenRouter$0.15$0.60
Gemma 4 31BLowest on OpenRouter (DeepInfra Turbo)$0.09$0.34
Gemma 4 31BCoreWeave, via OpenRouter$0.10$0.34
Gemma 4 31BTogether AI, serverless$0.39$0.97
Gemma 4 31BSambaNova, via OpenRouter$0.38$1.15

Prices in US dollars, checked on October 7, 2026 from OpenRouter's 31B and 26B A4B listings and Together AI. Provider prices change often and differ in speed, context limit and quantisation - confirm before you budget. Google's Gemini API pricing page does not list a price for Gemma models.

Estimate your monthly bill

Enter how many tokens you expect to send and receive each month. A token is roughly three-quarters of an English word.

Estimated cost
$15.80
per month · $9.00 input + $6.80 output

Hosted is cheaper when…

Your volume is low or bursty. At a few cents per million tokens, light use costs less than keeping a GPU switched on.

Self-hosting wins when…

You run steady, high volume, already own the hardware, or cannot send data to a third party. The 26B A4B is the efficient pick for serving.

Go deeper

The full pricing page compares more providers and GPU rental costs. See also the self-hosting guide and VRAM guide.

Gemma 4 scorecard editorial assessment Licence and openness Excellent Performance for its size Very good Runs on your hardware Excellent Multimodal input Good Smallest models Mixed Verdict: the open model family to beat in 2026
How Gemma 4 rates across the things that matter for an open model.
Review

Gemma 4 review

Six months after launch, Gemma 4 is the easiest open model family to recommend: a truly permissive licence, strong results for its size, and a version for almost any device.

It is not a replacement for the largest hosted models, and the two smallest sizes trade a lot of quality for their footprint. But if you want capable AI that you can download, own and run privately, this is where to start.

What we like

  • Apache 2.0. Commercial use, modification and redistribution, with no custom terms - a first for Gemma.
  • Strong for its size. The 31B scores 85.2% on MMLU Pro and 80.0% on LiveCodeBench v6, far ahead of Gemma 3 27B.
  • A size for every device. From a 1.1 GB phone build to a 31B flagship, all sharing one interface.
  • 12B is a sweet spot. Text, image, audio and video in a model that fits a 16 GB laptop.
  • Built for agents. Native function calling, a system role and an adjustable thinking mode.
  • Well supported. Ollama, LM Studio, llama.cpp, MLX, vLLM and the major clouds, plus official QAT builds.

What to watch out for

  • Edge models are much weaker. E2B scores 44.0% on LiveCodeBench v6 and 24.5% on Tau2 - fine for simple tasks, not for agents.
  • Not frontier-level. The latest hosted Gemini, GPT and Claude models are still stronger on the hardest work.
  • Audio is limited. Only E2B, E4B and 12B accept it, and clips are capped at 30 seconds (60 for video).
  • The big models need real memory. About 14 to 18 GB at 4-bit for 26B A4B and 31B, before context.
  • Rough edges at launch. Tool calling and chat-template issues needed the July 2026 refresh - re-pull old downloads.
  • You run it. Updates, scaling and safety settings are your responsibility when self-hosting.
👍

Best for

Developers and teams who need private or offline AI, on-device features, fine-tuning, or predictable costs at high volume.

🤔

Think twice if

You need the very best reasoning available, long audio or video understanding, or you do not want to manage any infrastructure.

🏁

Our pick

12B for most laptops, 26B A4B for fast serving, 31B when quality comes first. Choose E4B or E2B only when the device leaves no alternative.

How this review was put together: it is this site's editorial assessment, based on Google's published model card, technical report, licence and documentation as of October 2026. It is not an independent hands-on benchmark, and the ratings are opinions rather than measurements. See also safety and the full comparison.

New · October 6, 2026

EmbeddingGemma 2

EmbeddingGemma 2 is Google DeepMind's open embedding model built on the Gemma 4 architecture. It turns text, code, images, video and audio into vectors in one shared space, so a search in one format can find matches in any other - on-device and offline.

  • Five input typesText, code, images, video and audio in a single 768-dimension space.
  • 740M, modularDrop the vision or audio encoder; text-only is just 270M.
  • Flexible vectorsShrink 768 dimensions to 512, 256 or 128 to save storage.
  • 8K context8,192 tokens shared across all inputs, under Apache 2.0.
Text Image Audio Video Embedding Gemma 2 one shared vector space query
Different formats, same meaning, neighbouring points - that is what makes cross-modal search work.

Download links

SourceWhat you getLink
Hugging FaceOfficial weights and model cardgoogle/embeddinggemma-2
Hugging Face collectionThe release collectionEmbeddingGemma 2 collection
KaggleSame weights, with free notebooksKaggle model page
Model cardSpecs, benchmarks and promptsGoogle's v2 model card
DocumentationGuides for inference and fine-tuningEmbeddingGemma docs
AnnouncementGoogle's launch post, October 6, 2026Read the announcement

From a terminal: hf download google/embeddinggemma-2

Quick start

# pip install sentence-transformers
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("google/embeddinggemma-2")

query = "What causes the northern lights?"
document = "The northern lights are caused by charged particles from the sun."

query_emb = model.encode(query, prompt_name="SearchQuery")
doc_emb = model.encode(document, prompt_name="Document")
print(model.similarity(query_emb, doc_emb))

Sample from Google's model card. Use the task prompt names - skipping them lowers quality.

Specifications

Parameters740M total: 270M text, 170M vision, 300M audio
Output768 dimensions; 512, 256 or 128 by truncation
Context8,192 tokens across all inputs
Input limitsAbout 29 images, 58 video frames or 327 seconds of audio
Languages100+
MemoryAbout 567 MB of RAM for the full model on a phone; about 191 MB text-only when quantised
LicenseApache 2.0

Benchmark scores

61.36MTEB Multilingual v2
78.68MTEB Code (NDCG@10)
64.64Images (MIEB lite)
67.84Visual docs (MMEB v2)
50.67Video (MMEB v2, Hit@1)
69.54Audio (MSEB, MRR@10)

At 768 dimensions, from Google's model card. Google reports little loss when vectors are shortened to 512 or 256 dimensions, and a substantial multimodal drop at 128.

🔎

What it is for

Semantic search, retrieval for RAG, classification and clustering. Pair it with Gemma 4: EmbeddingGemma 2 finds the right passages, Gemma 4 writes the answer.

🧩

Load only what you need

Text only is 270M parameters, text plus images 440M, text plus audio 570M, and everything 740M - all producing vectors in the same space.

⚠️

Good to know

Google warns against running it in float16. It creates embeddings only - it does not generate text. For that, see the Gemma 4 models.

Latest updates

Everything that shipped in 2026

Gemma 4 has moved fast since launch - a multi-token-prediction refresh two weeks in, an encoder-free 12B and official QAT checkpoints in June, a mid-July weights update for agent builders, a billion downloads in August, and a multimodal EmbeddingGemma 2 in October.

October 6, 2026
EmbeddingGemma 2 - multimodal embeddings on-deviceNew
An open 740M model, built on the Gemma 4 architecture, that embeds text, code, images, video and audio into one shared space. Details and downloads in the EmbeddingGemma 2 section.
August 20, 2026
Gemma family passes 1 billion downloadsMilestone
Google announced that cumulative downloads across every Gemma generation have passed one billion, with more than 100,000 community variants published. Alongside it came Awesome Gemma, an official GitHub directory of Gemmaverse projects, fine-tunes, tutorials and tools.
July 15, 2026
FlashAttention 4, tool-calling fixes and sharper vision
A weights-and-config refresh, not a new version number. FA4 landed for NVIDIA Hopper GPUs with prefill throughput up 25–70% and time-to-first-token down as much as 31%. Tool calling got substantially more reliable - 31B gained 10.1% on Tau2 Telecom, and E4B went from effectively zero to a working score on TB2 agent benchmarks. Vision defaults moved to a 280-token bucket with soft tokens raised to 1120, which sharpens OCR on roughly 2.5-megapixel documents and screenshots. Re-pull your weights to get the chat-template fixes.
July 2026
Technical report published, Bedrock reaches GovCloud
The Gemma 4 Technical Report went up on arXiv on July 2. On AWS, Gemma 4 - already in SageMaker JumpStart since April and on Amazon Bedrock since June - became available to regulated US public-sector workloads through Bedrock in AWS GovCloud (US-West).
June 10, 2026
DiffusionGemma - experimental text diffusion
A 26B A4B Mixture-of-Experts sibling that generates text by denoising whole blocks of tokens in parallel rather than one token at a time - roughly 4x faster output than autoregressive Gemma 4 26B A4B, at some cost in benchmark quality. Apache 2.0, aimed at latency-critical work like in-line editing and code infilling. Weights on Hugging Face.
June 5, 2026
Official QAT checkpoints for every size
Quantization-aware-trained Q4_0 checkpoints for E2B, E4B, 12B, 26B A4B and 31B hold close to full-precision quality at a 4-bit footprint. They ship as ready-made GGUFs, compressed-tensors builds for vLLM and SGLang, and mobile-optimised variants for E2B and E4B - see the QAT collection. Use the official GGUFs or Ollama's -it-qat tags rather than converting them yourself.
June 3, 2026
Gemma 4 12B Unified - encoder-free multimodal
The architectural headline of the year. Instead of bolting vision and audio encoders onto a language backbone, 12B feeds image patches and raw audio directly into the model: vision through a lightweight embedding module, audio projected straight into the text token space with no encoder at all. It approaches 26B MoE quality on standard benchmarks at less than half the memory, and runs locally on a 16GB laptop.
April 16, 2026
Multi-Token Prediction (MTP) checkpoints
MTP shipped for E2B, E4B, 26B A4B and 31B (and now covers 12B too): each model gets a small dedicated draft model for speculative decoding - significantly faster generation with no quality loss.
April 2026
On-device and cloud availability broadens
Gemma 4 arrived in the Android AICore Developer Preview for on-device inference, in Amazon SageMaker JumpStart, and across Vertex AI Model Garden, Cloud Run and GKE.
March 31 – April 2, 2026
Gemma 4 launches
E2B, E4B, 26B A4B and 31B released under Apache 2.0 with up to 256K context, native function calling, structured JSON output, configurable thinking mode and 140+ language support. The 31B took the #3 slot among open models on the Arena text leaderboard; 26B A4B took #6.
January 15, 2026
TranslateGemma - 4B, 12B and 27B
A dedicated translation family released ahead of the Gemma 4 core models.
January 13, 2026
MedGemma 1.5 (4B)
An updated healthcare-specialised model for medical imaging and clinical text.
FAQ

Common questions

More answers on the full FAQ page, plus notes on safety.

Is Gemma 4 really free, and can I use it commercially?

Yes. The weights are released under Apache 2.0, which permits commercial use, modification, redistribution and building proprietary products on top. There are no usage caps, revenue thresholds or acceptable-use riders attached to the license. You pay only for the compute you run it on - your own hardware, a cloud GPU, or a hosted provider's per-token fee.

Which model should I pick?

Start from your memory budget. Under 4 GB and you're on a phone: E2B. A laptop or single consumer GPU: E4B, or 12B if you have 16 GB. Serving at volume: 26B A4B, because only ~3.8B parameters activate per token. Maximum quality regardless of cost: 31B dense.

If you need audio input, use E2B, E4B or 12B - those are the models with native audio. Whichever size you choose, prefer the official QAT builds for 4-bit local use.

How long is the context window really?

256K tokens on 12B, 26B A4B and 31B; 128K on E2B and E4B. Gemma 4 uses a pp-RoPE positional scheme (p=0.25) that reduces KV cache footprint by up to 37.5%, which is what makes long context practical on modest hardware rather than just nominally supported.

Can I fine-tune it?

Yes, and the license lets you keep and redistribute the result. LoRA and QLoRA work through TRL, PEFT and Unsloth - QLoRA on E4B is comfortable on a single 24 GB card. Full fine-tuning is supported via JAX and Keras. Google also publishes fine-tuning notebooks you can run for free on Kaggle.

Does it run on a phone?

E2B is designed for it, with a mobile build around 1.1 GB, and E4B at roughly 2.5 GB works on higher-end devices. Distribution is through LiteRT-LM and MediaPipe, and Gemma 4 is in the Android AICore Developer Preview. Inference is fully offline - nothing leaves the device.

What languages does it support?

140+ languages, backed by a 262K-entry SentencePiece vocabulary. The edge models additionally handle multilingual audio transcription and translation, with Japanese, German, French, Spanish, Italian, Russian and Chinese specifically evaluated in the technical report. If translation is your primary workload, look at TranslateGemma (4B / 12B / 27B) instead.

What's the knowledge cutoff?

Training data has a cutoff of January 2025. For anything more recent, use retrieval or tool calling rather than relying on the model's parametric knowledge - function calling is native and, since July, considerably more reliable.

What is "thinking mode"?

A configurable mode where the model emits reasoning traces before its final answer, which is what drives the strong AIME and GPQA numbers. It costs latency and tokens, so it's adjustable - turn it down for chat and classification, turn it up for maths, code and multi-step agentic work.

Download it. Own it. Ship it.

Open weights under Apache 2.0, five sizes, and a runtime for every piece of hardware you have. No API key required unless you want one.

Contents