- There is no Gemma 4 release as of August 2026. The latest Gemma family includes Gemma 2 (2B, 9B, 27B) and the original Gemma (2B, 7B).
- Run Gemma 2 on Ollama with
ollama run gemma2:27b,ollama run gemma2:9b, orollama run gemma2:2bdepending on your GPU memory. - The 27B model requires 16GB+ VRAM for full precision, while 9B runs comfortably on 8GB GPUs and 2B on 4GB.
- All Gemma models on Ollama support system prompts, JSON mode, and multi-turn conversations out of the box.
When searching for Ollama Gemma 4, you’re likely looking for the latest Gemma models available through Ollama. As of August 2026, there is no official Gemma 4 release from Google DeepMind. The most recent models are the Gemma 2 family (2B, 9B, and 27B parameter variants) and the original Gemma series (2B and 7B). Both families run natively on Ollama with a single command.
Available Gemma Models on Ollama
Ollama supports six Gemma model variants across two generations. Each uses Google’s open-weight license and can run entirely offline once downloaded.
| Model Name | Parameters | Ollama Command | Min. VRAM (Q4) | Context Length |
|---|---|---|---|---|
| Gemma 2 27B | 27 billion | ollama run gemma2:27b | 16 GB | 8,192 tokens |
| Gemma 2 9B | 9 billion | ollama run gemma2:9b | 6 GB | 8,192 tokens |
| Gemma 2 2B | 2 billion | ollama run gemma2:2b | 2 GB | 8,192 tokens |
| Gemma 7B | 7 billion | ollama run gemma:7b | 5 GB | 8,192 tokens |
| Gemma 2B | 2 billion | ollama run gemma:2b | 2 GB | 8,192 tokens |
| Gemma 2B Instruct | 2 billion | ollama run gemma:2b-instruct | 2 GB | 8,192 tokens |
The Gemma 2 series offers better performance per parameter than the original Gemma models. For most users, gemma2:9b provides the best balance of quality and hardware requirements. You can see how these models compare to alternatives in the LLM leaderboard.
Installing and Running Gemma Models
First, ensure Ollama is installed on your system. If you haven’t installed it yet, follow the Ollama installation guide for your platform. Once installed, running any Gemma model requires a single command that downloads and launches the model automatically.
macOS and Linux
Open Terminal and run:
ollama run gemma2:9bThis downloads the 9B parameter Gemma 2 model (approximately 5.5 GB for the 4-bit quantized version) and starts an interactive chat session. To use a different size:
# For 27B (highest quality, needs 16GB+ VRAM)
ollama run gemma2:27b
# For 2B (fastest, runs on 4GB GPUs)
ollama run gemma2:2b
# Original Gemma 7B
ollama run gemma:7bWindows
Open Command Prompt or PowerShell and use the same commands:
ollama run gemma2:9bWindows users with NVIDIA GPUs should ensure their GPU drivers are up to date for optimal performance. AMD GPU support through ROCm works on Linux but remains experimental on Windows as of August 2026.
Running as an API Server
To run Gemma as a persistent API service instead of an interactive chat:
# Start Ollama server (runs automatically on macOS/Linux, manual on Windows)
ollama serve
# In another terminal, pull the model without starting chat
ollama pull gemma2:9b
# Make API requests
curl http://localhost:11434/api/generate -d '{
"model": "gemma2:9b",
"prompt": "Explain quantum entanglement in simple terms.",
"stream": false
}'This approach works identically across all platforms and integrates with OpenAI-compatible libraries by pointing them to http://localhost:11434.
System Requirements and Performance
Gemma models run efficiently on consumer hardware thanks to Ollama’s optimizations and quantization. The VRAM requirements vary significantly by model size and quantization level.
| Model | Full Precision (FP16) | 4-bit Quantized (Q4) | Tokens/Second (RTX 4090) |
|---|---|---|---|
| Gemma 2 27B | 54 GB | 16 GB | 22-28 t/s |
| Gemma 2 9B | 18 GB | 6 GB | 45-60 t/s |
| Gemma 2 2B | 4 GB | 2 GB | 120-150 t/s |
| Gemma 7B | 14 GB | 5 GB | 40-55 t/s |
By default, Ollama downloads 4-bit quantized versions that reduce memory usage by 75% with minimal quality loss. Calculate exact VRAM needs for your hardware using the VRAM calculator, which accounts for context length and batch size. For a comprehensive breakdown of memory requirements across models, see VRAM requirements by model.
Recommended GPUs
- RTX 4060 Ti 16GB / RTX 3090: Can run Gemma 2 27B at Q4 quantization with full context windows.
- RTX 4070 / RX 7800 XT: Ideal for Gemma 2 9B with headroom for long conversations.
- RTX 4060 / RTX 3060: Handles Gemma 2 2B and Gemma 7B comfortably.
- Integrated GPUs (Apple Silicon, Intel Arc): Gemma 2 2B runs well on M1/M2 Macs and recent Intel Arc GPUs with 16GB+ unified memory.
For detailed GPU recommendations and performance benchmarks, consult the best GPUs for running LLMs locally guide.
Choosing Between Gemma Models
The right Gemma model depends on your use case, hardware, and quality requirements. Gemma 2 models consistently outperform their predecessors across reasoning, instruction-following, and coding tasks.
Gemma 2 27B competes with much larger models in quality but requires substantial VRAM. Use it for complex reasoning, technical writing, or code generation where accuracy matters more than speed. It’s comparable to 70B models from other families in many benchmarks.
Gemma 2 9B is the sweet spot for most developers. It runs on mid-range GPUs, delivers strong performance across general tasks, and generates responses fast enough for interactive applications. This is the model to start with unless you have specific constraints.
Gemma 2 2B excels at high-throughput scenarios: batch processing, edge deployment, or running multiple agents simultaneously. While less capable than larger variants, it’s surprisingly competent for structured data extraction, classification, and simple dialog.
The original Gemma 7B and 2B remain available but offer no advantages over Gemma 2 except slightly lower VRAM usage at equivalent sizes. New projects should default to Gemma 2.
For more options, explore the complete Ollama models list or see best local models for Ollama for alternatives like Llama, Mistral, and Qwen.
Model Configuration and Optimization
Ollama exposes several parameters to tune Gemma’s behavior and performance. Create a Modelfile to customize settings:
FROM gemma2:9b
# Set temperature (0.0 = deterministic, 1.0 = creative)
PARAMETER temperature 0.7
# Limit response length
PARAMETER num_predict 512
# Set system prompt
SYSTEM You are a technical documentation assistant. Provide accurate, concise answers with code examples.Load your custom configuration:
ollama create my-gemma -f ./Modelfile
ollama run my-gemmaKey parameters include:
temperature: Controls randomness (0.1-0.3 for factual tasks, 0.7-0.9 for creative work)top_p: Nucleus sampling threshold (0.9 default, lower for more focused outputs)num_predict: Maximum tokens to generate (-1 for unlimited, 512-2048 typical)num_ctx: Context window size (2048-8192, higher uses more VRAM)
For cost comparison between running Gemma locally versus using hosted APIs, use the self-hosting vs API calculator to find your break-even point.
Integration with Development Tools
Gemma models on Ollama work with standard LLM libraries by pointing them to the local Ollama endpoint. Here’s how to integrate with popular frameworks:
Python (LangChain)
from langchain_community.llms import Ollama
llm = Ollama(model="gemma2:9b")
response = llm.invoke("Write a Python function to calculate Fibonacci numbers.")
print(response)JavaScript (LangChain.js)
import { Ollama } from "@langchain/community/llms/ollama";
const llm = new Ollama({
baseUrl: "http://localhost:11434",
model: "gemma2:9b",
});
const response = await llm.invoke("Explain async/await in JavaScript.");
console.log(response);OpenAI-Compatible Clients
Many libraries support OpenAI’s API format. Configure them to use Ollama:
import openai
client = openai.OpenAI(
base_url="http://localhost:11434/v1",
api_key="ollama" # required but ignored
)
response = client.chat.completions.create(
model="gemma2:9b",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)Troubleshooting Common Issues
Model downloads fail or timeout: Gemma models range from 1.5 GB (2B quantized) to 54 GB (27B full precision). On slow connections, use ollama pull gemma2:9b in a dedicated terminal to monitor download progress. Partial downloads resume automatically if interrupted.
Out of memory errors: If Ollama crashes or refuses to load a model, your GPU lacks sufficient VRAM. Drop to a smaller model (gemma2:2b instead of 9b) or reduce context window with PARAMETER num_ctx 2048 in a custom Modelfile. Check actual requirements with the VRAM calculator.
Slow generation on Apple Silicon: Ensure Metal acceleration is enabled. Ollama uses Metal by default on macOS, but older Ollama versions may fall back to CPU. Update to the latest version with brew upgrade ollama or reinstall from the Ollama website.
API returns empty responses: Check that ollama serve is running and accessible at http://localhost:11434. Test with curl http://localhost:11434/api/tags to list available models. If the model doesn’t appear, run ollama pull gemma2:9b first.
Windows GPU not detected: Ollama requires NVIDIA GPUs with CUDA support or AMD GPUs with ROCm (Linux only). Update your GPU drivers through Device Manager or from the manufacturer’s website. Check detection with nvidia-smi (NVIDIA) or rocm-smi (AMD).
Frequently Asked Questions
Is there a Gemma 4 model available?
No. As of August 2026, Google DeepMind has released Gemma (2B, 7B) and Gemma 2 (2B, 9B, 27B), but no Gemma 4 exists. The “2” in Gemma 2 refers to the second generation of the model family, not the parameter count. When searching for “Gemma 4,” you likely want the latest models: Gemma 2 27B for maximum quality, Gemma 2 9B for balanced performance, or Gemma 2 2B for resource-constrained environments.
What’s the difference between Gemma and Gemma 2?
Gemma 2 is the second-generation architecture with significant improvements in reasoning, instruction-following, and multilingual capabilities. Gemma 2 models achieve comparable quality to larger first-generation models while using less memory and generating faster. For example, Gemma 2 9B matches or exceeds the original Gemma 7B across most benchmarks. Unless you have a specific reason to use the original Gemma series, start with Gemma 2.
Can I use Gemma models commercially?
Yes. Gemma models use Google’s open-weight license that permits commercial use, modification, and distribution. Unlike some open models with research-only licenses, you can deploy Gemma in production applications, SaaS products, or enterprise systems without additional licensing. The only restriction is you cannot use Gemma’s name to imply Google endorsement of your product.
How does Gemma 2 9B compare to Llama 3 8B on Ollama?
Both models run well on similar hardware (6-8 GB VRAM), but they have different strengths. Gemma 2 9B generally performs better on instruction-following and structured output tasks, making it preferable for tool use, JSON generation, and agent applications. Llama 3 8B tends to produce more natural conversational responses and handles creative writing slightly better. For technical and coding tasks, most developers find Gemma 2 9B more reliable. Benchmark both for your specific use case since quality perception varies by application.
Do I need to pay to run Gemma models on Ollama?
No. Ollama is free, open-source software, and Gemma models are released with open weights at no cost. You only pay for the hardware (GPU, RAM, electricity) needed to run them. For usage cost comparisons, the API cost calculator shows when local hosting becomes more economical than cloud APIs. Most developers running more than 10,000 queries per month save money by self-hosting Gemma instead of using commercial APIs.
Can Gemma models run without a GPU?
Yes, but it’s slow. Ollama falls back to CPU execution when no compatible GPU is detected. Gemma 2 2B runs at 3-8 tokens per second on modern CPUs (Ryzen 5000+ or Intel 12th gen+), which is usable for occasional queries but frustrating for interactive chat. Gemma 2 9B and larger models generate less than 2 tokens per second on CPU, making them impractical. For serious local LLM use, invest in a GPU—even a budget RTX 3060 or used RTX 2080 dramatically improves the experience. See hardware recommendations in the Ollama complete guide.

