[FEATURE]: Expand Openrouter Blacklist via Json #2285

Closed
opened 2026-02-16 17:34:58 -05:00 by yindo · 5 comments
Owner

Originally created by @KHAEntertainment on GitHub (Oct 25, 2025).

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 })
    }
Originally created by @KHAEntertainment on GitHub (Oct 25, 2025). ### 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 }) } ```
yindo added the discussion label 2026-02-16 17:34:58 -05:00
yindo closed this issue 2026-02-16 17:34:58 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 25, 2025):

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

  • #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.

@github-actions[bot] commented on GitHub (Oct 25, 2025): This issue might be a duplicate of existing issues. Please check: - #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.
Author
Owner

@rekram1-node commented on GitHub (Oct 25, 2025):

@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?

@rekram1-node commented on GitHub (Oct 25, 2025): @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?
Author
Owner

@KHAEntertainment commented on GitHub (Oct 26, 2025):

@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!

@KHAEntertainment commented on GitHub (Oct 26, 2025): > [@KHAEntertainment](https://github.com/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!
Author
Owner

@rekram1-node commented on GitHub (Oct 26, 2025):

@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!

@rekram1-node commented on GitHub (Oct 26, 2025): @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!
Author
Owner

@rekram1-node commented on GitHub (Oct 27, 2025):

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

@rekram1-node commented on GitHub (Oct 27, 2025): 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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2285