opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Feature: Support disabled_models config to hide specific models

Open arlishansenn opened this issue 1 day ago • 2 comments

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

arlishansenn avatar Jan 18 '26 05:01 arlishansenn