A seed fixes the random choices a model makes during sampling, so the same prompt and seed should give the same output. That matters when you want to repeat a test or compare two settings fairly. Not every tool exposes a seed, and some change the result anyway when the model or hardware changes, so verify it on your own setup.
Checked on 2026-11-29. We did not run any tool for this guide. Every result below is an expected result, marked UNTESTED, for you to confirm on your own files.
Prerequisites
- A model or API that accepts a seed value
- One prompt to test with
- A way to save the two outputs for comparison
Steps
1. Set the seed and run once
Set the seed to 0 and run the prompt, then save the full output.
Expected result: One output is saved with seed 0.
2. Run again with the same seed
Run the exact same prompt with the same seed and save the output again.
Expected result: A second output is saved with seed 0.
3. Compare the two outputs
Compare them word for word. Identical outputs confirm the seed works on this setup.
Expected result: The two outputs are marked identical or different, with any differing line noted.
4. Record the seed with the result
Write the seed next to any result you keep, so someone else can repeat the run.
Expected result: The seed value is stored with the output and the prompt.
Worked example
A practice prompt asked for a two-sentence summary. It was run twice with seed 0 and once with seed 7.
| Run | Seed | Output matches first? |
|---|---|---|
| Run 1 | 0 | Yes |
| Run 2 | 0 | Yes |
| Run 3 | 7 | No |
Expected result: The two seed 0 runs match word for word and the seed 7 run differs, so the seed works on this setup (UNTESTED – confirm it yourself.)
Verdict table
| Check | Expected result | Pass? |
|---|---|---|
| Set the seed and run once | One output is saved with seed 0. | – |
| Run again with the same seed | A second output is saved with seed 0. | – |
| Compare the two outputs | The two outputs are marked identical or different, with any differing line noted. | – |
| Record the seed with the result | The seed value is stored with the output and the prompt. | – |
Limits
- A seed does not guarantee the same output after a model update or on different hardware.
- Some APIs ignore the seed silently, so always test it before relying on it.
Sources
- Ollama v0.12.6 release notes – checked 2026-11-29
- Ollama v0.12.10 release notes – checked 2026-11-29
- Ollama v0.11.0 release notes – checked 2026-11-29
