[GH-ISSUE #5738] How can I make the model produce consistent and stable results for the same prompt? #29333

Open
opened 2026-04-22 08:06:07 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @aitd0506 on GitHub (Jul 17, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/5738

What is the issue?

As the title suggests, my goal is to ensure that the model produces consistent and stable output for the same prompt.
I call the native gemma2:9b docker using the ollama-python lib API. I have explicitly modified the temperature to 0 and set a fixed seed in the Options, but I found that it did not work. The model still produces different results with multiple calls.
Is there an issue with the way I am using it? Has anyone encountered the same problem?

OS

Linux

GPU

Nvidia

CPU

Intel

Ollama version

ollama version is 0.2.1

Originally created by @aitd0506 on GitHub (Jul 17, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/5738 ### What is the issue? As the title suggests, my goal is to ensure that the model produces consistent and stable output for the same prompt. I call the native gemma2:9b docker using the ollama-python lib API. I have explicitly modified the temperature to 0 and set a fixed seed in the Options, but I found that it did not work. The model still produces different results with multiple calls. Is there an issue with the way I am using it? Has anyone encountered the same problem? ### OS Linux ### GPU Nvidia ### CPU Intel ### Ollama version ollama version is 0.2.1
GiteaMirror added the bug label 2026-04-22 08:06:07 -05:00
Author
Owner

@stuartofmine commented on GitHub (Jul 24, 2024):

same here. add 'PARAMETER temperature 0.0 ' in modelfile not work.

<!-- gh-comment-id:2247262479 --> @stuartofmine commented on GitHub (Jul 24, 2024): same here. add 'PARAMETER temperature 0.0 ' in modelfile not work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#29333