ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Question]: How to add models of Qwen into RAGFlow

Open gbm777 opened this issue 9 months ago • 9 comments

Describe your problem

千问平台有大量的模型没有列入ragflow,请问如何添加,能否给一个操作说明。 在llm_factories.json中添加了如下: { "llm_name": "multimodal-embedding-v1", "tags": "TEXT EMBEDDING", "max_tokens": 1024, "model_type": "embedding" } 并删除Tongyi-Qianwen后重新添加api,同样无法显示multimodal-embedding-v1。

gbm777 avatar Mar 05 '25 04:03 gbm777

我在数据库里找到了自己添加的模型。

SELECT tenant_id, llm_factory, model_type, llm_name, max_tokens
FROM tenant_llm
WHERE tenant_id = 'df75265cf7da11ef9a840242ac120006';

是在太多,直接写库不知道靠谱不,我通过这个表直接观察自己配置模型的细节是否正确。

GuoDapeng avatar Mar 05 '25 14:03 GuoDapeng

You needed to restart the ragflow server, didn't you?

KevinHuSh avatar Mar 06 '25 03:03 KevinHuSh

I start ragflow in docker and just restart wiithin docker.

gbm777 avatar Mar 06 '25 04:03 gbm777

In container.

KevinHuSh avatar Mar 06 '25 10:03 KevinHuSh

server also restarted fully with same result.

gbm777 avatar Mar 07 '25 09:03 gbm777

Yes, I have the same question. In ragflow, even restart PC and docker, there are four chat models in “Tongyi Qianwen” ,long, turob,max,plus. But there are many models in Aliyun website, for expample, QwQ, Omni, Qwen 2,5 72B. I wonder how to use those models in ragflow.

Simonqujian78 avatar Mar 07 '25 13:03 Simonqujian78

I have some update from aliyun, multimodal-embedding-v1 does not support api yet, but text-embedding-async-v1 support api but not working for ragflow whether.

gbm777 avatar Mar 08 '25 08:03 gbm777

  1. Add a new model to llm_factories.json 'docker exec -it ragflow-server bash' 'vi conf/llm_factories.json' add following model under "name": "Tongyi-Qianwen", "llm": { "llm_name": "qwq-plus", "tag": "LLMM,CHAT,128K", "max_tokens": 131072, "model_type": "chat" },

  2. commit the change and restart the container 'docker ps' to get ragflow-server container id $server_id 'docker commit $server_id' 'docker restart ragflow-server'

  3. Delete and add Tongyi-Qianwen again, you should see the new model.

liurhino avatar Mar 09 '25 11:03 liurhino

  1. Add a new model to llm_factories.json 'docker exec -it ragflow-server bash' 'vi conf/llm_factories.json' add following model under "name": "Tongyi-Qianwen", "llm": { "llm_name": "qwq-plus", "tag": "LLMM,CHAT,128K", "max_tokens": 131072, "model_type": "chat" },
  2. commit the change and restart the container 'docker ps' to get ragflow-server container id $server_id 'docker commit $server_id' 'docker restart ragflow-server'
  3. Delete and add Tongyi-Qianwen again, you should see the new model.

Thanks for your reply. The Qwq model is in the list now and I also know how to add model in ragflow. I wonder how to find the parameter "128K", I could not find it in the homepage of QwQ plus.

Simonqujian78 avatar Mar 12 '25 07:03 Simonqujian78