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
Sizes shown at Q4_0 quantisation · mobile builds are smaller still
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.
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.
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
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
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
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
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
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.
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.
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.
What each model needs
| Model | 16-bit | 8-bit | 4-bit | Mobile | Comfortable hardware for 4-bit |
|---|---|---|---|---|---|
| Gemma 4 E2B | 11.4 GB | 5.7 GB | 2.9 GB | 1.1 GB | Recent phone, or any 8 GB computer |
| Gemma 4 E4B | 17.9 GB | 8.9 GB | 4.5 GB | 2.5 GB | 8 GB laptop, or a 6-8 GB GPU |
| Gemma 4 12B | 26.7 GB | 13.4 GB | 6.7 GB | - | 16 GB laptop or Mac, or a 12 GB GPU |
| Gemma 4 26B A4B | 57.7 GB | 28.8 GB | 14.4 GB | - | 24 GB GPU, or 32 GB Apple silicon |
| Gemma 4 31B | 69.9 GB | 34.9 GB | 17.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.
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.
| Model | Best for | Hugging Face | Ollama |
|---|---|---|---|
| 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.
Ollama
The quickest route on Windows, macOS and Linux. One command downloads the model and starts a local, OpenAI-compatible server.
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.
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.
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
| Runtime | Best for | How you use it | Guide |
|---|---|---|---|
| Ollama | Most people - one command, then a local API | Terminal + background server | Google's Ollama guide |
| LM Studio | Anyone who prefers a desktop app | Point-and-click GUI | LM Studio section |
| llama.cpp | Maximum control, CPU-only machines, GGUF files | Command line / C++ library | Google's llama.cpp guide |
| MLX | Apple silicon Macs | Python or command line | Google's MLX guide |
| Transformers | Python projects, research, fine-tuning | Python library | Google's Transformers guide |
| LiteRT-LM | Phones and edge devices | Mobile and embedded runtime | LiteRT-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.
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 command
ollama run gemma4downloads and starts a chat. - Every sizeTags for E2B, E4B, 12B, 26B A4B and 31B, plus QAT builds.
- Local APIServed at
localhost:11434for your own apps. - Images tooAdd an image path to your prompt to ask about a picture.
Gemma 4 tags on Ollama
| Model | Tag | Download | QAT tag | QAT download | Context |
|---|---|---|---|---|---|
| Gemma 4 E2B | gemma4:e2b | 4.6 - 7.5 GB | gemma4:e2b-it-qat | 4.3 GB | 128K |
| Gemma 4 E4B | gemma4:e4b | 6.6 - 9.5 GB | gemma4:e4b-it-qat | 6.1 GB | 128K |
| Gemma 4 12B | gemma4:12b | 7.7 - 8.0 GB | gemma4:12b-it-qat | 7.2 GB | 256K |
| Gemma 4 26B A4B | gemma4:26b-a4b | 16 - 19 GB | gemma4:26b-a4b-it-qat | 16 GB | 256K |
| Gemma 4 31B | gemma4:31b | 19 - 20 GB | gemma4:31b-it-qat | 19 GB | 256K |
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.
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.
-
Install LM Studio
Download the installer for your system from lmstudio.ai, run it and open the app.
-
Find Gemma 4
Open the model downloader with Ctrl + Shift + M (Cmd on Mac) and search for "Gemma".
-
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.
-
Load it and chat
Press Ctrl / Cmd + L, select your Gemma model, and start typing. Everything runs on your computer.
-
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.
Gemma 4 models in LM Studio
| Model | Identifier | Size |
|---|---|---|
| Gemma 4 E2B | google/gemma-4-e2b | 4.20 GB |
| Gemma 4 E4B | google/gemma-4-e4b | 5.90 GB |
| Gemma 4 12B | google/gemma-4-12b | 7.40 GB |
| Gemma 4 26B A4B | google/gemma-4-26b-a4b | 15.60 GB |
| Gemma 4 31B | google/gemma-4-31b | 19.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 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 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.
-
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.
-
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. -
Give it a system prompt
Gemma 4 supports the
systemrole natively. Use it to set the role, tone and output format once, then keep user messages short and specific. More in the prompting guide. -
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=Trueto 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.
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.
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
| Endpoint | Model ID | API style | Good to know |
|---|---|---|---|
| Gemini API (Google AI Studio) | gemma-4-31b-it | Google GenAI SDK / REST | Key from AI Studio. Thinking, system instructions, images, function calling, Search grounding. |
| OpenRouter | google/gemma-4-31b-it | OpenAI-compatible | One key, routed across multiple providers. |
| Together · Fireworks | see provider catalog | OpenAI-compatible | Serverless and dedicated endpoints. |
| Vertex AI · Amazon Bedrock | see cloud console | Cloud SDKs | For teams already on Google Cloud or AWS. |
| Ollama (local) | gemma4:12b | OpenAI-compatible · localhost:11434/v1 | Free, offline, any size you have pulled. |
| vLLM (self-hosted) | google/gemma-4-26B-A4B-it | OpenAI-compatible | High-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.
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
| Model | LiveCodeBench v6 | Codeforces ELO | Tau2 (agentic) |
|---|---|---|---|
| Gemma 4 31B | 80.0% | 2150 | 76.9% |
| Gemma 4 26B A4B | 77.1% | 1718 | 68.2% |
| Gemma 4 12B | 72.0% | 1659 | 69.0% |
| Gemma 4 E4B | 52.0% | 940 | 42.2% |
| Gemma 4 E2B | 44.0% | 633 | 24.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.
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
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
GPQA Diamond
MMLU Pro
LiveCodeBench v6
Vision benchmarks
| Benchmark | What it measures | 31B | 26B A4B | 12B |
|---|---|---|---|---|
| MMMU Pro | Multimodal understanding | 76.9 | 73.8 | 69.1 |
| MathVision | Visual mathematical reasoning | 85.6 | 82.4 | 79.7 |
Source: Gemma 4 Technical Report (arXiv:2607.02770). Training data cutoff January 2025.
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 4 | Gemma 3 | |
|---|---|---|
| Released | March 31, 2026 | March 10, 2025 |
| Sizes | E2B, E4B, 12B, 26B A4B, 31B | 270M, 1B, 4B, 12B, 27B |
| License | Apache 2.0 | Gemma Terms of Use |
| Max context | 256K (128K on E2B / E4B) | 128K (32K on 270M / 1B) |
| Inputs | Text, image, video; audio on E2B, E4B, 12B | Text and image |
| Thinking mode | Yes, configurable | No |
| System role | Native | Folded into the user turn |
| Function calling | Built in | Prompt-based |
| Architectures | Dense, Mixture-of-Experts, encoder-free Unified | Dense |
MMLU Pro
AIME 2026
LiveCodeBench v6
GPQA Diamond
Tau2
MMMU Pro
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 4 | Gemini | |
|---|---|---|
| What it is | Open-weight models you download | Proprietary models you access as a service |
| How you get it | Hugging Face, Kaggle, Ollama - or a hosted API | Gemini app, Gemini API, Google Cloud |
| License | Apache 2.0 | Google's API and product terms |
| Runs offline / on-device | Yes - phone, laptop or your own servers | No - cloud only |
| Your data | Stays on your hardware when self-hosted | Sent to Google's cloud for processing |
| Fine-tune and modify | Full access to the weights | No access to the weights |
| Cost | Free weights; pay only for compute | Per-token API pricing or a subscription |
| Raw capability | Strong for its size | Higher - the frontier models |
| Scale and upkeep | You run and scale it (or pick a host) | Fully managed by Google |
| Current line-up | E2B, E4B, 12B, 26B A4B, 31B | Gemini 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.
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.
| Model | Weights | License | Max context | Multimodal | Runs on-device |
|---|---|---|---|---|---|
| Gemma 4 (Google) | Open | Apache 2.0 | 256K | Text·Image·Audio·Video | Yes - down to 1.1 GB |
| Llama 4 (Meta) | Open | Community license | Long | Text·Image | Limited |
| Qwen 3.6 (Alibaba) | Open | Apache 2.0 | Long | Text·Image | Partial |
| DeepSeek | Open | MIT / custom | Long | Mostly text | Rarely |
| Gemini (Google) | Closed | API terms | Very long | Full | No |
| GPT (OpenAI) | Closed | API terms | Long | Full | No |
| Claude (Anthropic) | Closed | API terms | Long | Text·Image | No |
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.
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.
Free to download, use commercially, fine-tune and redistribute under Apache 2.0.
On hardware you already own there is no per-token fee - only electricity and your time.
$0.22 per million output tokens at the cheapest provider on OpenRouter.
$0.34 per million output tokens at the cheapest provider on OpenRouter.
Hosted API prices, per million tokens
| Model | Where | Input | Output |
|---|---|---|---|
| Gemma 4 26B A4B | Lowest on OpenRouter (Darkbloom) | $0.042 | $0.22 |
| Gemma 4 26B A4B | DeepInfra, via OpenRouter | $0.07 | $0.34 |
| Gemma 4 26B A4B | Google Vertex AI, via OpenRouter | $0.15 | $0.60 |
| Gemma 4 31B | Lowest on OpenRouter (DeepInfra Turbo) | $0.09 | $0.34 |
| Gemma 4 31B | CoreWeave, via OpenRouter | $0.10 | $0.34 |
| Gemma 4 31B | Together AI, serverless | $0.39 | $0.97 |
| Gemma 4 31B | SambaNova, 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.
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 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.
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.
Download links
| Source | What you get | Link |
|---|---|---|
| Hugging Face | Official weights and model card | google/embeddinggemma-2 |
| Hugging Face collection | The release collection | EmbeddingGemma 2 collection |
| Kaggle | Same weights, with free notebooks | Kaggle model page |
| Model card | Specs, benchmarks and prompts | Google's v2 model card |
| Documentation | Guides for inference and fine-tuning | EmbeddingGemma docs |
| Announcement | Google's launch post, October 6, 2026 | Read 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
| Parameters | 740M total: 270M text, 170M vision, 300M audio |
| Output | 768 dimensions; 512, 256 or 128 by truncation |
| Context | 8,192 tokens across all inputs |
| Input limits | About 29 images, 58 video frames or 327 seconds of audio |
| Languages | 100+ |
| Memory | About 567 MB of RAM for the full model on a phone; about 191 MB text-only when quantised |
| License | Apache 2.0 |
Benchmark scores
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.
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.
-it-qat tags rather than converting them yourself.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.