Does chat take options? #19

Closed
opened 2026-02-15 16:27:31 -05:00 by yindo · 4 comments
Owner

Originally created by @tmceld on GitHub (Jan 31, 2024).

Hi,

I'm trying to keep hallucinations down, so was playing around with temperature top_p and top_k:

foo = ollama.chat(model='llama2', options={"temperature": 0.1, "top_p": 0.10, "top_k": 1}, messages=[{'role': 'system', 'content': systemStr},

but finding no discernable difference, when it struck me that maybe chat, unlike generate, doesn't take options?

is this the case? I am using chat as i want to send messages

Originally created by @tmceld on GitHub (Jan 31, 2024). Hi, I'm trying to keep hallucinations down, so was playing around with `temperature` `top_p` and `top_k`: `foo = ollama.chat(model='llama2', options={"temperature": 0.1, "top_p": 0.10, "top_k": 1}, messages=[{'role': 'system', 'content': systemStr}, ` but finding no discernable difference, when it struck me that maybe chat, unlike generate, doesn't take options? is this the case? I am using chat as i want to send `messages`
yindo closed this issue 2026-02-15 16:27:31 -05:00
Author
Owner

@mxyng commented on GitHub (Jan 31, 2024):

It does. You can verify this by setting something like temperature=0 which will produce the same output each time

@mxyng commented on GitHub (Jan 31, 2024): It does. You can verify this by setting something like `temperature=0` which will produce the same output each time
Author
Owner

@tmceld commented on GitHub (Feb 1, 2024):

Firstly, thank you for your reply, but I am still not any wiser - i was setting something like temperature=0 i was passing it as a dictionary options={"temperature": 0.1} I wonder, in terms of a chat call, where i set it?

@tmceld commented on GitHub (Feb 1, 2024): Firstly, thank you for your reply, but I am still not any wiser - i was setting something like `temperature=0` i was passing it as a dictionary `options={"temperature": 0.1}` I wonder, in terms of a chat call, where i set it?
Author
Owner

@joelewing commented on GitHub (Feb 21, 2024):

@tmceld I found an example here: https://github.com/ollama/ollama-python/blob/main/examples/fill-in-middle/main.py#L16

@joelewing commented on GitHub (Feb 21, 2024): @tmceld I found an example here: https://github.com/ollama/ollama-python/blob/main/examples/fill-in-middle/main.py#L16
Author
Owner

@tmceld commented on GitHub (Feb 23, 2024):

thanks @joelewing i had found examples on the generate endpoint, but i was wondering about the chat endpoint

@tmceld commented on GitHub (Feb 23, 2024): thanks @joelewing i had found examples on the generate endpoint, but i was wondering about the chat endpoint
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#19