Feature: Support disabled_models config to hide specific models #6668

Open
opened 2026-02-16 18:04:54 -05:00 by yindo · 8 comments
Owner

Originally created by @arlishansenn on GitHub (Jan 18, 2026).

Originally assigned to: @thdxr on GitHub.

Summary

Currently, opencode supports disabled_providers to disable entire providers, but there's no way to disable specific models within a provider.

Use Case

When using providers like google, many models are listed but not all are actually available:

  • google/gemini-1.5-* - 404 Not Found
  • google/gemini-2.0-* - 404 or unsupported
  • google/*-tts*, *-image*, *-live*, *-embedding* - Not suitable for chat

Out of 26 Google models listed, only 5 are actually usable for chat:

  • google/gemini-2.5-flash
  • google/gemini-2.5-pro
  • google/gemini-2.5-flash-lite
  • google/gemini-3-flash-preview
  • google/gemini-3-pro-preview

Proposed Solution

Add a disabled_models config option in opencode.json:

```json
{
"disabled_providers": ["poe"],
"disabled_models": [
"google/gemini-1.5-",
"google/gemini-2.0-
",
"google/-tts",
"google/-image",
"google/-live",
"google/-embedding"
]
}
```

Features:

  • Support glob patterns (e.g., google/gemini-1.5-*)
  • Support exact model IDs (e.g., google/gemini-flash-latest)
  • Hidden models won't appear in opencode models output
  • Hidden models won't be selectable in the UI

Workaround

I've built checkmodel which maintains its own blacklist at ~/.config/checkmodel/checkmodel.json, but this only affects checkmodel's testing - the models still appear in opencode.

Benefits

  1. Cleaner model list - only show models that actually work
  2. Prevent user confusion when selecting unavailable models
  3. Reduce API errors from attempting to use unsupported models
Originally created by @arlishansenn on GitHub (Jan 18, 2026). Originally assigned to: @thdxr on GitHub. ## Summary Currently, opencode supports `disabled_providers` to disable entire providers, but there's no way to disable specific models within a provider. ## Use Case When using providers like `google`, many models are listed but not all are actually available: - `google/gemini-1.5-*` - 404 Not Found - `google/gemini-2.0-*` - 404 or unsupported - `google/*-tts*`, `*-image*`, `*-live*`, `*-embedding*` - Not suitable for chat Out of 26 Google models listed, only 5 are actually usable for chat: - `google/gemini-2.5-flash` - `google/gemini-2.5-pro` - `google/gemini-2.5-flash-lite` - `google/gemini-3-flash-preview` - `google/gemini-3-pro-preview` ## Proposed Solution Add a `disabled_models` config option in `opencode.json`: \`\`\`json { "disabled_providers": ["poe"], "disabled_models": [ "google/gemini-1.5-*", "google/gemini-2.0-*", "google/*-tts*", "google/*-image*", "google/*-live*", "google/*-embedding*" ] } \`\`\` Features: - Support glob patterns (e.g., `google/gemini-1.5-*`) - Support exact model IDs (e.g., `google/gemini-flash-latest`) - Hidden models won't appear in `opencode models` output - Hidden models won't be selectable in the UI ## Workaround I've built [checkmodel](https://github.com/arlishansenn/checkmodel) which maintains its own blacklist at `~/.config/checkmodel/checkmodel.json`, but this only affects checkmodel's testing - the models still appear in opencode. ## Benefits 1. Cleaner model list - only show models that actually work 2. Prevent user confusion when selecting unavailable models 3. Reduce API errors from attempting to use unsupported models
Author
Owner

@github-actions[bot] commented on GitHub (Jan 18, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #1214: feature: filter unsupported models - Requests ability to filter out models blocked by employer or not supported
  • #4476: /models shows all available models rather than those restricted in opencode.json - User expects opencode.json model restrictions to filter the /models output
  • #7256: GitHub Copilot provider lists unavailable models instead of org-enabled ones - Models unavailable for organization should not be displayed

These issues all relate to filtering/hiding unavailable or unwanted models from the UI and command output.

Feel free to ignore if your specific use case with Google models and glob pattern support addresses a different need than these.

@github-actions[bot] commented on GitHub (Jan 18, 2026): This issue might be a duplicate of existing issues. Please check: - #1214: feature: filter unsupported models - Requests ability to filter out models blocked by employer or not supported - #4476: /models shows all available models rather than those restricted in opencode.json - User expects opencode.json model restrictions to filter the /models output - #7256: GitHub Copilot provider lists unavailable models instead of org-enabled ones - Models unavailable for organization should not be displayed These issues all relate to filtering/hiding unavailable or unwanted models from the UI and command output. Feel free to ignore if your specific use case with Google models and glob pattern support addresses a different need than these.
Author
Owner

@kostrse commented on GitHub (Jan 18, 2026):

The config structure could be per provider rather than a plain list.

And maybe similar syntax to permissions where all can be disabled except a few, or vice versa?

@kostrse commented on GitHub (Jan 18, 2026): The config structure could be per provider rather than a plain list. And maybe similar syntax to permissions where all can be disabled except a few, or vice versa?
Author
Owner

@KelvinJRosado commented on GitHub (Jan 21, 2026):

I think it would also be beneficial to add enabled_models to mirror how we have enabled_providers and disabled_providers. That way we can whitelist specific models we want to use and/or blacklist models to avoid

@KelvinJRosado commented on GitHub (Jan 21, 2026): I think it would also be beneficial to add `enabled_models` to mirror how we have `enabled_providers` and `disabled_providers`. That way we can whitelist specific models we want to use and/or blacklist models to avoid
Author
Owner

@KelvinJRosado commented on GitHub (Jan 23, 2026):

This would be super helpful in my work environment, where there's only certain models that we're allowed to use. Or even just for cases where users have a preference for certain models. So I went ahead and opened a PR to add this along with am enabled_models option to mirror how providers can be enabled/disabled

@KelvinJRosado commented on GitHub (Jan 23, 2026): This would be super helpful in my work environment, where there's only certain models that we're allowed to use. Or even just for cases where users have a preference for certain models. So I went ahead and opened a PR to add this along with am `enabled_models` option to mirror how providers can be enabled/disabled
Author
Owner

@thefuga commented on GitHub (Feb 4, 2026):

That would indeed be useful, but also an option to hide models from providers that are not connected and an inclusion list - instead of a blacklist, to only show the models you want - it's easier to say "show only Claude 4.5 Opus" than having to blacklist exclude else.

@thefuga commented on GitHub (Feb 4, 2026): That would indeed be useful, but also an option to hide models from providers that are not connected and an inclusion list - instead of a blacklist, to only show the models you want - it's easier to say "show only Claude 4.5 Opus" than having to blacklist exclude else.
Author
Owner

@KeithHanson commented on GitHub (Feb 8, 2026):

Need this as well! Openrouter is consistently unreliable in my model selector. I'd prefer to manually hard code these and manage it myself than rely on upstream updates and such. +1 for the "disable all except for these" functionality.

@KeithHanson commented on GitHub (Feb 8, 2026): Need this as well! Openrouter is consistently unreliable in my model selector. I'd prefer to manually hard code these and manage it myself than rely on upstream updates and such. +1 for the "disable all except for these" functionality.
Author
Owner

@nulladdict commented on GitHub (Feb 12, 2026):

this is a useful feature for the tui mode
Currently in the app i can disable outdated models from copilot provider but in the tui i cannot and the model list is getting quite unwieldily

@nulladdict commented on GitHub (Feb 12, 2026): this is a useful feature for the tui mode Currently in the app i can disable outdated models from copilot provider but in the tui i cannot and the model list is getting quite unwieldily
Author
Owner

@eduardolat commented on GitHub (Feb 13, 2026):

+1, for the moment, this worked for me:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "github-copilot": {
      "whitelist": [
        "claude-opus-4.6",
        "claude-sonnet-4.5",
        "gemini-3-flash-preview",
        "gemini-3-pro-preview",
        "gpt-5.3-codex",
        "gpt-5-mini",
        "grok-code-fast-1"
      ]
    },
    "zai-coding-plan": {
      "whitelist": [
        "glm-5",
        "glm-4.7",
        "glm-4.7-flash"
      ]
    },
  }
}
Image Image

Here's the code:

It works but needs to be documented

@eduardolat commented on GitHub (Feb 13, 2026): +1, for the moment, this worked for me: ```json { "$schema": "https://opencode.ai/config.json", "provider": { "github-copilot": { "whitelist": [ "claude-opus-4.6", "claude-sonnet-4.5", "gemini-3-flash-preview", "gemini-3-pro-preview", "gpt-5.3-codex", "gpt-5-mini", "grok-code-fast-1" ] }, "zai-coding-plan": { "whitelist": [ "glm-5", "glm-4.7", "glm-4.7-flash" ] }, } } ``` <img width="491" height="293" alt="Image" src="https://github.com/user-attachments/assets/62b87d66-2772-448f-8955-9692b879e080" /> <img width="756" height="607" alt="Image" src="https://github.com/user-attachments/assets/5782685c-72de-4159-9b22-7784afeff207" /> Here's the code: - https://github.com/anomalyco/opencode/blob/bc1fd0633dfd021545cd22041fab995f93ec2413/packages/opencode/src/config/config.ts#L953 - https://github.com/anomalyco/opencode/blob/bc1fd0633dfd021545cd22041fab995f93ec2413/packages/opencode/src/provider/provider.ts#L950 It works but needs to be documented
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6668