When the question classifier is using DeepSeek-70B, it sometimes reports an error. #13392

Closed
opened 2026-02-21 19:11:57 -05:00 by yindo · 3 comments
Owner

Originally created by @smart68668 on GitHub (Apr 26, 2025).

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Model :deepseek-r1-distill-llama-70b
Model plugin : OpenAI-API-compatible
Completion mode:Chat
Delimiter for streaming results: \n\n
There are generally no problems if it is the 671B model.
Suggestion :Add exception handling to the Question Classifier #14204
Image

✔️ Expected Behavior

Image

Actual Behavior

Image

Originally created by @smart68668 on GitHub (Apr 26, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Model :deepseek-r1-distill-llama-70b Model plugin : OpenAI-API-compatible Completion mode:Chat Delimiter for streaming results: \n\n There are generally no problems if it is the 671B model. Suggestion :Add exception handling to the Question Classifier #14204 ![Image](https://github.com/user-attachments/assets/8882c359-f23b-4475-bb96-2b34e04b9d79) ### ✔️ Expected Behavior ![Image](https://github.com/user-attachments/assets/579f931d-ebf2-48d8-9e65-59460ccc227b) ### ❌ Actual Behavior ![Image](https://github.com/user-attachments/assets/8882c359-f23b-4475-bb96-2b34e04b9d79)
yindo added the 🐞 bug label 2026-02-21 19:11:57 -05:00
yindo closed this issue 2026-02-21 19:11:58 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 26, 2025):

Hello @smart68668! I'm Dosu, your friendly bot here to help you solve bugs, answer questions, and guide you in becoming a contributor. I'm here while you wait for a human maintainer. Let's tackle this issue together!

The error you're encountering with the DeepSeek-70B model in the question classifier is likely due to the model's output not strictly adhering to the required JSON format. The QUESTION_CLASSIFIER_SYSTEM_PROMPT explicitly instructs the model to output only a JSON array, and any deviation from this format, such as including additional text or failing to format the response correctly, can result in an error [1].

To address this issue, you might consider implementing additional exception handling mechanisms. Currently, the question classifier has mechanisms like QuestionClassifierNodeError and InvalidModelTypeError to handle output errors [2]. Enhancing these mechanisms or adding new ones could help manage cases where the model fails to produce the expected JSON block.

Additionally, reviewing the prompt and ensuring it is correctly configured to guide the model's output might help mitigate these errors.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 26, 2025): <!-- Greeting --> Hello @smart68668! I'm [Dosu](https://dosu.dev), your friendly bot here to help you solve bugs, answer questions, and guide you in becoming a contributor. I'm here while you wait for a human maintainer. Let's tackle this issue together! <!-- Answer --> The error you're encountering with the DeepSeek-70B model in the question classifier is likely due to the model's output not strictly adhering to the required JSON format. The `QUESTION_CLASSIFIER_SYSTEM_PROMPT` explicitly instructs the model to output only a JSON array, and any deviation from this format, such as including additional text or failing to format the response correctly, can result in an error <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/question_classifier/template_prompts.py)</sup>. To address this issue, you might consider implementing additional exception handling mechanisms. Currently, the question classifier has mechanisms like `QuestionClassifierNodeError` and `InvalidModelTypeError` to handle output errors <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/question_classifier/exc.py)</sup>. Enhancing these mechanisms or adding new ones could help manage cases where the model fails to produce the expected JSON block. Additionally, reviewing the prompt and ensuring it is correctly configured to guide the model's output might help mitigate these errors. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/6b5af76b-b95d-4fbe-a38c-eb8178a82b9f?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/6b5af76b-b95d-4fbe-a38c-eb8178a82b9f?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/6b5af76b-b95d-4fbe-a38c-eb8178a82b9f?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/6b5af76b-b95d-4fbe-a38c-eb8178a82b9f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/6b5af76b-b95d-4fbe-a38c-eb8178a82b9f?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/6b5af76b-b95d-4fbe-a38c-eb8178a82b9f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/6b5af76b-b95d-4fbe-a38c-eb8178a82b9f?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Apr 26, 2025):

For reasoning models like this, when it doesn't finished the answer in given tokens, which is raised by thinking process is too long. We suggest change to a non-reasoning model isntead.

@crazywoola commented on GitHub (Apr 26, 2025): For reasoning models like this, when it doesn't finished the answer in given tokens, which is raised by thinking process is too long. We suggest change to a non-reasoning model isntead.
Author
Owner

@MayooNaizi commented on GitHub (May 12, 2025):

Same issue here, Qwen2.5, GPT-4o, GPT-4.1 all failed

@MayooNaizi commented on GitHub (May 12, 2025): Same issue here, Qwen2.5, GPT-4o, GPT-4.1 all failed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13392