How to get repeatable results using seed
How to get repeatable results using seed
The seed parameter enables best-effort repeatability for the same prompt and
settings. It does not guarantee identical output.
Use it to reduce variation during testing and debugging, while allowing for outputs to change between requests or model updates.
What it does:
- The same seed and request parameters can reduce output variation.
- Identical requests can still produce different outputs.
- Model or serving updates can change results produced by a previously used seed.
- This feature is currently in Beta.
In recent testing, setting seed did not measurably reduce output variation compared to
omitting it, repeated requests with the same seed varied as much as requests with no
seed at all. Treat seed as best-effort only, and do not rely on it for reproducibility
until this is confirmed fixed.
Format and Range:
š Typically, values like 42, 1234, or any stable number will work fine.
When to use seed:
First, install the SDK:
Then use the following Python code: