mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-20 14:14:26 -04:00
Think parameter does not seem to work with Qwen3 #275
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 @GuillaumeNachury on GitHub (Jun 6, 2025).
Originally assigned to: @drifkin on GitHub.
Based on this blog post https://ollama.com/blog/thinking the
thinkparameter should be working with theQwen3model.Using the latest version (0.5.1) of the lib:
Model:
qwen3:14bThen using the lib with streaming and tools but thinking disable
chat(self.default_model, messages, stream=True, think=False, tools=tools)The
<think>xxxxxx</think>block is always returned within the response.Is there there a known issue with this combination of model+options (tool/stream/think) ?
@michalmiki commented on GitHub (Jun 10, 2025):
I have encountered the same with qwen3:8b
@EdwardBurgin commented on GitHub (Jun 18, 2025):
I have the same observation reproduced with both CURL, requests and python
ollama version is 0.9.1-rc0
Ollama as a systemd service.
@EdwardBurgin commented on GitHub (Jun 19, 2025):
actually it seems they hard-coded 'think' to certain models, it works for deepseek-r1 (ie the 8b q4-km)
@mdrxy commented on GitHub (Jun 24, 2025):
@EdwardBurgin do you have any reference for this? Or just anecdotal testing?
@mdrxy commented on GitHub (Jun 25, 2025):
@GuillaumeNachury @michalmiki @EdwardBurgin are any of you able to provide more information to assist reproducing the issue? In my testing, I'm not experiencing this under the conditions y'all have outlined, nor any other combination I can come up with. Running package
ollama 0.5.1andollama: stable 0.9.2 (bottled), HEADinstalled with Homebrew.I've run, for both
qwen3:8bandqwen3:14b, all with a tool provided:think=False,stream=Truethink=False,stream=Falsethink=True,stream=Truethink=True,stream=FalseExample for
think=True,stream=True:Full response:
Plaintext:
@michalmiki commented on GitHub (Jun 27, 2025):
I tweaked your code a little:
and surprisingly this thing runs smoothly on my Mac mini but throws an error on Ubuntu VM with cuda.
@mdrxy commented on GitHub (Jun 27, 2025):
@michalmiki Just ran the code you provided, and all tests passed as expected for me. Is your Ollama client up to date (not just the package)?
Test response:
@michalmiki commented on GitHub (Jun 27, 2025):
Hey, yeah that solved the issue for me. Seems like you guys are updating it so fast that I missed one of the updates. Nice, updating Ollama (both python + linux package) solved issues for me. Sorry for bothering. Should have checked this earlier.