Limit the number of generated tokens? #220

Closed
opened 2026-02-15 16:28:51 -05:00 by yindo · 1 comment
Owner

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).

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).
yindo closed this issue 2026-02-15 16:28:51 -05:00
Author
Owner

@ParthSareen commented on GitHub (Feb 12, 2025):

You can use options.num_predict for now: https://github.com/ollama/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values

@ParthSareen commented on GitHub (Feb 12, 2025): You can use `options.num_predict` for now: https://github.com/ollama/ollama/blob/main/docs/modelfile.md#valid-parameters-and-values
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#220