Support Qwen multimodal LLMs #977

Closed
opened 2026-02-21 17:29:19 -05:00 by yindo · 2 comments
Owner

Originally created by @ifsheldon on GitHub (Jan 26, 2024).

Self Checks

1. Is this request related to a challenge you're experiencing?

Yes, I'd like to use Qwen-VL and Qwen-audio in agents.

2. Describe the feature you'd like to see

Please support Qwen-VL and Qwen-audio models

3. How will this feature improve your workflow or experience?

We can replace GPT4-Vision with Qwen-VL and extend the capabilities of our agents using Qwen-audio.

4. Additional context or comments

For documentation, please see

5. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @ifsheldon on GitHub (Jan 26, 2024). ### Self Checks - [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 file this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). ### 1. Is this request related to a challenge you're experiencing? Yes, I'd like to use Qwen-VL and Qwen-audio in agents. ### 2. Describe the feature you'd like to see Please support Qwen-VL and Qwen-audio models ### 3. How will this feature improve your workflow or experience? We can replace GPT4-Vision with Qwen-VL and extend the capabilities of our agents using Qwen-audio. ### 4. Additional context or comments For documentation, please see * https://help.aliyun.com/zh/dashscope/developer-reference/qwen-vl-plus/ * https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-qianwen-vl/ * https://help.aliyun.com/zh/dashscope/developer-reference/qwen-audio-chat/ ### 5. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 💪 enhancement📚 documentation labels 2026-02-21 17:29:19 -05:00
yindo closed this issue 2026-02-21 17:29:19 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 26, 2024):

🤖

Hey there @ifsheldon, great to see you back in the dify universe! 👽

Thank you for your feature request. As of the current version of dify (v0.5.2), there is no explicit support for multimodal LLMs like Qwen-VL and Qwen-audio. However, the dify platform does have a modular architecture that allows for the integration of new LLMs.

The AnthropicLargeLanguageModel class, which is part of the core.model_runtime.model_providers package, handles the integration of LLMs. This class includes methods for invoking the LLM, validating the model's credentials, generating responses from the model, and handling the model's responses.

Here is an example of how the LLM is invoked:

def _invoke(self, model: str, credentials: dict,
            prompt_messages: list[PromptMessage], model_parameters: dict,
            tools: Optional[list[PromptMessageTool]] = None, stop: Optional[List[str]] = None,
            stream: bool = True, user: Optional[str] = None) \
        -> Union[LLMResult, Generator]:
    """
    Invoke large language model

    :param model: model name
    :param credentials: model credentials
    :param prompt_messages: prompt messages
    :param model_parameters: model parameters
    :param tools: tools for tool calling
    :param stop: stop words
    :param stream: is stream response
    :param user: unique user id
    :return: full response or stream response chunk generator result
    """
    # invoke model
    return self._generate(model, credentials, prompt_messages, model_parameters, stop, stream, user)

This method takes in various parameters including the model name, credentials, prompt messages, model parameters, and optionally, a list of tools, stop words, a boolean indicating if the response should be streamed, and a unique user id. It then invokes the model by calling the _generate method with these parameters.

While this class currently supports the Anthropic LLM, it could potentially be extended or adapted to support other LLMs like Qwen-VL and Qwen-audio. However, this would likely require significant development work and testing to ensure compatibility and performance.

As for the specific requirements and dependencies for integrating Qwen-VL and Qwen-audio models into the dify platform, I wasn't able to find this information within the repository. It's possible that this information may be available elsewhere, or it may require further investigation and research.

I hope this information is helpful. If you have any further questions or need additional clarification, please don't hesitate to ask.

Source:

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot[bot] commented on GitHub (Jan 26, 2024): _🤖_ <!-- Greeting --> Hey there @ifsheldon, great to see you back in the dify universe! 👽 <!-- Answer --> Thank you for your feature request. As of the current version of dify (v0.5.2), there is no explicit support for multimodal LLMs like Qwen-VL and Qwen-audio. However, the dify platform does have a modular architecture that allows for the integration of new LLMs. The `AnthropicLargeLanguageModel` class, which is part of the `core.model_runtime.model_providers` package, handles the integration of LLMs. This class includes methods for invoking the LLM, validating the model's credentials, generating responses from the model, and handling the model's responses. Here is an example of how the LLM is invoked: ```py def _invoke(self, model: str, credentials: dict, prompt_messages: list[PromptMessage], model_parameters: dict, tools: Optional[list[PromptMessageTool]] = None, stop: Optional[List[str]] = None, stream: bool = True, user: Optional[str] = None) \ -> Union[LLMResult, Generator]: """ Invoke large language model :param model: model name :param credentials: model credentials :param prompt_messages: prompt messages :param model_parameters: model parameters :param tools: tools for tool calling :param stop: stop words :param stream: is stream response :param user: unique user id :return: full response or stream response chunk generator result """ # invoke model return self._generate(model, credentials, prompt_messages, model_parameters, stop, stream, user) ``` This method takes in various parameters including the model name, credentials, prompt messages, model parameters, and optionally, a list of tools, stop words, a boolean indicating if the response should be streamed, and a unique user id. It then invokes the model by calling the `_generate` method with these parameters. While this class currently supports the Anthropic LLM, it could potentially be extended or adapted to support other LLMs like Qwen-VL and Qwen-audio. However, this would likely require significant development work and testing to ensure compatibility and performance. As for the specific requirements and dependencies for integrating Qwen-VL and Qwen-audio models into the dify platform, I wasn't able to find this information within the repository. It's possible that this information may be available elsewhere, or it may require further investigation and research. I hope this information is helpful. If you have any further questions or need additional clarification, please don't hesitate to ask. Source: - [api/core/model_runtime/model_providers/anthropic/llm/llm.py](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/anthropic/llm/llm.py) ## Sources - [api/core/model_runtime/model_providers/anthropic/llm/llm.py](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/model_providers/anthropic/llm/llm.py) --- This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
Author
Owner

@crazywoola commented on GitHub (Jan 27, 2024):

#2177

@crazywoola commented on GitHub (Jan 27, 2024): #2177
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#977