feat: support disabled flag on individual provider models#21038
feat: support disabled flag on individual provider models#21038fpigeonjr wants to merge 1 commit intoanomalyco:devfrom
Conversation
Add a `disabled` boolean field to the per-model config schema so users can
hide specific models from the model picker without removing the entire provider.
When `disabled: true` is set on a model entry, it is deleted from the provider's
live model map during the final filter pass — the same approach used by the
existing blacklist, whitelist, alpha, and deprecated filters.
This follows the same pattern already used for variant-level `disabled` flags.
Example usage:
```json
{
"provider": {
"github-copilot": {
"models": {
"gpt-5.4": { "disabled": true },
"gpt-5.3-codex": { "disabled": true }
}
}
}
}
```
Fixes anomalyco#21035
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: PR #10116: feat(opencode): add config options to enable or disable models per provider This PR appears to address a similar feature - allowing users to enable/disable models at the provider level. It may be worth reviewing to understand how it differs from the current PR #21038, which specifically targets disabling individual models within a provider rather than at the provider level. However, since PR #21038 is specifically about per-model disabling (more granular) versus provider-level control, they may be complementary rather than duplicative. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
This is a must-have when working with multiple providers. Hope they merge it. |
Issue for this PR
Closes #21035
Type of change
What does this PR do?
Adds a
disabledboolean to the per-model config schema so users can hide specific models from the picker without removing the entire provider.Two changes:
config.ts— addsdisabled: z.boolean().optional()to the model entry schema (same pattern as the existing variant-leveldisabledfield)provider.ts— adds one check in the final filter loop:if (configProvider?.models?.[modelID]?.disabled === true) delete provider.models[modelID](same pattern as the existingblacklist/deprecatedfilters)Use case: GitHub Copilot exposes many models in models.dev but only a subset are available on a given subscription tier. This lets users trim the list to what they actually have access to.
How did you verify your code works?
Reviewed the existing filter loop and schema patterns. The change follows the exact same delete-from-map approach used by
blacklist,deprecated, andalphamodel filtering. No existing tests broken.Screenshots / recordings
N/A — no UI changes, models simply no longer appear in the picker when disabled.
Checklist