mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
Hugging Face Hosted Inference API fails with "task not supported: conversational" for modern LLMs #961
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @caiolivf on GitHub (Feb 3, 2026).
Self Checks
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.2. Additional context or comments
No response
3. Can you help us with this feature?
@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