Skip to content

[FEATURE]: Expand Openrouter Blacklist via Json #3452

Closed

Description

@KHAEntertainment

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Openrouter shows a lot of good suggestions but it also shows a lot of models I have no intent of ever using and I would rather keep it clean and lean, only suggesting the models I actually want to use. I can add new models to opencode.json which is great but I need to look through 50+ random ones in the list before I get to them.

Only current workaround is to disable your built-in openrouter provider and then re-create it as a custom provider which feels largely unnecessary just to keep things tidy.

You have a blacklist function already in providers.ts that prevents openrouter from showing GPT-5 models. Can we expand upon this filter and make it customizable via opencode.json so we can tailor the openrouter provider to be more specific to our needs?

Reference from Provider.ts lines 350 - 368

    for (const [providerID, provider] of Object.entries(providers)) {
      const filteredModels = Object.fromEntries(
        Object.entries(provider.info.models)
          // Filter out blacklisted models
          .filter(
            ([modelID]) =>
              modelID !== "gpt-5-chat-latest" && !(providerID === "openrouter" && modelID === "openai/gpt-5-chat"),
          )
          // Filter out experimental models
          .filter(([, model]) => !model.experimental || Flag.OPENCODE_ENABLE_EXPERIMENTAL_MODELS),
      )
      provider.info.models = filteredModels

      if (Object.keys(provider.info.models).length === 0) {
        delete providers[providerID]
        continue
      }
      log.info("found", { providerID })
    }

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Oct 25, 2025
  2. github-actions commented on Oct 25, 2025

    @github-actions
    Contributor

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

    • [FEATURE]: Disabling specific models through opencode.json #3411: [FEATURE]: Disabling specific models through opencode.json - This issue requests the exact same functionality to disable specific models in opencode.json so they don't show up in the model list, with the same use case of OpenRouter providing many unwanted models.

    Feel free to ignore if none of these address your specific case.

  3. rekram1-node commented on Oct 26, 2025

    @rekram1-node
    Collaborator

    @KHAEntertainment what if this was possible via the opencode plugin system, where you could have strong control of what ends up being in the list and what is dropped

    Would that be good?

  4. KHAEntertainment commented on Oct 26, 2025

    @KHAEntertainment
    Author

    @KHAEntertainment what if this was possible via the opencode plugin system, where you could have strong control of what ends up being in the list and what is dropped

    Would that be good?

    Sure. I only suggested a method as it seemed like you already had it partially implemented but whatever means you guys want to take to make the models filterable is fine with me. Thanks for the quick response!

  5. rekram1-node commented on Oct 26, 2025

    @rekram1-node
    Collaborator

    @KHAEntertainment yeah the think we have rn is just filtering out the gpt-5-chat models because unlike most gpt-5 variations they dont support tool calling and people kept filing bug reports even tho gpt-5-chat was behaving as expected so we decided to just "blacklist" it essentially until we could indicate it in the tui better

    Thanks for the quick response!

    No problem!

  6. rekram1-node commented on Oct 27, 2025

    @rekram1-node
    Collaborator

    For whatever reason I was way overcomplicating this I thought you meant something else.

    Yeah a simple blacklist can just be added into the config I think there is an open pr adding it actually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionUsed for feature requests, proposals, ideas, etc. Open discussion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions