About Gemma
Gemma is Google DeepMind's family of open-weight generative models, built from research and technology shared with Gemini. The weights can be downloaded and run with supported local and hosted inference tools. Gemma is a model family for developers and researchers; it is separate from Google's Gemini API model family.
Gemma 4 is the current core generation, with E2B and E4B sizes for edge devices, a 12B unified model, a 26B A4B mixture-of-experts model, and a 31B dense model. All accept text and images, and video is processed as a sequence of frames. E2B, E4B, and 12B also accept audio. Context length and memory needs depend on the size; Google's estimates cover model weights and exclude runtime and context overhead. See the Gemma 4 model card for the full input limits and deployment guidance.
Gemma 1, Gemma 2, and Gemma 3 use the Gemma Terms of Use; Gemma 4 uses Apache 2.0. Google also publishes specialized families such as PaliGemma, RecurrentGemma, FunctionGemma, and EmbeddingGemma. Their task and input requirements differ from the core generative models listed here; browse the Gemma documentation for those model cards.
How to prompt Gemma
- 01
Use the checkpoint's chat template
Instruction-tuned Gemma checkpoints use model-specific chat formatting. Let your inference library apply the matching template, especially when moving between generations.
- 02
Choose a size for your hardware
Gemma 4 E2B and E4B target phones and edge devices; 12B is aimed at laptops with about 16 GB of memory; 26B A4B activates about 3.8B parameters per token for speed; 31B is the dense option for quality and fine-tuning.
- 03
Name the job for each input
For image, video, or audio tasks, say what to inspect and the form of the answer you need. Audio input is available on Gemma 4 E2B, E4B, and 12B; video is processed as frames.
- 04
Set thinking deliberately
Gemma 4 supports configurable thinking. Use the documented thinking format for your checkpoint and runtime, and request a concise final answer when you do not need a detailed explanation.
- 05
Start with the documented sampler values
Google's Gemma 4 guidance starts with
temperature=1.0,top_p=0.95, andtop_k=64. Adjust them for your task and serving framework.
Anatomy of a great prompt
Task: {{task}}
Context: {{context}}
{{#if media}}Input media: {{media}}
{{/if}}Constraints: {{constraints}}
Return the result as {{output_format}}.