Skip to content

fix: support provider-filtered 'all' in CUSTOM_MODELS#6740

Open
octo-patch wants to merge 1 commit into
ChatGPTNextWeb:mainfrom
octo-patch:fix/issue-6647-provider-filtered-all
Open

fix: support provider-filtered 'all' in CUSTOM_MODELS#6740
octo-patch wants to merge 1 commit into
ChatGPTNextWeb:mainfrom
octo-patch:fix/issue-6647-provider-filtered-all

Conversation

@octo-patch

Copy link
Copy Markdown

Fixes #6647

Problem

When using CUSTOM_MODELS=-all,+gpt-4.1,+gpt-4o in a Docker deployment, users unexpectedly see gpt-4.1 302.AI and gpt-4.1 Azure in the model list alongside gpt-4.1 (OpenAI). This happens because:

  1. gpt-4.1 exists in DEFAULT_MODELS under three providers: OpenAI, Azure (all OpenAI models are mirrored there), and 302.AI
  2. +gpt-4.1 without a provider suffix re-enables gpt-4.1 for all providers after -all has disabled them

Solution

Add support for an @provider suffix on the all keyword in CUSTOM_MODELS, enabling provider-scoped enable/disable operations:

Syntax Effect
-all Disable all models (existing behavior, unchanged)
-all@azure Disable only Azure models
-all@ai302 Disable only 302.AI models
+all@openai Enable only OpenAI models

Users with the reported issue now have two clean options:

Option A – Specify provider explicitly when re-enabling:

CUSTOM_MODELS=-all,+gpt-4.1@openai,+gpt-4o@openai

Option B – Disable unwanted providers after enabling:

CUSTOM_MODELS=-all,+gpt-4.1,+gpt-4o,-all@azure,-all@ai302

Changes

  • app/utils/model.ts: Move getModelProvider() call before the all check so the provider suffix is parsed in all cases. The all branch now filters by model.provider?.id when a provider suffix is present.
  • Minor refactor: replaced the shadowed inner let [customModelName, customProviderName] in the if (count === 0) block with let newModelName = customModelName to avoid confusing variable re-declaration.

Testing

Existing behavior is unchanged for CUSTOM_MODELS strings that do not use the new @provider suffix on all. The new all@provider feature can be verified manually by setting:

CUSTOM_MODELS=-all,+gpt-4.1,-all@azure,-all@ai302

and confirming only the OpenAI gpt-4.1 entry appears in the model selector.

…extWeb#6647)

When using CUSTOM_MODELS=-all,+gpt-4.1, the model gpt-4.1 was being
enabled for ALL providers (OpenAI, Azure, 302.AI) because it exists in
multiple DEFAULT_MODELS entries. This caused unexpected provider variants
to appear in the model list even when those providers are not configured.

This fix adds support for an @Provider suffix on the "all" keyword, e.g.:
  -all@azure    disable all Azure models
  -all@ai302    disable all 302.AI models

Users can now use: CUSTOM_MODELS=-all,+gpt-4.1@openai
or: CUSTOM_MODELS=-all,+gpt-4.1,-all@azure,-all@ai302
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant