diff --git a/README.md b/README.md index 9168480c5..f93e1530e 100644 --- a/README.md +++ b/README.md @@ -343,11 +343,14 @@ If you want to disable parse settings from url, set this to 1. To control custom models, use `+` to add a custom model, use `-` to hide a model, use `name=displayName` to customize model name, separated by comma. -User `-all` to disable all default models, `+all` to enable all default models. +Use `-all` to disable all default models, `+all` to enable all default models. +Use `-*provider` to disable specified models. +Current valid providers: `openai,azure,google,anthropic,baidu,bytedance,alibaba,tencent,moonshot,iflytek,xai,chatglm` and more to come. For Azure: use `modelName@Azure=deploymentName` to customize model name and deployment name. > Example: `+gpt-3.5-turbo@Azure=gpt35` will show option `gpt35(Azure)` in model list. > If you only can use Azure model, `-all,+gpt-3.5-turbo@Azure=gpt35` will `gpt35(Azure)` the only option in model list. +> If you don't want to use Azure model, using `-*azure` will prevent Azure models from appearing in the model list. For ByteDance: use `modelName@bytedance=deploymentName` to customize model name and deployment name. > Example: `+Doubao-lite-4k@bytedance=ep-xxxxx-xxx` will show option `Doubao-lite-4k(ByteDance)` in model list. diff --git a/app/utils/model.ts b/app/utils/model.ts index a1b7df1b6..a8ce93f4d 100644 --- a/app/utils/model.ts +++ b/app/utils/model.ts @@ -88,6 +88,13 @@ export function collectModelTable( Object.values(modelTable).forEach( (model) => (model.available = available), ); + } else if (name.startsWith("*")) { + const modelId = name.substring(1).toLowerCase(); + Object.values(modelTable).forEach((model) => { + if (model?.provider?.id === modelId) { + model.available = available; + } + }); } else { // 1. find model by name, and set available value const [customModelName, customProviderName] = getModelProvider(name);