dify - 💡(How to fix) Fix Bug: LLM no response with reason Non-JSON encountered [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
langgenius/dify#35257Fetched 2026-04-16 07:06:50
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
1
Author
Participants
Timeline (top)
closed ×1labeled ×1

Root Cause

Using Ollama as the model, LLM output text is empty and finish reason is Non-JSON encountered

RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.13.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Using Ollama as the model, LLM output text is empty and finish reason is Non-JSON encountered

<img width="1474" height="617" alt="Image" src="https://github.com/user-attachments/assets/6842798f-cef1-47fb-81e4-fbde15a832b2" />

Have tried to change "stream_mode_delimiter" to "\r\n\r\n" but can't fix Ollama model is returning fine when curl

✔️ Expected Behavior

To response normally

❌ Actual Behavior

No response

extent analysis

TL;DR

The issue with the Ollama model returning empty text and a "Non-JSON encountered" finish reason in Dify version 1.13.3 may be resolved by adjusting the JSON parsing or handling in the application.

Guidance

  • Verify that the Ollama model is correctly configured and functioning as expected by using curl to test its output, as mentioned in the issue.
  • Check the Dify application logs for any errors or warnings related to JSON parsing or the Ollama model integration.
  • Investigate the "stream_mode_delimiter" configuration option and its impact on the application's behavior, as changing it to "\r\n\r\n" did not resolve the issue.
  • Review the expected output format of the Ollama model and ensure that it matches the format expected by the Dify application.

Example

No code snippet is provided as the issue does not contain sufficient information about the application's codebase.

Notes

The issue may be related to the specific configuration or integration of the Ollama model with the Dify application, and further investigation is needed to determine the root cause.

Recommendation

Apply workaround: Adjust the JSON parsing or handling in the application to accommodate the output format of the Ollama model, as the issue seems to be related to the "Non-JSON encountered" error.

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