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

fix: models api return models in deactivate channels #2150

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Laisky
Copy link
Contributor

@Laisky Laisky commented Feb 27, 2025

问题

/v1/models 这个接口,本来应该返回用户有权限且激活的 models,但实际上,如果在未激活的 channel 里存在和激活的 channel 同名的 models,这些未激活的 models 也会被返回。

原因在于 one-api 里都是通过 model name 来存储元数据和匹配的,无法区分是否来自于激活的 channel。

修改

在匹配 model 时,改用 model_name:adaptor_name 的形式来匹配。

自测

仅有 vertex 激活时,不会再错误的返回 gemini 的 models

CleanShot 2025-02-27 at 09 15 10@2x

- Enhance logging functionality by adding context support and improving debugging options.
- Standardize function naming conventions across middleware to ensure consistency.
- Optimize data retrieval and handling in the model controller, including caching and error management.
- Simplify the bug report template to streamline the issue reporting process.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant