Hugging Face Hosted Inference API fails with "task not supported: conversational" for modern LLMs #961

Open
opened 2026-02-16 10:21:08 -05:00 by yindo · 1 comment
Owner

Originally created by @caiolivf on GitHub (Feb 3, 2026).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • 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.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

When connecting LLMs (like Llama 3.2, Qwen 2.5, or Mistral) via Hugging Face Hosted Inference API, the integration fails. Hugging Face has recently migrated many models to their new Inference Providers infrastructure (see in the pic), which requires the conversational task, but Dify seems to be hardcoded to request the text-generation task.

Error displayed: Model not supported for task text-generation. Supported task: conversational.

Image

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @caiolivf on GitHub (Feb 3, 2026). ### 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] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. When connecting LLMs (like Llama 3.2, Qwen 2.5, or Mistral) via Hugging Face Hosted Inference API, the integration fails. Hugging Face has recently migrated many models to their new Inference Providers infrastructure (see in the pic), which requires the conversational task, but Dify seems to be hardcoded to request the text-generation task. `Error displayed: Model not supported for task text-generation. Supported task: conversational.` <img width="794" height="391" alt="Image" src="https://github.com/user-attachments/assets/ceac2e3d-9a5d-45c7-aa70-2d08e384e0df" /> ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the bugenhancement labels 2026-02-16 10:21:08 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 3, 2026):

Hi @caiolivf! I'm Dosu and I’m helping the dify-official-plugins team.

The root cause is that Dify is hardcoded to use the Hugging Face "text-generation" task for LLMs, but many modern models (like Llama 3.2, Qwen 2.5, Mistral) on Hugging Face's new Inference Providers infrastructure now only support the "conversational" task. This leads to the error: "Model not supported for task text-generation. Supported task: conversational." There are no configuration options or workarounds in Dify to override the task type for Hugging Face models—this is set in the code and not dynamically detected or configurable at runtime. The relevant code paths always send "llm" (which maps to "text-generation") as the model type, with no support for "conversational" or per-model task selection source source.

To support both tasks, Dify would need to make the task type configurable per model/provider and forward this information to the plugin daemon. As a temporary workaround, advanced users could fork and patch the code to use "conversational" for affected models, but a proper fix would require changes to the model/provider metadata schema and plugin invocation logic to allow dynamic task selection based on model capabilities.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Feb 3, 2026): <!-- Greeting --> Hi @caiolivf! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> The root cause is that Dify is hardcoded to use the Hugging Face "text-generation" task for LLMs, but many modern models (like Llama 3.2, Qwen 2.5, Mistral) on Hugging Face's new Inference Providers infrastructure now only support the "conversational" task. This leads to the error: "Model not supported for task text-generation. Supported task: conversational." There are no configuration options or workarounds in Dify to override the task type for Hugging Face models—this is set in the code and not dynamically detected or configurable at runtime. The relevant code paths always send "llm" (which maps to "text-generation") as the model type, with no support for "conversational" or per-model task selection [source](https://github.com/langgenius/dify/blob/f5d6c250edab182b5c48724111c9f18dd09ec6e0/api/core/model_runtime/entities/model_entities.py#L12-L66) [source](https://github.com/langgenius/dify/blob/f5d6c250edab182b5c48724111c9f18dd09ec6e0/api/core/plugin/impl/model.py#L145-L190). To support both tasks, Dify would need to make the task type configurable per model/provider and forward this information to the plugin daemon. As a temporary workaround, advanced users could fork and patch the code to use "conversational" for affected models, but a proper fix would require changes to the model/provider metadata schema and plugin invocation logic to allow dynamic task selection based on model capabilities. <!-- 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/7a1ecf4c-4b80-45ad-a09f-d91616b247ab?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/7a1ecf4c-4b80-45ad-a09f-d91616b247ab?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/7a1ecf4c-4b80-45ad-a09f-d91616b247ab?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/7a1ecf4c-4b80-45ad-a09f-d91616b247ab?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7a1ecf4c-4b80-45ad-a09f-d91616b247ab?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/7a1ecf4c-4b80-45ad-a09f-d91616b247ab?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7a1ecf4c-4b80-45ad-a09f-d91616b247ab?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20root%20cause%20is%20that%20Dify%20is%20hardcoded%20to%20use%20the%20Hugging%20Face%20%22text-generation%22%20task%20for%20LLMs%2C%20but%20many%20modern%20models%20%28like%20Llama%203.2%2C%20Qwen%202.5%2C%20Mistral%29%20on%20Hugging%20Face%27s%20new%20Inference%20Providers%20infrastructure%20now%20only%20support%20the%20%22conversational%22%20task.%20This%20leads%20to%20the%20error%3A%20%22Model%20not%20supported%20for%20task%20text-generation.%20Supported%20task%3A%20conversational.%22%20There%20are%20no%20configuration%20options%20or%20workarounds%20in%20Dify%20to%20override%20the%20task%20type%20for%20Hugging%20Face%20models%E2%80%94this%20is%20set%20in%20the%20code%20and%20not%20dynamically%20detected%20or%20configurable%20at%20runtime.%20The%20relevant%20code%20paths%20always%20send%20%22llm%22%20%28which%20maps%20to%20%22text-generation%22%29%20as%20the%20model%20type%2C%20with%20no%20support%20for%20%22conversational%22%20or%20per-model%20task%20selection%20%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/f5d6c250edab182b5c48724111c9f18dd09ec6e0/api/core/model_runtime/entities/model_entities.py%23L12-L66%29%20%5Bsource%5D%28https%3A//github.com/langgenius/dify/blob/f5d6c250edab182b5c48724111c9f18dd09ec6e0/api/core/plugin/impl/model.py%23L145-L190%29.%0A%0ATo%20support%20both%20tasks%2C%20Dify%20would%20need%20to%20make%20the%20task%20type%20configurable%20per%20model/provider%20and%20forward%20this%20information%20to%20the%20plugin%20daemon.%20As%20a%20temporary%20workaround%2C%20advanced%20users%20could%20fork%20and%20patch%20the%20code%20to%20use%20%22conversational%22%20for%20affected%20models%2C%20but%20a%20proper%20fix%20would%20require%20changes%20to%20the%20model/provider%20metadata%20schema%20and%20plugin%20invocation%20logic%20to%20allow%20dynamic%20task%20selection%20based%20on%20model%20capabilities.)&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-official-plugins/issues/2542)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#961