dify icon indicating copy to clipboard operation
dify copied to clipboard

Please add support for a model provider to handle "one-api" and "new-api" as intermediary interfaces.

Open Mgrsc opened this issue 1 year ago • 6 comments

Self Checks

  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [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.

In regions with restricted internet access, we have to rely on intermediary service providers like "one-api" or "new-api" to offer model services.

2. Additional context or comments

No response

3. Can you help us with this feature?

  • [X] I am interested in contributing to this feature.

Mgrsc avatar Jul 06 '24 06:07 Mgrsc

What is "one-api" or "new-api"? Can you share more information?

perzeuss avatar Jul 06 '24 19:07 perzeuss

What is "one-api" or "new-api"? Can you share more information?"one-api" 或 "new-api" 是什么?你能分享更多信息吗?

https://github.com/songquanpeng/one-api You can check out the project using the link above. They're a model aggregation platform that can integrate numerous models and convert them into the OpenAI format for service provision.

Mgrsc avatar Jul 07 '24 03:07 Mgrsc

What is "one-api" or "new-api"? Can you share more information?"one-api" 或 "new-api" 是什么?你能分享更多信息吗?

https://github.com/songquanpeng/one-api You can check out the project using the link above. They're a model aggregation platform that can integrate numerous models and convert them into the OpenAI format for service provision.

Dify has a support for OpenAI compatible APIs, there is a dedicated model provider for it. Did you test it with one-api?

perzeuss avatar Jul 07 '24 06:07 perzeuss

什么是“one-api”或“new-api”?中方能否分享更多资料?one-api“ 或 ”new-api“ 是什么?你能分享更多信息吗?

https://github.com/songquanpeng/one-api 您可以使用上面的链接查看该项目。它们是一个模型聚合平台,可以集成多个模型并将它们转换为 OpenAI 格式以提供服务。

Dify 支持 OpenAI 兼容的 API,它有一个专门的模型提供程序。你用 one-api 测试过吗?

I've tested it, but it's not very convenient. Every time you add a model, you have to fill in a lot of things, which is not friendly to people who have a lot of models in one-api.

Mgrsc avatar Jul 08 '24 03:07 Mgrsc

What is "one-api" or "new-api"? Can you share more information?"one-api" 或 "new-api" 是什么?你能分享更多信息吗?

https://github.com/songquanpeng/one-api You can check out the project using the link above. They're a model aggregation platform that can integrate numerous models and convert them into the OpenAI format for service provision.

Dify has a support for OpenAI compatible APIs, there is a dedicated model provider for it. Did you test it with one-api?

I think we can refer to lobehub's model addition method. No matter what channel the model is added from, as long as the model name can match the existing model, it will automatically fill in the relevant information. And can automatically retrieve all available models from the upstream API provider

Mgrsc avatar Jul 08 '24 03:07 Mgrsc

+1

lanyuer avatar Jul 10 '24 15:07 lanyuer

Eagerly looking forward to supporting the integration of one-api

XHJ-Studio avatar Jul 12 '24 07:07 XHJ-Studio

The one API model is now supported, but the embedding test did not pass

WHG555 avatar Jul 16 '24 11:07 WHG555

@perzeuss An error occurs when dify calls the rerank interface from the new-api proxy: 1721202709854 image image

Run failed: Node 知识检索 run failed: [jina] Error: 'NoneType' object is not subscriptable

leoterry-ulrica avatar Jul 17 '24 07:07 leoterry-ulrica