Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 模型在选择下拉菜单中显示不正确,且无法添加自定义模型 #5933

Open
NP-Prob opened this issue Dec 13, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@NP-Prob
Copy link

NP-Prob commented Dec 13, 2024

📦 部署方式

Docker

📌 软件版本

docker v27.4.0, ChatGPT-Next-Web v2.15.8

💻 系统环境

Other Linux

📌 系统版本

Debian 12

🌐 浏览器

Edge

📌 浏览器版本

版本 131.0.2903.86 (正式版本) (64 位)

🐛 问题描述

问题1:
docker-compose.yml文件中设置多项模型,BASE_URL使用某中转接口供应商地址,CUSTOM_MODELS设置如下:

CUSTOM_MODELS=-all,+claude-3-5-sonnet-20241022@openai=claude3.5-sonnet,+chatgpt-4o-latest@openai=chatgpt-4o,+gpt-4o-mini@openai,+o1-preview@openai,+o1-mini@openai,+tts-1@openai,+tts-1-hd@openai,+whisper-1@openai

然而在模型选项里,部分模型被归入openai类别,部分模型被归入OpenAI类别。

问题2:
在UI界面中尝试另外再添加DeepSeek的模型,由于“模型服务商”中没有DeepSeek选项,而DeepSeek的API调用格式与OpenAI一致,在查阅本项目其他issue的解决方案之后采用如下接入方式:

模型服务商:OpenAI
接口地址:https://api.deepseek.com
API Key:sk-xxxxxx(从DeepSeek获取的API Key)
自定义模型名:deepseek-chat

如下图所示:
image

但模型选择中并未出现DeepSeek的deepseek-chat模型可供选择。

📷 复现步骤

详见 🐛 问题描述 部分

🚦 期望结果

  1. 正确显示模型所属公司;
  2. 成功添加DeepSeek的模型deepseek-chat

📝 补充信息

No response

@NP-Prob NP-Prob added the bug Something isn't working label Dec 13, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] Models are displayed incorrectly in the selection drop-down menu and custom models cannot be added

@SuiYunsy
Copy link

  1. 正确显示模型所属公司:公司是 OpenAI,不是 openai。目前程序对大小写敏感,所以应当 +model@OpenAI 才对。
  2. 成功添加DeepSeek的模型deepseek-chat:是因为你环境变量 CUSTOM_MODELS 设置了 -all,这会阻止前端添加模型。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


  1. Correctly display the company to which the model belongs: the company is OpenAI, not openai. Currently, the program is case-sensitive, so +model@OpenAI should be used.
  2. Successfully added DeepSeek’s model deepseek-chat: This is because your environment variable CUSTOM_MODELS is set to -all, which will prevent the front end from adding models.

@NP-Prob
Copy link
Author

NP-Prob commented Dec 13, 2024

  1. 正确显示模型所属公司:公司是 OpenAI,不是 openai。目前程序对大小写敏感,所以应当 +model@OpenAI 才对。
  2. 成功添加DeepSeek的模型deepseek-chat:是因为你环境变量 CUSTOM_MODELS 设置了 -all,这会阻止前端添加模型。

感谢解答,我之所以在CUSTOM_MODELS中会将 OpenAI 写为 openai 是以为无法添加DeepSeek的原因是配置文件里的 OpenAI 与自定义模型里的 OpenAI 发生冲突了。
关于

环境变量 CUSTOM_MODELS 设置了 -all,这会阻止前端添加模型。

然而我又发现,如果我前端添加了模型,无论我是否开启 自定义接口 ,似乎都会覆盖我配置文件里的API Key,因为其他 OpenAI 模型会报错无效的令牌,等于说环境变量里的-all控制的只是前端是否展示模型(但我前端另外加的模型前端不能展示也挺奇怪的)。然而似乎前端 自定义接口 里的 接口地址 却在关闭自定义接口的情况下又不影响配置文件的 接口地址,因为只要我把 自定义接口 里的API Key删除,但保留 接口地址,再关闭 自定义接口 ,又可以正常使用配置文件里的模型了。
等于说前端的API接口不会override配置文件中的接口,但API Key又override配置文件中的API Key……这也太奇怪了……
另外,如果我不在配置文件中设置-all,模型选项里就会出现一大堆我不想要的模型,或者说我无法指定版本的模型。难道只能一个一个通过-删除?

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


  1. Correctly display the company to which the model belongs: the company is OpenAI, not openai. Currently, the program is case-sensitive, so +model@OpenAI should be used.
  2. Successfully added DeepSeek’s model deepseek-chat: This is because your environment variable CUSTOM_MODELS is set to -all, which will prevent the front end from adding models.

Thanks for the answer. The reason why I wrote OpenAI as openai in CUSTOM_MODELS is that the reason why DeepSeek cannot be added is because OpenAI in the configuration file and ** in the custom model OpenAI** has a conflict.
about

The environment variable CUSTOM_MODELS is set to -all, which prevents the frontend from adding models.
However, I also found that if I add a model to the front end, no matter whether I turn on the custom interface, it seems that the API Key in my configuration file will be overwritten, because other models will report an error of invalid token. But it seems that the interface address in Custom Interface does not affect the interface address of the configuration file, because as long as I delete the API Key in Custom Interface and then close Custom Interface, The model in the configuration file can be used normally again.
It is equivalent to saying that the front-end API interface will not override the interface in the configuration file, but the API Key will override the interface in the configuration file... This is too strange...
In addition, if I don't set -all in the configuration file, there will be a lot of models that I don't want in the model options, or models that I cannot specify the version. Can they only be deleted one by one through -?

@SuiYunsy
Copy link

无论我是否开启 自定义接口

你指的是 点击那个方框按钮 = 开闭自定义接口 吗?以前,这个按钮仅仅是前端的一个摆设,控制是否显示自定义接口设置项目,而并不是说点击它后就能 ”开闭自定义接口“。我记得当时,只要是填入了 自定义api&key 之后,无论这个按钮是否点选,请求始终会走自定义的。我不知道现在的逻辑是什么样、是否修复了、还是说又引入了新bug(就是你提到的情况)。

难道只能一个一个通过-删除?

以前模型少的时候我是这么干的,现在模型太多了,我是直接改源码,从源头删掉乱七八糟的模型,只留个 OpenAI dall-e-3,剩下的模型通过环境变量 CUSTOM_MODELS 设置如 +glm-4-9b@OpenAI,+claude-3.5-sonnet@OpenAI,+gemini-1.5-flash@OpenAI,+gpt-4@OpenAI,然后再配合oneapi使用。

不想改源码,又不想一个一个通过-删除的话,你可以试试部署时 CUSTOM_MODELS 只 + 你要的,然后到前端去 -all,+deep-seek@OpenAI。前端的-all会把源码中所有的模型删了,但是不会删 CUSTOM_MODELS 以及前端手动 + 的模型。

image

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


No matter whether I enable custom interface

Do you mean click the box button = open and close the custom interface? In the past, this button was just a decoration on the front end, controlling whether to display the custom interface setting items, but it did not mean that clicking it would "turn on and off the custom interface". I remember that at that time, as long as the custom api&key was filled in, the request would always be customized regardless of whether the button was clicked or not. I don't know what the current logic is, whether it has been fixed, or whether a new bug has been introduced (that's the situation you mentioned).

Can they only be passed and deleted one by one?

I used to do this when there were few models. Now that there are too many models, I directly change the source code, delete the messy models from the source, leaving only OpenAI dall-e-3, and the remaining models are set through the environment variable CUSTOM_MODELS as follows +glm-4-9b@OpenAI,+claude-3.5-sonnet@OpenAI,+gemini-1.5-flash@OpenAI,+gpt-4@OpenAI, and then cooperate with [oneapi](https://github.com /MartialBE/one-hub) is used.

If you don't want to change the source code, and don't want to delete them one by one, you can try to deploy CUSTOM_MODELS + only what you want, and then go to the front end -all,+deep-seek@OpenAI. -all on the front end will delete all models in the source code, but it will not delete CUSTOM_MODELS and the models manually + on the front end.

image

@NP-Prob
Copy link
Author

NP-Prob commented Dec 13, 2024

无论我是否开启 自定义接口

你指的是 点击那个方框按钮 = 开闭自定义接口 吗?

是的,我发现现在的逻辑很奇怪,在我点开了那个方框按钮的情况下,选择OpenAI,填入API & Key就会把我环境变量里的API & Key给override掉。在我不点开那个方框按钮的情况下,API不会override,但Key会。我有点懵。🤣

难道只能一个一个通过-删除?

可以试试部署时 CUSTOM_MODELS 只 + 你要的,然后到前端去 -all,+deep-seek@OpenAI。前端的-all会把源码中所有的模型删了,但是不会删 CUSTOM_MODELS 以及前端手动 + 的模型。

原来还可以这样操作,感谢解答!我晚点试试看。不过如果按上面我发现的情况来看,这DeepSeek的模型是添加不上了,因为我用的所谓OpenAI的接口也是第三方的,DeepSeek也是第三方的,只不过形式同OpenAI,而似乎同是OpenAI的接口类别,前端和环境变量里的必会产生冲突。等于说就是从根本上不支持添加多个不同渠道的OpenAI接口标准的API。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


No matter whether I enable custom interface

Do you mean click the box button = open and close the custom interface?

Yes, I find the current logic is very strange. When I click on the box button, select OpenAI and fill in the API & Key, the API & in my environment variables will be Key is overridden. When I don't click on the box button, the API will not override, but the Key will. I'm a little confused. 🤣

Can they only be passed and deleted one by one?
You can try to deploy CUSTOM_MODELS only + what you want, and then go to the front end to -all,+deep-seek@OpenAI. -all on the front end will delete all models in the source code, but it will not delete CUSTOM_MODELS and the models manually + on the front end.

It turns out it can be done this way, thanks for the answer! I'll try it later. However, judging from what I found above, the DeepSeek model cannot be added, because it seems that they are both OpenAI interfaces, and the front-end and environment variables will definitely conflict.

@lum7na
Copy link

lum7na commented Dec 19, 2024

同求支持deepseek

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Please support deepseek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants