lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
44.35k stars 9.94k forks source link

[Bug] 无法删除/修改之前客户端环境变量时期所设置的模型 #2003

Closed zhuozhiyongde closed 7 months ago

zhuozhiyongde commented 7 months ago

💻 Operating System

macOS

📦 Environment

Docker

🌐 Browser

Safari

🐛 Bug Description

如题,近期更新了可视化的 Model list,但是在使用问题中出现了如下问题。

以往

我原先通过部署一个私有的 LobeChat 网站,供朋友们使用,然而我还有一些不愿意允许公开访问的模型,但是我想自己用,于是我通过创建一个新的 OpenAI API Key,并在客户端设置页面搭配类似如下的环境变量,实现只有本地可用 Claude 模型。

-all,+gpt-3.5-turbo-0125=GPT-3.5 Turbo,+gpt-4-0125-preview=GPT-4 Turbo,+gpt-4-vision-preview=GPT-4 Vision,+claude-3-opus-20240229=Claude-3 Opus,+claude-3-sonnet-20240229=Claude-3 Sonnet,+claude-3-haiku-20240307=Claude-3 Haiku

这样的环境变量使用。

现在

然而,更新后,我发现我似乎无法设置这个变量了,也即无法在客户端完全的自定义模型变量,取而代之的是一个获取列表的功能,这造成了不便,我无法移除、重命名原先通过本地环境变量添加的模型,也无法覆盖命名(修改提供的模型的显示名)。

举个例子,我现在的服务器 docker 配置如下:

OPENAI_MODEL_LIST=-all,+gpt-3.5-turbo-0125=GPT-3.5 Turbo,+gpt-4-turbo-2024-04-09=GPT-4 Turbo

在本地,我看到的是这样的:

image

可以看到,我无法移除/重命名原先客户端环境变量时期添加的 Claude 系列的模型,亦无法将这个原先客户端环境变量时期所设置的 GPT-4-New 重命名为 GPT-4 Turbo。

🚦 Expected Behavior

No response

📷 Recurrence Steps

No response

📝 Additional Information

No response

lobehubbot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Pull through api key

For example, what I am pulling now is the display name of GPT-4 New, and I want it to be displayed as GPT-4 Turbo (

I understand that you should be able to override the original display by adding the gpt-4-turbo model. I have specially made a user-defined model that will override the logic of the default model.

Or consider some weird second version, which does not provide the situation of obtaining the models list based on the api key.

I won’t consider this anymore. Why should I care about this weird thing?

lobehubbot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I think lobe-chat can actually make this option to allow users who do not use "middleware" such as one-api to disable permissions for additional models on the server side.

This is not planned and does not belong to the scope of lobe-chat. It should be left to someone like one-api to take care of it.

Indeed, I also feel that it is a bit overstepping my authority, but I think it is harmless to do it. Again, not everyone has one-api middleware that allows you to authenticate fine-grained, in case you directly receive the official source of openai , (for people without configuration experience) unexpected situations may occur. I only have 3.5 enabled on the server, but why can you add a 4 model on the client like this?

And if done, it should be set to on by default.

zhuozhiyongde commented 7 months ago

通过 api key 拉到

比如说我现在拉到的是 GPT-4 New 的显示名称,我希望他显示为 GPT-4 Turbo(

我理解你应该可以通过添加 gpt-4-turbo 这个模型来覆盖原有的显示,我有专门做成用户定义的模型会覆盖预设模型的逻辑。

或者考虑一些奇葩的二开,他没有提供根据 api key 获取 models list 的情况呢

这个不考虑了,为啥我要管这种奇葩?

同 model ID 只能存在一个显示项。

第二点赞同,所以我说了可做可不做(

arvinxx commented 7 months ago

万一直接接到 openai 的官方源

我记得现在官方源也有权限管理了吧。好像是可以设置 key 的权限范围的

lobehubbot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Pull through api key

For example, what I am pulling now is the display name of GPT-4 New, and I want it to be displayed as GPT-4 Turbo (

I understand that you should be able to override the original display by adding the gpt-4-turbo model. I have specially made a user-defined model that will override the logic of the default model.

Or consider some weird second version, which does not provide the situation of obtaining the models list based on the api key.

I won’t consider this anymore. Why should I care about this weird thing?

Only one display item can exist with the same model ID.

I agree with the second point, so I said whether I can do it or not (

lobehubbot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


In case of direct access to the official source of openai

I remember that official sources also have permission management now. It seems that the key can be set

zhuozhiyongde commented 7 months ago

万一直接接到 openai 的官方源

我记得现在官方源也有权限管理了吧。好像是可以设置 key 的权限范围的

诶是吗,我今年二月后就没用过官方的 API了

lobehubbot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


In case of direct access to the official source of openai

I remember that official sources also have permission management now. It seems that you can set the permission range of key

Oh, right? I haven’t used the official API since February this year.

zhuozhiyongde commented 7 months ago

草 感觉在 issue 版聊起来了,我们或许应该去 discord 讨论,在 issue 这里老给大家发邮件,不太好(

lobehubbot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I feel like we started chatting on the issue board. Maybe we should go to discord to discuss it. It’s not good to keep sending emails to everyone here on the issue board (

arvinxx commented 7 months ago

同 model ID 只能存在一个显示项。

哦 我知道了,这个算是一个小细节漏考虑了。 你可以试试先随便写一个 abx,然后把 id 改成gpt-4-turbo 呢?

lobehubbot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Only one display item can exist with the same model ID.

Oh, I know, this is a small detail that was overlooked. You can try writing abx first, and then change the id to gpt-4-turbo?

zhuozhiyongde commented 7 months ago

同 model ID 只能存在一个显示项。

哦 我知道了,这个算是一个小细节漏考虑了。 你可以试试先随便写一个 abx,然后把 id 改成gpt-4-turbo 呢?

我们在 discord 聊吧

lobehubbot commented 7 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Only one display item can exist with the same model ID.

Oh, I know, this is a small detail that was overlooked. You can try writing abx first, and then change the id to gpt-4-turbo?

Let’s chat on discord

lobehubbot commented 7 months ago

✅ @zhuozhiyongde

This issue is closed, If you have any questions, you can comment and reply.\ 此问题已经关闭。如果您有任何问题,可以留言并回复。

lobehubbot commented 7 months ago

:tada: This issue has been resolved in version 0.147.9 :tada:

The release is available on:

Your semantic-release bot :package::rocket: