Controls randomness. Lower values (0.1–0.3) produce focused, deterministic output. Higher values (0.8–1.5) increase creativity and variety. Set to 0 for greedy decoding.
top_p
float
0–1
1.0
Nucleus sampling — only consider tokens with cumulative probability above this threshold. Lower values (0.1) make output more focused. Use either temperature or top_p, not both.
top_k
integer
1+
—
Only sample from the top K most likely tokens. Lower values constrain output. Not all models support this.
Avoid setting both temperature and top_p at the same time. Use one or the other for best results.