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

[Request] 服务端配置自定义模型服务商 #6311

Open
Steve235lab opened this issue Feb 19, 2025 · 4 comments
Open

[Request] 服务端配置自定义模型服务商 #6311

Steve235lab opened this issue Feb 19, 2025 · 4 comments
Labels
🌠 Feature Request New feature or request | 特性与建议 Model Provider 模型服务商

Comments

@Steve235lab
Copy link

Steve235lab commented Feb 19, 2025

🥰 需求描述

目前虽然在self-hosted服务端通过环境变量的方式提供了大量的模型服务商供选择,但是如果希望使用私有部署的模型API或接入相对不知名的模型服务商,只能在客户端添加仅在当前账号下可用的自定义模型服务商配置,而管理员没有办法为所有的用户统一配置。因此我希望能提供一种方法,由管理员在服务端的配置文件中声明自定义模型服务商及其下属的模型。

🧐 解决方案

可以添加一个CUSTOM_MODEL_PROVIDERS服务端环境变量,接收json字符串,例如

[
    {
        "provider_id": "my_provider",
        "provider_name": "My Provider",
        "provider_description": "A demo provider",
        "provider_logo": "https://logo-url",
        "request_format": "openai", // "openai" or "anthropic" or "ollama"
        "proxy_url": "https://xxxx-proxy.com/v1",
        "api_key": "xxxxx",
        "model_list": [
            {
                "model_id": "my_model",
                "model_display_name": "My Model",
                "maximum_context": 64000,
                "support_tool": true,
                "support_vision": true,
                "support_deep_think": true
            },
            ...
        ]
    },
    ...   
]

上面的例子包含换行方便阅读,实际添加应该join lines,例如CUSTOM_MODEL_PROVIDERS='[ { "provider_id": "my_provider", "provider_name": "My Provider", "provider_description": "A demo provider", "provider_logo": "https://logo-url", "request_format": "openai", "proxy_url": "https://xxxx-proxy.com/v1", "api_key": "xxxxx", "model_list": [ { "model_id": "my_model", "model_display_name": "My Model", "maximum_context": 64000, "support_tool": true, "support_vision": true, "support_deep_think": true }, ... ] }, ... ]'

@Steve235lab Steve235lab added the 🌠 Feature Request New feature or request | 特性与建议 label Feb 19, 2025
@lobehubbot
Copy link
Member

👀 @Steve235lab

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@lobehubbot
Copy link
Member

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


🥰 Requirement description

Although there are currently a large number of model service providers to choose from on the self-hosted server through environment variables, if you want to use a privately deployed model API or access a relatively unknown model service provider, you can only add only one on the client The custom model service provider configuration available under the current account, but the administrator has no way to configure it for all users. So I hope to provide a way to declare the model of the custom model provider and its subordinates by the administrator in the configuration file on the server.

🧐 Solution

You can add a CUSTOM_MODEL_PROVIDERS server environment variable to receive a json string, for example

📝 Supplementary information

No response

@dosubot dosubot bot added the Model Provider 模型服务商 label Feb 19, 2025
@verehu
Copy link

verehu commented Feb 21, 2025

非常需要

@lobehubbot
Copy link
Member

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


Very needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌠 Feature Request New feature or request | 特性与建议 Model Provider 模型服务商
Projects
None yet
Development

No branches or pull requests

3 participants