[GH-ISSUE #15514] Qwen Models Produce Corrupted / “Stuttering” JSON Output in Ollama 0.20.5 #35674

Open
opened 2026-04-22 20:21:13 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @crazyingen on GitHub (Apr 12, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/15514

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

Originally created by @crazyingen on GitHub (Apr 12, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15514 ### 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 ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-22 20:21:13 -05:00
Author
Owner

@rick-github commented on GitHub (Apr 12, 2026):

Can you provide an example?

$ ollama -v
ollama version is 0.20.5
$ ollama run qwen3:8b --format json name 3 colours | jq
{
  "status": "success",
  "response": [
    "Red",
    "Blue",
    "Green"
  ]
}
<!-- gh-comment-id:4232713203 --> @rick-github commented on GitHub (Apr 12, 2026): Can you provide an example? ```console $ ollama -v ollama version is 0.20.5 $ ollama run qwen3:8b --format json name 3 colours | jq { "status": "success", "response": [ "Red", "Blue", "Green" ] } ```
Author
Owner

@andrenaP commented on GitHub (Apr 14, 2026):

Having same issue with qwen3.5:

Example

~$ ollama -v
ollama version is 0.20.6
~$ ollama run qwen3.5:latest --format json name 3 colours
Thinking...
{
  "User's Intent": "The user wants three names of colors. This is a very simple request with no hidden context or complex reasoning required. My task is to just list three common colors."
  }
~$ ollama run qwen3.5:latest --format json name 3 colours
Thinking...
{
  "role": "AI Assistant",
  "user": "name 3 colours",
  "intention": "The user is asking for a simple list of three colors. This is a factual request with no complex reasoning or hidden intent. The response should be direct and concise, providing three common color names. Since there are
no constraints or preferences mentioned, I can choose any three standard colors. I will list them clearly."
}

~$ ollama run qwen3.5:latest --format json name 3 colours
Thinking...
{
    "User's request": "name 3 colours"
}

~$ ollama run qwen3.5:latest --format json name 3 colours
Thinking...
{
 "role": "assistant",
 "user": "name 3 colours",
 "task": "Provide 3 colours."
 }

~$ ollama run qwen3.5:latest --format json name 3 colours
Thinking...
{
  "user_intent": "The user wants me to provide three colors.",
  "constraint_analysis": "The query is extremely short and specific. I need to output exactly three color names.",
  "knowledge_access": "Color names are basic common knowledge.",
  "strategy": "Select three distinct and common color names.",
  "validation": "Ensure the count is exactly three.",
  "output": "Red, blue, green"
}

~$ ollama run qwen3.5:latest --format json name 3 colours
Thinking...
{

}

~$ ollama run qwen3.5:latest --format json name 3 colours
Thinking...
{
    "thought": "The user is asking for 3 colors. This is a very simple request with no specific constraints. I should provide a common, well-known list of colors. The most obvious and safe choices are Red, Blue, and Green, but I can
also use any other distinct colors to show variety or creativity. I will select three distinct and universally recognized colors to fulfill the request concisely."
}

Gemma4 on other hand works fine.

~$ ollama run gemma4:latest --format json name 3 colours  | jq
{
  "colors": [
    "Red",
    "Blue",
    "Green"
  ]
}
~$
<!-- gh-comment-id:4245202825 --> @andrenaP commented on GitHub (Apr 14, 2026): Having same issue with qwen3.5: ### Example ```console ~$ ollama -v ollama version is 0.20.6 ~$ ollama run qwen3.5:latest --format json name 3 colours Thinking... { "User's Intent": "The user wants three names of colors. This is a very simple request with no hidden context or complex reasoning required. My task is to just list three common colors." } ~$ ollama run qwen3.5:latest --format json name 3 colours Thinking... { "role": "AI Assistant", "user": "name 3 colours", "intention": "The user is asking for a simple list of three colors. This is a factual request with no complex reasoning or hidden intent. The response should be direct and concise, providing three common color names. Since there are no constraints or preferences mentioned, I can choose any three standard colors. I will list them clearly." } ~$ ollama run qwen3.5:latest --format json name 3 colours Thinking... { "User's request": "name 3 colours" } ~$ ollama run qwen3.5:latest --format json name 3 colours Thinking... { "role": "assistant", "user": "name 3 colours", "task": "Provide 3 colours." } ~$ ollama run qwen3.5:latest --format json name 3 colours Thinking... { "user_intent": "The user wants me to provide three colors.", "constraint_analysis": "The query is extremely short and specific. I need to output exactly three color names.", "knowledge_access": "Color names are basic common knowledge.", "strategy": "Select three distinct and common color names.", "validation": "Ensure the count is exactly three.", "output": "Red, blue, green" } ~$ ollama run qwen3.5:latest --format json name 3 colours Thinking... { } ~$ ollama run qwen3.5:latest --format json name 3 colours Thinking... { "thought": "The user is asking for 3 colors. This is a very simple request with no specific constraints. I should provide a common, well-known list of colors. The most obvious and safe choices are Red, Blue, and Green, but I can also use any other distinct colors to show variety or creativity. I will select three distinct and universally recognized colors to fulfill the request concisely." } ``` Gemma4 on other hand works fine. ```console ~$ ollama run gemma4:latest --format json name 3 colours | jq { "colors": [ "Red", "Blue", "Green" ] } ~$ ```
Author
Owner

@PureBlissAK commented on GitHub (Apr 18, 2026):

🤖 Automated Triage & Analysis Report

Issue: #15514
Analyzed: 2026-04-18T18:20:47.127001

Analysis

  • Type: unknown
  • Severity: medium
  • Components: unknown

Implementation Plan

  • Effort: medium
  • Steps:

This issue has been triaged and marked for implementation.

<!-- gh-comment-id:4274307177 --> @PureBlissAK commented on GitHub (Apr 18, 2026): <!-- ollama-issue-orchestrator:v1 issue:15514 --> ## 🤖 Automated Triage & Analysis Report **Issue**: #15514 **Analyzed**: 2026-04-18T18:20:47.127001 ### Analysis - **Type**: unknown - **Severity**: medium - **Components**: unknown ### Implementation Plan - **Effort**: medium - **Steps**: *This issue has been triaged and marked for implementation.*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#35674