think flag has no effect when using qwen3:8b
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.5k
- Forks
- 1.2k
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Description
Passing the think parameter to chat() or AsyncClient.chat() doesn’t appear to change the output or behavior when using the qwen3:8b model.
Environment:
- ollama-python: 0.5.4
- ollama version: 0.11.8
My test code:
import asyncio
from ollama import AsyncClient, ChatResponse, chat
async def async_run_chat(think_flag: bool):
client = AsyncClient(host="http://localhost:11434") # change host if remote
prompt = "Give me a concise explanation of why the sky appears blue."
print(f"\n🔎 Starting chat with think={think_flag}\n")
async for chunk in await client.chat(
model="qwen3:8b", # or any installed model
messages=[{"role": "user", "content": prompt}],
stream=True,
think=think_flag, # ✅ direct parameter, no options dict
):
text_piece = chunk.get("message", {}).get("content", "")
if text_piece:
print(text_piece, end="", flush=True)
print("\n✅ Done!\n")
def stream_run_chat(think_flag: bool):
stream = chat(
model='qwen3:8b',
messages=[{'role': 'user', 'content': 'Why is the sky blue?'}],
stream=True,
think=think_flag
)
for chunk in stream:
print(chunk['message']['content'], end='', flush=True)
def non_stream_run_chat(think_flag: bool):
response: ChatResponse = chat(
model='qwen3:8b',
messages=[
{
'role': 'user',
'content': 'Why is the sky blue?',
},
],
think=think_flag
)
print(response['message']['content'])
if __name__ == "__main__":
# asyncio.run(async_run_chat(think_flag=False))
# stream_run_chat(think_flag=False)
non_stream_run_chat(think_flag=False)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the think parameter through chat() and AsyncClient.chat() request construction, then compare the supplied streaming and non-streaming examples with qwen3:8b. Check whether the parameter reaches Ollama as intended and verify that think=True and think=False produce observably different behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100