Prototype Gemma 3 12B Free on NVIDIA NIM
NVIDIA NIM hosts google/gemma-3-12b-it on its live DGX Cloud catalog with no credit card required for developer prototyping — ideal if you want to test multimodal Gemma 3 12B before downloading ~8 GB of GGUF weights locally. Use NVIDIA NIM with your free NVIDIA_API_KEY and the OpenAI SDK before downloading 8 GB of GGUF weights locally.
import os
from openai import OpenAI
client = OpenAI(
base_url="https://integrate.api.nvidia.com/v1",
api_key=os.environ["NVIDIA_API_KEY"],
)
r = client.chat.completions.create(
model="google/gemma-3-12b-it",
messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)curl https://integrate.api.nvidia.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $NVIDIA_API_KEY" \
-d '{"model":"google/gemma-3-12b-it","messages":[{"role":"user","content":"Hello"}]}'# Requires Ollama v0.6+ for native Gemma 3 vision support
ollama run gemma3:12b
# Inside the prompt, pass a local image path directly:
# Describe the layout issues in ./screenshot.pngRun Gemma 3 12B Locally With Vision
Google's Gemma 3 12B (google/gemma-3-12b-it) bridges the gap between compact 8B models and heavy 24B+ checkpoints while adding native multimodal image understanding and a 128K context window. Note its architectural trade-off: 48 layers with a 256 head dimension produce a larger KV cache (0.375 MB/token at FP16), so long contexts consume noticeably more VRAM than on 8B models.
Run ollama run gemma3:12b (~11.4 GB at Q4_K_M, 8K context) on a 12–16 GB GPU or 24 GB Apple Silicon Mac, or download Gemma 3 12B GGUF files in LM Studio and llama.cpp (which also support vision projectors for image prompts).
Why Gemma 3 12B Uses More KV Cache at Long Context
With 48 layers and a 256 head dimension, Gemma 3 12B consumes 0.375 MB of FP16 KV cache per token — three times more per token than Llama 3.1 8B. On a 12 GB RTX 4070, 8K context fits cleanly, while 16K–32K prompts require either a 16–24 GB card or KV cache quantization (such as q8_0 KV cache in Ollama or llama.cpp).
| Context Length | FP16 KV Cache | Total at Q4_K_M | Minimum Fitting Hardware |
|---|---|---|---|
| 4K | 1.5 GB | 9.9 GB | 12 GB GPU (RTX 4070) |
| 8K | 3.0 GB | 11.4 GB | 12 GB GPU (RTX 4070) |
| 16K | 6.0 GB | 14.4 GB | 16 GB GPU (RTX 4060 Ti 16GB) |
| 32K | 12.0 GB | 20.4 GB | 24 GB GPU (RTX 4090) or KV quant |
Memory Needed per Quantization
| Quantization | Weights | Total at 8K | Fits on |
|---|---|---|---|
| FP16 | 24.4 GB | 29.2 GB | Mac Studio 128GB, Mac Studio 64GB, RTX 5090 |
| Q4_K_M | 7.4 GB | 11.4 GB | Mac mini 24GB, Mac Studio 128GB, Mac Studio 64GB, RTX 4060 Ti 16GB, RTX 4070, RTX 4090, RTX 5090 |
| Q5_K_M | 8.7 GB | 12.7 GB | Mac mini 24GB, Mac Studio 128GB, Mac Studio 64GB, RTX 4060 Ti 16GB, RTX 4090, RTX 5090 |
| Q8_0 | 13.0 GB | 17.2 GB | Mac mini 24GB, Mac Studio 128GB, Mac Studio 64GB, RTX 4090, RTX 5090 |
Gemma Terms of Use Summary
Allows commercial and research use under the Gemma Terms of Use, subject to Google's Prohibited Use Policy and redistribution notice. Review the full terms at ai.google.dev/gemma/….