Ollama blank answers: separate thinking from final text
TL;DR: An empty Ollama answer can be a client reading the wrong field while a thinking model is still producing output. Keep thinking and answer text separate, wait for the final record, and inspect the stop reason before retrying. Check the model’s supported thinking controls rather than assuming think: false always disables reasoning.
What you’ll be able to do:
- Distinguish a thinking-only chunk from a completed answer.
- Inspect a saved native chat response without another inference request.
- Choose a controlled next test instead of repeatedly loading the same model.
Honest take: Fix the response reader before buying faster hardware or adding retries to an apparently blank chat window.
Why does Ollama show activity but no answer text?
Ollama thinking models can return reasoning output separately from the final answer. For the native chat endpoint, those fields are message.thinking and message.content. A chunk with thinking text and empty content is therefore not, by itself, a failed response. The official thinking documentation, checked November 13, 2026, explicitly describes that separation.
A chat interface that displays only message.content can look blank during the thinking phase. An interface that appends both fields into the same answer can show diagnostic reasoning where the final response belongs. Neither display tells you whether the model has completed the requested task. The response reader needs separate storage and separate completion state.
Start with the response you already have. Do not send another expensive prompt merely to discover that the first request was streaming normally. The inspection below needs only Python’s standard library and a saved response file. It does not require a GPU, another model download, a paid API, or a new subscription. Running the model itself has separate memory and compute requirements; this parser does not measure them.
Which response fields belong to each endpoint?
Native chat and native generate use different locations for final answer text. Mixing the two extraction rules can produce a blank result even after a successful request. The current chat reference and generate reference document the response structures.
| Native endpoint | Thinking text | Answer text | What a blank answer field establishes |
|---|---|---|---|
/api/chat | message.thinking | message.content | Only that this record contains no answer text |
/api/generate | thinking | response | Only that this record contains no answer text |
| Chat with tool calls | Inspect the message separately | May be empty | A tool handoff may require application handling |
The helper in this article accepts native chat records only. It is not an adapter for an SDK’s object types, a compatibility API, or a user interface’s own event format. Confirm the endpoint before changing field names. For JSON framing problems, use the existing native NDJSON parsing guide.
Keep each channel intact when accumulating chunks. A final record may contain no new text, while earlier records contain the answer. Reading only the last record discards that earlier output. Conversely, receiving some content before the connection ends does not prove that the complete answer arrived.
How can you check the model’s thinking settings?
Ollama’s current thinking guide recommends inspecting /api/show for the selected model’s supported values and default. Check the exact tag on the exact server used by your application. An unrelated model’s controls are not a reliable template.
curl http://localhost:11434/api/show -d '{"model":"YOUR_INSTALLED_MODEL"}'
Replace YOUR_INSTALLED_MODEL with an installed tag. In the returned JSON, look for the top-level thinking object and its values and default members. The documentation describes boolean controls as well as model-defined named levels. Use a supported value from this metadata; do not turn an arbitrary integer into a thinking level.
There is an important boundary in the current documentation: think: false requests no thinking output, but a model that cannot disable thinking uses its lowest supported level instead. A missing metadata object also does not prove that the model never thinks. Therefore, changing the flag and still seeing thinking activity is not sufficient evidence that your client or GPU is broken.
For a deliberate comparison, keep the model tag, prompt, server, and other options unchanged. Save the original request and response, then change only the supported thinking setting. Observe whether the answer channel is populated and whether the request finishes. That is a functional check; it is not a benchmark unless you also define and measure a performance experiment.
How do you inspect a saved native chat stream?
Parse every JSON record, accumulate the two channels independently, and require a final marker. Ollama’s streaming documentation describes the line-delimited native response. The following diagnostic reads a saved file; it does not make HTTP requests or restart generation.
Save this as inspect_chat.py:
import json
import sys
def inspect_chat(lines):
thoughts, answers = [], []
finished = False
reason = None
tool_calls = 0
for line in lines:
if not line.strip():
continue
if finished:
raise ValueError("data after final record")
event = json.loads(line)
if not isinstance(event, dict):
raise ValueError("expected an object")
if "error" in event:
raise ValueError("server error: " + str(event["error"]))
message = event.get("message", {})
if not isinstance(message, dict):
raise ValueError("message must be an object")
for key, destination in [("thinking", thoughts), ("content", answers)]:
value = message.get(key, "")
if not isinstance(value, str):
raise ValueError(key + " must be a string")
destination.append(value)
calls = message.get("tool_calls", [])
if not isinstance(calls, list):
raise ValueError("tool_calls must be an array")
tool_calls += len(calls)
if "done" in event and not isinstance(event["done"], bool):
raise ValueError("done must be a boolean")
if event.get("done") is True:
finished = True
reason = event.get("done_reason")
answer = "".join(answers)
if not finished:
status = "INCOMPLETE_STREAM"
elif reason == "length":
status = "OUTPUT_LIMIT"
elif tool_calls:
status = "TOOL_CALLS_NEED_HANDLING"
elif not answer.strip():
status = "NO_FINAL_TEXT"
elif reason != "stop":
status = "REVIEW_STOP_REASON"
else:
status = "ANSWER_PRESENT"
return {"status": status, "thinking_chars": len("".join(thoughts)),
"answer_chars": len(answer), "done_reason": reason,
"answer": answer}
if __name__ == "__main__":
with open(sys.argv[1], encoding="utf-8") as source:
print(json.dumps(inspect_chat(source), ensure_ascii=False))
Run it against a response captured by your existing client:
python3 inspect_chat.py chat-response.ndjson
The program counts thinking characters without printing their contents. It returns answer text separately from the diagnostic status. Treat that text as partial evidence until the status and your application checks permit using it. For large responses, the script retains accumulated text in memory; it is a small diagnostic tool rather than a bounded production streaming service.
The checker also rejects malformed message fields, explicit server errors, and records after a final marker. Those are inspection failures, not reasons to silently accept an empty answer. The error reference documents Ollama’s error responses; keep transport failures distinct from valid JSON records containing no visible answer.
What did the local test actually demonstrate?
A synthetic native-chat fixture tested the published reader on November 13, 2026. The fixture contained these records:
{"message":{"thinking":"..."},"done":false}
{"message":{"content":"Hello"},"done":false}
{"message":{},"done":true,"done_reason":"stop"}
Its output was:
{"status":"ANSWER_PRESENT","thinking_chars":3,"answer_chars":5,"done_reason":"stop","answer":"Hello"}
The three thinking characters are literal dots in a hand-written fixture. The five answer characters spell Hello. These counts test string accumulation; they are not tokenizer counts, inference speed, model quality, or a claim that a particular model produced this response.
| Saved-response fixture | Diagnostic result | Appropriate next step |
|---|---|---|
Thinking, answer, final stop | ANSWER_PRESENT | Apply task-specific answer validation |
Thinking and final stop, no content | NO_FINAL_TEXT | Inspect request, field mapping, and model behavior |
Final reason length | OUTPUT_LIMIT | Investigate output budget before another run |
| Content but no final record | INCOMPLETE_STREAM | Diagnose interrupted capture or transport |
| Final record with an unknown reason | REVIEW_STOP_REASON | Inspect the server contract and full response |
| Tool calls in the message | TOOL_CALLS_NEED_HANDLING | Hand off to the application’s tool workflow |
Additional local cases rejected invalid JSON, a numeric thinking field, an explicit error record, and extra data after completion. No model inference was performed for these tests. A passing fixture establishes that this reader handles those inputs, not that your installed server always emits the same sequence.
When should you change the output budget?
Change the output budget only after the final response shows an output-limit condition or a controlled experiment establishes that the current setting is insufficient. An early thinking chunk contains no such evidence. Waiting for completion and diagnosing a completed limit are different actions.
The companion stop-reason and token-limit guide covers the limit case in detail. Avoid promising that increasing an option will produce a correct answer: more generation can consume more time and memory, and the model may still fail the task. Preserve the original failure so that the next request tests a specific hypothesis.
If the server never finishes within your application’s waiting policy, investigate the timeout path separately. A client timeout is not a final done record, and it does not establish whether server-side work has stopped. The timeout diagnosis guide explains why immediate retries can make a confusing incident harder to interpret.
Should you buy hardware to fix a blank response?
Do not buy hardware on the evidence of an empty text field. First establish whether the response is still in its thinking phase, whether the client reads the right field, whether capture ended early, or whether the model returned a tool call. None of those observations proves insufficient VRAM.
If server logs and runtime reports instead establish a memory limit, evaluate the actual model, quantization, context, and concurrency together. The VRAM calculator can help organize that capacity question, but it does not diagnose this parser. A faster machine cannot fix a client that drops every content fragment except the last one.
There is also no measured money-saving claim here. Inspecting a saved file avoids issuing another request during inspection; the cost of your broader workload depends on its deployment and resource use. Keep parser correctness, performance measurements, and purchasing decisions as separate evidence.
Honest take: when should you use a different diagnostic?
Use another diagnostic when the application consumes generate responses, transformed SDK events, or a tool-calling conversation requiring execution. This helper recognizes that tool handling is needed but does not execute tools, build follow-up messages, or decide whether a tool result is trustworthy.
ANSWER_PRESENT means that a completed native chat response supplied nonblank answer text with the expected stop reason. It does not mean that the answer is correct, safe to execute, valid JSON for your schema, or sufficient for the user’s task. Keep those checks at the application boundary.
The useful repair is specific: preserve thinking and answer as different channels, accumulate the whole response, and make completion visible. Once that boundary works, a genuinely empty completed response becomes a reproducible case you can investigate rather than a reason to keep clicking regenerate.
Sources
- Thinking controls and separate output fields — Ollama
- Native chat API — Ollama
- Native generate API — Ollama
- Streaming responses — Ollama
- API errors — Ollama
Last updated November 13, 2026. Official contracts were checked on this date. Local tests used synthetic saved JSON records, with no model inference, hardware benchmark, or paid API call.
Was this article helpful?
Thanks for the feedback — it helps improve future articles.
Need hands-on help?
I offer 1-on-1 technical consulting for local AI setup, GPU selection, and AI coding tool configuration — same topics covered on this site.
Book a session — $49 / hour →Get the numbers before you buy
New GPU and mini-PC benchmarks, VRAM thresholds, and price checks — sent when there's something worth acting on, not on a schedule. No spam, unsubscribe anytime.