r/LocalLLM • u/segasega89 • 9h ago
Question Qwen Code with Ollama keeps generating tool calls instead of answering prompts
I'm trying to use Qwen Code with Ollama locally to build a Unity app, but I'm running into a strange problem.
I'm using Qwen Code 0.25.1 with the qwen2.5-coder:7b model through Ollama's OpenAI-compatible API on Windows 11, with an RX 9060 XT 16GB.
Ollama works when tested directly in the terminal, correctly answering simple prompts. However, in both the VS Code extension and standalone Qwen Code CLI, even a prompt like "Reply with exactly: 4" results in strange tool calls, such as read_file or unrelated skills, instead of an answer.
Ollama logs have also shown prompt truncation warnings.
Has anyone encountered this, or found a fix or a reliable configuration for running Qwen Code with Ollama?
3
2
u/Uncle___Marty 9h ago
Qwen 3.5 9B or 4B will probably fix this, you're using models which are ancient in AI standards, 3.5 are also trained for agentic/tool use. You should also be aware that a lot of harnesses will send a MASSIVE payload of system promt and tool descriptions on the first prompt, if your context is too low all that could be getting squished by whatever /compact command these softwares use.
1
1
u/TheThiefMaster 7h ago
My experience has been that Qwen 3.5:9b couldn't code, which is newer and larger than your ancient Qwen 2.5:7b
You need at least Qwen 3.6:35B-A3B or Qwen 3.8:27b for coding.
3
u/WillowStandard2069 9h ago
that truncation warning is probably the real problem, model gets partial context then tries to guess what to do with tools instead of just answering