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.
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.