mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
Limit the number of generated tokens? #220
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @larsbun on GitHub (Feb 12, 2025).
Is it possible to limit the number of tokens generated when you query the model? (If not, that is a feature request).
@ParthSareen commented on GitHub (Feb 12, 2025):
You can use
options.num_predictfor now: https://github.com/ollama/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values