Skip to content

feat: add multi-provider support via models.dev integration#2

Draft
joshuadavidthomas wants to merge 7 commits into
mainfrom
feat/multi-provider-support
Draft

feat: add multi-provider support via models.dev integration#2
joshuadavidthomas wants to merge 7 commits into
mainfrom
feat/multi-provider-support

Conversation

@joshuadavidthomas
Copy link
Copy Markdown
Member

Fetch provider and model data from models.dev at build time, giving Open-Inspect access to every provider OpenCode supports (~94 providers, ~2500 models with tool calling). Models appear in the settings UI grouped by provider; users enable what they want.

How it works:

  • prebuild step fetches models.dev/api.json, generates models-dev-data.ts
  • isValidModel() accepts any model known to models.dev (not just the curated built-in list)
  • getAllModelOptions() returns built-in models + all models.dev providers
  • Settings page, model picker, Slack bot all use getAllModelOptions()
  • Falls back to cached data if models.dev is unreachable

Deployer adds API keys via a single Terraform map variable:

provider_api_keys = {
MISTRAL_API_KEY = "sk-..."
GOOGLE_GENERATIVE_AI_API_KEY = "AIza..."
XAI_API_KEY = "xai-..."
}

No sandbox or entrypoint changes — OpenCode handles provider init from env vars automatically.

@joshuadavidthomas joshuadavidthomas force-pushed the feat/multi-provider-support branch from be045b8 to 60f04ce Compare February 27, 2026 21:23
Fetch provider and model data from models.dev at build time, giving
Open-Inspect access to every provider OpenCode supports (~94 providers,
~2500 models with tool calling). Models appear in the settings UI
grouped by provider; users enable what they want.

How it works:
- prebuild step fetches models.dev/api.json, generates models-dev-data.ts
- isValidModel() accepts any model known to models.dev (not just the
  curated built-in list)
- getAllModelOptions() returns built-in models + all models.dev providers
- Settings page, model picker, Slack bot all use getAllModelOptions()
- Falls back to cached data if models.dev is unreachable

Deployer adds API keys via a single Terraform map variable:

  provider_api_keys = {
    MISTRAL_API_KEY                = "sk-..."
    GOOGLE_GENERATIVE_AI_API_KEY   = "AIza..."
    XAI_API_KEY                    = "xai-..."
  }

No sandbox or entrypoint changes — OpenCode handles provider init
from env vars automatically.
- Sort models.dev providers alphabetically in getAllModelOptions()
- Add a clickable provider TOC nav at the top of the models settings page
- TOC shows enabled count per provider
…ved changes

Reverted auto-save back to upstream's explicit save pattern. The save
bar now sticks to the bottom of the viewport and only appears when
there are unsaved changes.
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.

1 participant