can we pass a seed value to the LLM to always have...
# ask-ai
a
can we pass a seed value to the LLM to always have the same response?
t
Thanks for reaching out, Cesar. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Yes, you can pass a seed value to the LLM to ensure consistent responses. The seed initializes the random number generator, which affects the text generation process. By setting a specific seed, you can obtain reproducible results across multiple runs with the same input and settings. Here’s how you can set the seed: • Command Line Argument: Use
--seed SEED
. For example:
--seed 42
. • JSON Configuration: Include the seed in the JSON configuration. For example:
Copy code
{
  "n_predict": 256,
  "seed": 42,
  ...
}
If the seed is set to a value less than 0, a random seed will be used, resulting in different outputs on each run. Sources: tools/server/server.cpp