Run Gemma with Ollama¶
Ollama downloads quantized weights for you and exposes a CLI plus a local HTTP API. No GPU required, though one helps.
Install¶
Download from ollama.com/download, then check it worked:
Run¶
Downloads the model on first use. To fetch without running:
Model tags¶
| Tag | Download | Context |
|---|---|---|
gemma4:e2b |
7.2 GB | 128K |
gemma4:e4b |
9.6 GB | 128K |
gemma4:12b |
7.6 GB | 256K |
gemma4:26b |
18 GB | 256K |
gemma4:31b |
20 GB | 256K |
gemma4:latest is an alias for e4b. On Apple Silicon, the -mlx tags
(gemma4:12b-mlx) use the MLX runtime. Full list:
ollama.com/library/gemma4/tags.
Images¶
Note
Ollama publishes Gemma 4 as text and image only. For audio input, use Transformers or llama.cpp.
Server¶
Ollama serves on port 11434.
Context defaults to 4K under 24 GiB VRAM
Ollama sizes context from available VRAM, not from the model. Raise it when you need it:
OLLAMA_CONTEXT_LENGTH=64000 ollama serve, or per request with
"options": {"num_ctx": 64000}. Agents and coding tools want at least 64K —
Ollama: context length.