ollama - 💡(How to fix) Fix Qwen Models Produce Corrupted / “Stuttering” JSON Output in Ollama 0.20.5 [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15514Fetched 2026-04-12 13:24:08
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1
RAW_BUFFERClick to expand / collapse

What is the issue?

When running Qwen 3.x models (e.g., qwen3:8b) with ollama run --format json or via the API, Ollama 0.20.5 produces corrupted JSON output. The model “stutters”, inserts line breaks inside tokens, duplicates words, and emits ANSI cursor control sequences. This makes the output impossible to parse as JSON.

Downgrading to Ollama 0.18.4 immediately resolves the issue.

Relevant log output

OS

No response

GPU

No response

CPU

No response

Ollama version

No response

extent analysis

TL;DR

Downgrade to Ollama 0.18.4 to resolve the corrupted JSON output issue.

Guidance

  • The issue is likely caused by a regression in Ollama 0.20.5, as downgrading to 0.18.4 resolves the problem.
  • Verify the fix by running ollama run --format json with the downgraded version and checking the output for correct JSON formatting.
  • If downgrading is not feasible, consider reporting the issue to the Ollama developers, as it may be a bug that needs to be addressed in a future version.
  • Test the downgrade in a non-production environment first to ensure it does not introduce other compatibility issues.

Example

No code snippet is provided, as the issue does not require a specific code change.

Notes

The root cause of the issue is unclear, but it is likely related to changes introduced in Ollama 0.20.5. Downgrading to 0.18.4 is a temporary workaround until a fixed version is available.

Recommendation

Apply workaround: Downgrade to Ollama 0.18.4, as it is a known working version that resolves the corrupted JSON output issue.

FAIL-SAFE

No additional fail-safe measures are required, as the provided guidance is based on the information given in the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING