Bake a system prompt into a custom Gemma 4 model

run with ollama

// what it does

A Modelfile layers configuration onto a base tag: FROM sets the parent, SYSTEM sets a persistent system prompt, and PARAMETER pins sampling defaults. ollama create bakes it into a named model you run like any other. FROM can also point at a local fine-tuned .gguf file to import your own weights.

// shell

$ printf 'FROM gemma4\nSYSTEM "You are a terse coding assistant."\n' > Modelfile
$ ollama create mygemma -f Modelfile
$ ollama run mygemma

// gotcha

Ollama's SYSTEM directive maps onto Gemma 4's first user turn, since Gemma has no separate system role — a very long system prompt eats the same context budget as the conversation itself.

// resources