Last verified: 2026-10-14
270m, 1b) for on-device and CPU-only work. Run whichever fits your hardware locally, then pair the Tokios connector to call it from any machine, teammate, or hosted agent through https://api.tokios.com — no inbound ports, no VPN.
Run it locally with Ollama
Both generations are in the Ollama library. For Gemma 4, pull and run the default tag (theE4B edge model):
ollama run gemma4:12b, ollama run gemma4:26b (MoE), or ollama run gemma4:31b. For the prior generation, ollama run gemma3 runs the 4b default — see the gemma4 and gemma3 library pages for the full tag lists — this page covers connecting it, not every runtime detail.
Ollama’s default context window is small (2048 tokens) — far below Gemma’s native 128K–256K. Raise
num_ctx in your Modelfile or client request to use more of its context.Variants & tags
Every value below is from the model cards and the Ollama library. Tags and download sizes change as new quantizations ship — confirm against ollama.com/library/gemma4 and ollama.com/library/gemma3 before you standardize on one.
Sources: ollama.com/library/gemma4, ollama.com/library/gemma3, google/gemma-4-31B-it, google/gemma-4-26B-A4B-it, google/gemma-4-E4B-it, google/gemma-4-12B-it.
Quantization & formats
Ollama’s default tags areGGUF Q4_K_M. The gemma4 library also publishes -it-qat (quantization-aware-trained int4), -q8_0, -bf16, -mlx (Apple Silicon), -mxfp8, and -nvfp4 (NVIDIA Blackwell) variants for each size. Which format you can run depends on your hardware — see Quantization formats and the hardware they need for the full matrix, and what quantization is for how to read the Q4_K_M-style names.
Hardware requirements — will Gemma 4 fit your GPU?
Comfort at roughlyQ4 for a modest context length. Treat every entry as an estimate — the ground truth is the actual GGUF size plus the KV cache for your context. See what size model fits your GPU? for the sizing math.
Run it — beginner to advanced
- Ollama (easiest)
- LM Studio (GUI)
- vLLM (advanced)
- SGLang (advanced)
http://127.0.0.1:11434. Raise num_ctx to use more context, and swap in gemma4:12b, gemma4:26b, or gemma4:31b for a larger tier, or gemma3 for the prior generation.Capabilities
- Reasoning: Gemma 4 supports a configurable thinking mode, off by default. Enable it by including the
<|think|>control token at the start of the system prompt (orenable_thinking=Trueif you’re using the model card’sparse_responsehelper); the model then emits step-by-step reasoning before its final answer. - Native tool-calling: Yes, on Gemma 4 — the model card documents native function-calling for structured tool use and agentic workflows, using the standard
system/user/assistantroles. - Vision: Multimodal — accepts text and images (with variable aspect ratio and resolution) across the whole Gemma 4 family; Gemma 3 (
4band up) is also vision-capable. - Audio:
E2BandE4Bonly — native automatic speech recognition (ASR) and speech-to-translated-text, up to 30 seconds of audio per request. - Long context: 131,072 tokens natively on
E2B/E4B, 262,144 tokens on12B,26B-A4B, and31B.
Connect it with Tokios
Once Gemma is running locally, pair the Tokios connector so you can reach it ashttps://api.tokios.com from Claude Code, Cline, or any other compatible client — instead of only from localhost:11434.
1
Pair the Tokios connector
Sign in at tokios.com/console, open the Setup tab, and click Start pairing to get a one-time claim code (Then approve the device on the Setup or Connectors tab.
TKS-XXXX-XXXX). Install and run the connector on the machine running Ollama:Windows
macOS
Linux
2
Point the connector at Ollama's /v1 API
Ollama exposes an OpenAI-compatible surface at
/v1. For a single-model setup, the console’s Setup wizard fills this in automatically as http://127.0.0.1:11434/v1. For multiple models, set it explicitly in tokios-connector.json — see Connector config.3
Register a deployment
In the Models tab, register the model and choose a public deployment name, for example
gemma-tunnel. This name — not Ollama’s local model id — is what clients send in the model field.4
Create an API key
In the Keys tab, click Create key. Copy the
sk-tok-… key now — it’s shown only once.Call it from anywhere
Caveats
- Gemma 4’s thinking mode is off by default — the opposite of some other reasoning families. If you want step-by-step reasoning, you have to opt in with the
<|think|>control token or your client’s equivalent. - Audio input (ASR and speech translation) only works on the
E2BandE4Bsizes —12B,26B-A4B, and31Baccept text and image only. - The
26B-A4BMoE needs all 26B parameters in memory even though only about 4B are active per token — size your hardware off the full download, not the active count. - Licensing differs by generation: Gemma 4 is Apache 2.0 and ungated, while Gemma 3 uses Google’s custom Gemma license and its Hugging Face checkpoints are gated (you accept the terms before downloading; the Ollama tags are redistributed under the same license). Google’s Gemma Prohibited Use Policy applies to both — check the license terms before commercial or sensitive deployments.
- Gemma 3 remains useful for very small, CPU-friendly deployments (
270m,1b) where Gemma 4’s smallest tier (E2B) may still be heavier than you need.
New same-class alternative. Meta’s Muse Glimmer 30B lands in the same tier as
gemma4:31b — dense, multimodal, Apache 2.0, and sized for one consumer GPU. Meta benchmarks them against each other directly and its numbers favour Muse Glimmer, but they are vendor-run with no independent reproduction yet. Gemma 4 still spans a much wider range, from E2B on edge hardware up to 31B; Muse Glimmer ships at one size. Test both on your own workload.FAQ
How much VRAM does Gemma 4 need?
How much VRAM does Gemma 4 need?
At
Q4_K_M, the edge models (E2B, E4B) need ~7–10 GB, the 12B dense needs ~7.6 GB, the 26B-A4B MoE needs ~18 GB, and the 31B dense needs ~20 GB. The -it-qat int4-native tags are smaller still — for example gemma4:12b-it-qat is ~7.2 GB. BF16 builds are much larger: the 31B alone is ~57 GB. Add KV cache on top for your context length.Can Gemma 4 run on a 24 GB GPU?
Can Gemma 4 run on a 24 GB GPU?
Yes — every Gemma 4 variant fits a 24 GB card (RTX 3090 / 4090) at
Q4_K_M, including the 31B dense at ~20 GB and the 26B-A4B MoE at ~18 GB. The edge models and 12B leave plenty of headroom for long context; the 31B is comfortable but tighter at very large context lengths.Is Gemma 4 open source?
Is Gemma 4 open source?
Gemma 4 is released under Apache 2.0 and is ungated — no acceptable-use policy or sign-up to download. Gemma 3 uses Google’s custom Gemma license and its Hugging Face checkpoints are gated (you accept the terms before downloading). Google’s Gemma Prohibited Use Policy applies to both generations. Note that open weights and open source are not the same thing — the training data and pipeline are not released.
What is QAT and how does it help?
What is QAT and how does it help?
QAT (quantization-aware training) means Google trained the model to stay accurate at 4-bit from the start, rather than applying quantization after training. The result:
-it-qat tags hold quality better than a plain post-training Q4_K_M quant, at a comparable or smaller download — gemma4:12b-it-qat is ~7.2 GB vs ~7.6 GB for Q4_K_M, and gemma4:e4b-it-qat is ~6.1 GB vs ~9.6 GB. If you are running Gemma 4 at 4-bit, prefer the -it-qat tag.Should I use Gemma 3 or Gemma 4?
Should I use Gemma 3 or Gemma 4?
Use Gemma 4 — it is the current generation, with multimodal input (text + image across all sizes, audio on
E2B/E4B), Apache 2.0 licensing, and context windows of 131K–262K tokens. Gemma 3 remains useful for very small, CPU-friendly deployments (270m, 1b) where Gemma 4’s smallest tier (E2B) is still heavier than you need, or if you specifically rely on a Gemma 3 tag that has no Gemma 4 equivalent.Quickstart
Pair a connector and register your first model end to end.
What size model fits your GPU?
Match Gemma to your available VRAM before you pull it.
Quantization & hardware
Which of Gemma’s formats —
GGUF, QAT, MLX, NVFP4 — runs on your hardware.Which local model for which task?
See how Gemma compares to other local models by task.