GoodPrompts
Main navigation
Model guides

Prompting Gemma

Choose a local Gemma checkpoint and use the matching runtime, chat template and input format.

Sources checked Official documentationlocal · api

Model selection

Model or serviceUse caseModel ID or access
Gemma 4 E2B / E4BSmall-device experimentsModel card
Gemma 4 12BMedium local deploymentModel card
Gemma 4 26B A4B / 31BWorkstation and server deploymentModel card

Which model to choose

Match the checkpoint and quantization to available memory, then measure quality on your own examples. Keep a record of the exact weights and runtime version.

Using the chat or local app

In a local model app, verify which checkpoint is loaded. Start with a short task, one source passage and a concrete expected answer shape.

Using the API

Apply the checkpoint's chat template through the runtime or tokenizer. The local server decides the request format and model alias. Confirm its advertised capabilities before sending media.

Python · Transformers tokenizer

from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("YOUR_GEMMA_CHECKPOINT")
messages = [{"role": "user", "content": "Summarize this incident: {{incident}}"}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)

Prompting advice

  • Keep the supplied context focused when testing smaller checkpoints.
  • Recheck output quality after changing quantization or chat serialization.
  • Gemma 4 has its own system, reasoning and tool tokens. Use its checkpoint template rather than carrying forward Gemma 1–3 turn markers.

Example prompt template

Read {{incident}}. Return three lines: observed symptom, stated cause and next action. Use “not stated” for missing details.

Sources