If a local model's answers feel too random, too repetitive or too bland, the fix is often a sampling setting rather than a different model. Ollama exposes several of these: temperature, top_k, top_p and min_p, plus seed and repeat_penalty. They all affect how the model picks each next word (token), but in different ways. This comparison is based on Ollama's Modelfile and API documentation. It hasn't involved testing particular models on our hardware, and the right values depend on the model and the task, so treat the numbers below as Ollama's documented defaults and examples, not recommendations.
The short version
Setting | What Ollama says it does | Documented default |
|---|---|---|
temperature | Increasing it makes the model answer more creatively | 0.8 |
top_k | Reduces the probability of generating nonsense; higher (e.g. 100) gives more diverse answers, lower (e.g. 10) is more conservative | 40 |
top_p | Works together with top_k; higher (e.g. 0.95) gives more diverse text, lower (e.g. 0.5) more focused, conservative text | 0.9 |
min_p | An alternative to top_p, aiming to balance quality and variety | 0.0 |
seed | A fixed number makes the model generate the same text for the same prompt | 0 |
repeat_penalty | How strongly to penalise repetition; higher (e.g. 1.5) is stricter, lower (e.g. 0.9) more lenient | 1.0 (disabled) |
One caveat: a model's own Modelfile can set its own PARAMETER values, so the settings a particular model actually uses may differ from these general defaults.
Temperature: the creativity dial
Temperature is the setting most people reach for first. Ollama's description is simple: increasing it makes the model answer more creatively. Lower it for tasks where you want consistent, predictable answers, such as extracting data or answering factual questions about a document. Raise it for brainstorming or creative writing, where variety matters more than consistency.
Top-k: limit the shortlist
Top-k caps how many candidate tokens the model considers at each step. A low value such as 10 keeps the model to its most likely choices, which Ollama describes as more conservative. A high value such as 100 lets it consider more options, giving more diverse answers.




