Modelfile Parameters in Ollama
From the Ollama cheat sheet · Modelfile · verified Jul 2026
Modelfile Parameters
Reference for common model parameters and their effects.
bash
# Key parameters for PARAMETER instruction
PARAMETER temperature 0.7 # Creativity (0.0-2.0, default ~0.8)
PARAMETER num_ctx 4096 # Context window size in tokens
PARAMETER top_p 0.9 # Nucleus sampling threshold
PARAMETER top_k 40 # Top-K sampling
PARAMETER repeat_penalty 1.1 # Penalize repetition (1.0 = off)
PARAMETER seed 42 # Reproducible output💡 temperature 0 gives deterministic output; 1.0+ increases creativity
⚡ Increase num_ctx for longer conversations but be aware of memory limits
📌 Use seed for reproducible responses — same seed + prompt = same output
🟢 stop sequences tell the model when to stop generating text
parametersconfig