Max token question #61

Open
opened 2026-02-15 16:27:48 -05:00 by yindo · 2 comments
Owner

Originally created by @tonyphoang on GitHub (Mar 27, 2024).

How do you set the max token with ollama python?
My code doesn't seem to work. Thanks!
output=ollama.chat(model='my_model',max_token=5, messages=[])

Originally created by @tonyphoang on GitHub (Mar 27, 2024). How do you set the max token with ollama python? My code doesn't seem to work. Thanks! `output=ollama.chat(model='my_model',max_token=5, messages=[])`
Author
Owner

@cyx2000 commented on GitHub (Mar 30, 2024):

set it in options, like this
image

@cyx2000 commented on GitHub (Mar 30, 2024): set it in options, like this ![image](https://github.com/ollama/ollama-python/assets/56961601/79a46d0f-b439-4265-9229-ccebeb6547de)
Author
Owner

@hasan-sayeed commented on GitHub (Dec 5, 2024):

@cyx2000, I was facing the same issue. Your suggestion worked. Thanks!

@hasan-sayeed commented on GitHub (Dec 5, 2024): @cyx2000, I was facing the same issue. Your suggestion worked. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#61