Custom OpenAI-Compatible Model Returns Empty Output in Dify Workflow #468

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

Originally created by @Tom2576 on GitHub (Jul 22, 2025).

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.6.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Deploy Dify using docker-compose.

Configure a custom OpenAI-compatible model provider

Use the company-provided HTTP endpoint (no API key required)

Set model name and base URL accordingly

Test the model connection in Dify

"Test connection" returns success

Create a workflow or chat using this model in Dify

Run the workflow or send a message in chat

Observe the result in the frontend

The workflow completes with "success", but there is no output displayed

The text field is empty

✔️ Expected Behavior

Dify workflow/chat should display the model's response output in the frontend.

Actual Behavior

  • Workflow runs and shows "success", but no content is shown in the output
  • text field is an empty string
  • The backend model receives requests and returns valid responses
  • No errors or warnings in Dify logs
Originally created by @Tom2576 on GitHub (Jul 22, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.6.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Deploy Dify using docker-compose. Configure a custom OpenAI-compatible model provider Use the company-provided HTTP endpoint (no API key required) Set model name and base URL accordingly Test the model connection in Dify "Test connection" returns success Create a workflow or chat using this model in Dify Run the workflow or send a message in chat Observe the result in the frontend The workflow completes with "success", but there is no output displayed The text field is empty ### ✔️ Expected Behavior Dify workflow/chat should display the model's response output in the frontend. ### ❌ Actual Behavior - Workflow runs and shows "success", but no content is shown in the output - text field is an empty string - The backend model receives requests and returns valid responses - No errors or warnings in Dify logs
yindo closed this issue 2026-02-16 10:19:29 -05:00
Author
Owner

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

Hi @Tom2576! I'm Dosu and I’m helping the dify team.

This issue usually happens when the custom model's response isn't mapped correctly to Dify's internal schema. Dify doesn't parse raw OpenAI-compatible responses directly—it expects the adapter or plugin to transform the response into its own structure, specifically an LLMResult or LLMResultChunk, where the message.content field (from AssistantPromptMessage) must contain the actual output text. If this field is empty or not set, the frontend will show no output, but the workflow will still report "success" and you won't see errors in the logs [docs reference].

To troubleshoot:

  1. Check the raw response from your custom model and ensure it matches the OpenAI API format (i.e., it should have a choices array, and each choice should have a text or message.content field).
  2. Make sure your adapter/plugin code extracts the response text and sets it as content in the AssistantPromptMessage when building the LLMResult or LLMResultChunk [code reference].
  3. If possible, log or print the payload being returned to Dify to confirm the content field is populated.

If you can share a sample of the raw response payload your model returns, I can help spot any mapping issues. This should help you pinpoint where the output is being dropped.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jul 22, 2025): <!-- Greeting --> Hi @Tom2576! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> This issue usually happens when the custom model's response isn't mapped correctly to Dify's internal schema. Dify doesn't parse raw OpenAI-compatible responses directly—it expects the adapter or plugin to transform the response into its own structure, specifically an `LLMResult` or `LLMResultChunk`, where the `message.content` field (from `AssistantPromptMessage`) must contain the actual output text. If this field is empty or not set, the frontend will show no output, but the workflow will still report "success" and you won't see errors in the logs [[docs reference]](https://github.com/crazywoola/dify-docs-mintlify/blob/a6647b33df40ace51422b11f355ec6e2618bc05e/en/guides/model-configuration/interfaces.mdx). To troubleshoot: 1. Check the raw response from your custom model and ensure it matches the OpenAI API format (i.e., it should have a `choices` array, and each choice should have a `text` or `message.content` field). 2. Make sure your adapter/plugin code extracts the response text and sets it as `content` in the `AssistantPromptMessage` when building the `LLMResult` or `LLMResultChunk` [[code reference]](https://github.com/langgenius/dify/blob/366d42d9c04827f12b81046d0a3d2ed7cf110469/api/core/model_runtime/entities/llm_entities.py). 3. If possible, log or print the payload being returned to Dify to confirm the `content` field is populated. If you can share a sample of the raw response payload your model returns, I can help spot any mapping issues. This should help you pinpoint where the output is being dropped. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/75ee6fbd-6db0-43fc-b889-16283e9cb977?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/75ee6fbd-6db0-43fc-b889-16283e9cb977?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/75ee6fbd-6db0-43fc-b889-16283e9cb977?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/75ee6fbd-6db0-43fc-b889-16283e9cb977?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/75ee6fbd-6db0-43fc-b889-16283e9cb977?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/75ee6fbd-6db0-43fc-b889-16283e9cb977?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/75ee6fbd-6db0-43fc-b889-16283e9cb977?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/22786)
Author
Owner

@Tom2576 commented on GitHub (Jul 22, 2025):

Thank you for your detailed reply!

Here is a sample of the JSON payload my custom model returns to Dify:

{
"id": "chatcmpl-openai-001",
"object": "chat.completion",
"created": 1721443033,
"model": "my-model-name",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "This is the answer from my model."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}

The content field under choices[0].message is populated with the model's output.

The API returns HTTP 200 with this JSON response for each request.
@Tom2576 commented on GitHub (Jul 22, 2025): Thank you for your detailed reply! Here is a sample of the JSON payload my custom model returns to Dify: { "id": "chatcmpl-openai-001", "object": "chat.completion", "created": 1721443033, "model": "my-model-name", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "This is the answer from my model." }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0 } } The content field under choices[0].message is populated with the model's output. The API returns HTTP 200 with this JSON response for each request.
Author
Owner

@Tom2576 commented on GitHub (Jul 22, 2025):

@dosu.

@Tom2576 commented on GitHub (Jul 22, 2025): [@dosu](https://go.dosu.dev/dosubot).
Author
Owner

@dosubot[bot] commented on GitHub (Aug 20, 2025):

Hi, @Tom2576. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that workflows complete successfully in Dify v1.6.0 self-hosted, but no output appears in the frontend.
  • Backend responses from your custom OpenAI-compatible model are valid and include the content field.
  • The issue likely relates to how the model's response maps into Dify's internal schema, especially the message.content in LLMResult.
  • You shared a sample JSON response, and I requested more details to pinpoint where the output might be dropped.

Next Steps:

  • Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here.
  • If I don’t hear back within 5 days, I will automatically close this issue.

Thanks for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 20, 2025): Hi, @Tom2576. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that workflows complete successfully in Dify v1.6.0 self-hosted, but no output appears in the frontend. - Backend responses from your custom OpenAI-compatible model are valid and include the `content` field. - The issue likely relates to how the model's response maps into Dify's internal schema, especially the `message.content` in `LLMResult`. - You shared a sample JSON response, and I requested more details to pinpoint where the output might be dropped. **Next Steps:** - Please confirm if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here. - If I don’t hear back within 5 days, I will automatically close this issue. Thanks for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#468