Fixing empty Ollama replies in a meeting-minutes-to-tasks script
- Hardware
- Windows 11, 16 GB RTX 5060 Ti
- Models & engines
- Ollama 0.40.14, OpenAI-compatible /v1/chat/completions endpoint
qwen3.5:9b, also tested qwen3.5:4b and gemma4:12b - Key gotcha
- --hidethinking only hides the trace on screen; the model still reasons and spends context
What they built
Davidrs had a small script that turns meeting minutes into a JSON task list, calling qwen3.5:9b through Ollama's OpenAI-compatible endpoint on a Windows 11 PC with a 16 GB RTX 5060 Ti.
Every call hung for about a minute and came back empty, and the script failed with "not valid JSON". Ollama hadn't errored: the reasoning model used the whole context thinking, leaving no room for the answer. The post walks through how they spotted it and fixed it.
Setup
- Windows 11, 16 GB RTX 5060 Ti
- Ollama 0.40.14, OpenAI-compatible /v1/chat/completions endpoint
- qwen3.5:9b, also tested qwen3.5:4b and gemma4:12b
- PowerShell with Invoke-RestMethod
How it works
- The tell: empty content, latency near 60 s, completion_tokens 3,661 and total_tokens exactly 4,096, and truncated = 1 in the server log
- On GPUs under 24 GiB of VRAM, Ollama's default context is 4,096 tokens
- Check /api/show for the thinking capability, then switch reasoning off per API, or keep it and give the model more context
- Make empty content raise an error instead of saving a blank row, and request JSON through the API rather than in the prompt
Results & numbers
- With reasoning_effort set to none, the same minutes came back in 3.6 seconds with valid JSON
- With the JSON format forced, three models across five cases and three repetitions gave 45 valid responses out of 45
- Forcing the format took qwen3.5:9b from 14 to 21 of 24 criteria on the minutes-to-tasks test; gemma4:12b passed the minutes with no warnings in 11.2 s
Gotchas
- --hidethinking only hides the trace on screen; the model still reasons and spends context
- The OpenAI-compatible endpoint won't take num_ctx per request, so set it server-wide or in a Modelfile
- Asking for JSON only in the prompt sometimes produced invalid JSON such as a number with a leading zero
- Valid JSON is not correct JSON: qwen3.5:9b left owner and due-date fields blank instead of writing PENDING, so keep validating fields in code
“It had reasoned until it ran out of room, and there was no context left for the answer.”— Davidrs
Do it yourself
- Compare usage tokens to your context size when you get an empty reply
- Check whether your model lists thinking in /api/show
- Send "reasoning_effort": "none" on /v1/chat/completions, or "think": false on /api/chat
- If you need reasoning, create a model with PARAMETER num_ctx 16384 and set a timeout
- Request JSON with response_format json_object (or format json natively) and raise an error on empty content
FROM qwen3.5:9b
PARAMETER num_ctx 16384
# ollama create qwen9b-16k -f .\ModelfileSimilar setups
PromptCI: regression-testing LLM prompts offline against Ollama
Soumyabrata Mukherjee built PromptCI so freelancers can catch prompt changes that silently break client workflows, running YAML-defined pipelines and output checks against open-weight models on a laptop, with no API keys or cloud bills.
Getting OpenCode to work with a local Ollama model by fixing the 4,096-token context
OpenCode on a local Ollama model ignored files, invented tasks or looped, because each ~23k-token request was silently cut to fit Ollama's default 4,096-token context on a 16 GB GPU.
PatchPal TinyAgent: a coding agent on a 4B model and a 6GB laptop GPU
WiseProbe adapted its PatchPal coding agent to run Gemma 4 E4B or Qwen3.5 4B through Ollama on a 6GB RTX A1000, using handoff-note compaction and capped file reads to work inside a 16K or 32K window.
Local AI: a one-click Windows app that picks a model for your PC and sets up Ollama for friends
Tired of setting up local LLMs for friends, a developer built a free MIT-licensed Windows app that detects your GPU and RAM, installs Ollama without admin rights, pulls a fitting model and opens a private chat.