Skip to content

feat: Add config flag to filter provider models #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ryanjdillon
Copy link

@ryanjdillon ryanjdillon commented Jul 1, 2025

Problem

When using Azure OpenAI as a model provider, all potentially available models from this service are shown, but that likely doesn't correspond to the deployed models in a workspace of this service--we have 4 deployed models. You of course get an error if you try to call a model that is not deployed.

Solution

The fix in this PR adds a flag that allows filtering to only the models defined in the config file.

Example
Here, no models will be shown for Copilot despite a Github token being found, and only 3 models of 4 deployed are shown, with the rest found and added to the database being hidden.

{
  "$schema": "https://opencode.ai/config.json",
  "onlyConfigModels": true,
  "provider": {
    "github-copilot": {
      "models": {}
    },
    "azure": {
      "models": {
        "GPT-4.1": {
          "name": "GPT4.1"
        },
        "GPT-4.1-mini": {
          "name": "GPT4.1-mini"
        },
        "GPT-4.1-nano": {
          "name": "GPT4.1-nano"
        }
      }
    }
  }
}

Alternatively, this could just be default behavior omitting the need for such a flag.

It would also be nice to query the available models to prevent the need to define models in the config., but the included solution is easy enough and allows some additional flexibility about which models to show.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants