In Dify 1.4.0, adding Qwen3 via GPUStack resulted in an error:Credentials validation failed with status code 400. #308

Closed
opened 2026-02-16 10:18:55 -05:00 by yindo · 4 comments
Owner

Originally created by @sugarless-sweet on GitHub (May 22, 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.4.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When using GPUStack 0.0.7 to add Qwen3, an error occurs: "Credentials validation failed with status code 400" if the Completion mode is set to "Chat". However, it can be added successfully when the Completion mode is set to "Completion".

Image

Image

✔️ Expected Behavior

it can be added successfully when the Completion mode is set to "Chat".

Actual Behavior

it can not be added successfully when the Completion mode is set to "Chat".

Originally created by @sugarless-sweet on GitHub (May 22, 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.4.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When using GPUStack 0.0.7 to add Qwen3, an error occurs: "Credentials validation failed with status code 400" if the Completion mode is set to "Chat". However, it can be added successfully when the Completion mode is set to "Completion". ![Image](https://github.com/user-attachments/assets/15373995-3cc9-40ae-8b5b-3dd2da321c58) ![Image](https://github.com/user-attachments/assets/5a795219-8be1-450e-9038-8d019cf6717a) ### ✔️ Expected Behavior it can be added successfully when the Completion mode is set to "Chat". ### ❌ Actual Behavior it can not be added successfully when the Completion mode is set to "Chat".
yindo closed this issue 2026-02-16 10:18:55 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (May 22, 2025):

I was unable to find any existing issues or discussions specifically about the "Credentials validation failed with status code 400" error when adding Qwen3 via GPUStack in Dify 1.4.0.

Based on the code and documentation, here’s what I found about the modes and credential validation:

  • Both "Chat" and "Completion" modes in Dify use similar model configuration structures, but "Chat" mode is designed for conversational applications, while "Completion" is for single-turn text generation like summaries or articles. The credential requirements and validation logic may differ slightly between these modes, especially in how the backend expects the request to be structured or which fields are required [source].
  • The NVIDIA NIM model provider configuration (which may be similar to how GPUStack is integrated) defines credential schemas for API endpoint URL and completion mode, and these are validated when you add a model [source].
  • The config_validate method in Dify is responsible for validating model configurations, including credentials, when adding a model in "Chat" mode [source].

Potential causes for the error:

  • The "Chat" mode may require additional or different credential fields compared to "Completion" mode, or the backend may expect a different payload structure.
  • There could be a mismatch between what GPUStack expects for "Chat" mode and what Dify is sending, resulting in a 400 error.
  • No recent changes or documentation in Dify 1.4.0 were found that specifically address credential validation changes in "Chat" mode.

Workaround:

  • Since adding Qwen3 works in "Completion" mode but not in "Chat" mode, double-check that all required credential fields for "Chat" mode are filled out and match what GPUStack expects.
  • If possible, compare the payloads sent in both modes to see if there are missing or extra fields in the "Chat" mode request.

If you have access to logs or error details from GPUStack, reviewing those might provide more insight into which credential or field is causing the 400 error.

At this time, I could not find a direct fix or a known issue matching your scenario. If you can share more details about the exact configuration or logs, it may help narrow down the cause.

To continue talking to Dosu, mention @dosu-bot.


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

@dosubot[bot] commented on GitHub (May 22, 2025): <!-- Answer --> I was unable to find any existing issues or discussions specifically about the "Credentials validation failed with status code 400" error when adding Qwen3 via GPUStack in Dify 1.4.0. Based on the code and documentation, here’s what I found about the modes and credential validation: - Both "Chat" and "Completion" modes in Dify use similar model configuration structures, but "Chat" mode is designed for conversational applications, while "Completion" is for single-turn text generation like summaries or articles. The credential requirements and validation logic may differ slightly between these modes, especially in how the backend expects the request to be structured or which fields are required [[source]](https://github.com/langgenius/dify/blob/main/api/constants/model_template.py). - The NVIDIA NIM model provider configuration (which may be similar to how GPUStack is integrated) defines credential schemas for API endpoint URL and completion mode, and these are validated when you add a model [[source]](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/nvidia_nim/nvidia_nim.yaml). - The `config_validate` method in Dify is responsible for validating model configurations, including credentials, when adding a model in "Chat" mode [[source]](https://github.com/langgenius/dify/blob/main/api/core/app/apps/chat/app_config_manager.py). **Potential causes for the error:** - The "Chat" mode may require additional or different credential fields compared to "Completion" mode, or the backend may expect a different payload structure. - There could be a mismatch between what GPUStack expects for "Chat" mode and what Dify is sending, resulting in a 400 error. - No recent changes or documentation in Dify 1.4.0 were found that specifically address credential validation changes in "Chat" mode. **Workaround:** - Since adding Qwen3 works in "Completion" mode but not in "Chat" mode, double-check that all required credential fields for "Chat" mode are filled out and match what GPUStack expects. - If possible, compare the payloads sent in both modes to see if there are missing or extra fields in the "Chat" mode request. If you have access to logs or error details from GPUStack, reviewing those might provide more insight into which credential or field is causing the 400 error. At this time, I could not find a direct fix or a known issue matching your scenario. If you can share more details about the exact configuration or logs, it may help narrow down the cause. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://go.dosu.dev/dosubot), mention @dosu-bot.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/27357a07-0035-4d87-874c-a845a3d46a26?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/27357a07-0035-4d87-874c-a845a3d46a26?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/27357a07-0035-4d87-874c-a845a3d46a26?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/27357a07-0035-4d87-874c-a845a3d46a26?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/27357a07-0035-4d87-874c-a845a3d46a26?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/27357a07-0035-4d87-874c-a845a3d46a26?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/27357a07-0035-4d87-874c-a845a3d46a26?feedback_type=other)</sup>
Author
Owner

@atmouse- commented on GitHub (May 26, 2025):

refer: https://github.com/gpustack/gpustack/issues/2074

workaround: It depends your model, With thinking model temporarily enlarge ping with max_token 16 or 128 instead 5

@atmouse- commented on GitHub (May 26, 2025): refer: https://github.com/gpustack/gpustack/issues/2074 workaround: It depends your model, With thinking model temporarily enlarge ping with max_token 16 or 128 instead 5
Author
Owner

@sugarless-sweet commented on GitHub (Jun 4, 2025):

After selecting llama-box v0.0.152 for the Backend Version, this issue was resolved.

@sugarless-sweet commented on GitHub (Jun 4, 2025): After selecting llama-box v0.0.152 for the Backend Version, this issue was resolved.
Author
Owner

@chiangbt commented on GitHub (Jun 5, 2025):

After selecting llama-box v0.0.152 for the Backend Version, this issue was resolved.

how to update llama-box to 0.0.152 in dokcer? i find the default download link is invalid.

@chiangbt commented on GitHub (Jun 5, 2025): > After selecting llama-box v0.0.152 for the Backend Version, this issue was resolved. how to update llama-box to 0.0.152 in dokcer? i find the default download link is invalid.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#308