Feature hasn't been suggested before.
Describe the enhancement you want to request
Background / Problem
In OpenCode, the available model list can come from multiple providers/entry points (e.g., Claude Subscription, GitHub Copilot, various API providers). This often leads to:
- Duplicate models in the UI: the same underlying model (e.g., Opus 4.6) appears multiple times because it is offered by different providers, making selection confusing.
- No way to express billing/quota priority: users may want to consume the “cheapest / already-paid / subscription quota” first (e.g., Claude Pro subscription) and only fall back to pay-as-you-go APIs later.
- Manual switching is disruptive: when a provider hits quota limits, rate limits, or temporary outages, users must manually change the provider/model, breaking workflow and reliability.
Request / Desired Behavior
Add a mechanism to group/merge models by the underlying model identity, and within a merged model, automatically route requests through a user-defined provider priority order, with transparent failover to the next provider offering the same model.
Example desired flow
- User selects a single merged model: “Opus 4.6”
- Actual routing priority configured by user:
- Claude Subscription Pro
- GitHub Copilot
- API Provider A
- API Provider B
- When the first provider is out of quota / unavailable / rate-limited, OpenCode automatically switches to the next provider for the same model.
- Switching should be seamless and “invisible” to the user (no manual action required).
Proposed Solution (High-level)
1) Model De-duplication / Grouping (Model Group / Alias)
Introduce a “Model Group / Alias” concept:
- UI/config shows one model entry: e.g.,
opus-4.6 (or user-defined alias like opus46)
- The group contains multiple provider-backed implementations of the same model:
provider=claude_subscription_pro, model=opus-4.6
provider=github_copilot, model=opus-4.6
provider=api_provider_a, model=opus-4.6
- Grouping rules:
- Prefer provider-supplied canonical model id when available
- Also allow manual mapping/merging, since naming can differ across providers
2) Provider Priority Order (Cost/Quota-aware)
For each model group, allow configuring a provider priority list (user adjustable), e.g.:
claude_subscription_pro
github_copilot
api_provider_a
api_provider_b
3) Seamless Failover (Transparent fallback)
At request time:
- Try the highest priority provider first
- Automatically fall back on:
- quota/credits exhausted (
quota exceeded, insufficient credits, etc.)
- provider unavailable or timeout
- 429 rate limit (optionally after retry/backoff)
- auth failure (optionally surface a warning but still allow fallback where possible)
- Keep the user-facing selection stable:
- The model remains “Opus 4.6” (merged model)
- Optionally log/telemetry records the actual provider used (for debugging)
UX / UI Suggestions
- Default model list shows only merged models; add a toggle to “show all provider variants”
- Model details page:
- list all providers available for the merged model
- allow reordering provider priority
- show provider health/status (available / rate limited / quota exhausted / missing token, etc.)
- Runtime (optional):
- status indicator like: “Opus 4.6 (via Claude Pro)” (can be hidden)
Example Config (concept)
Illustrative only; adapt to OpenCode’s existing config format.
models:
- alias: opus-4.6
group:
- provider: claude_subscription_pro
model: opus-4.6
- provider: github_copilot
model: opus-4.6
- provider: api_provider_a
model: opus-4.6
routing:
sticky_mode: session # optional: none | session | time_window
allow_feature_downgrade: false
failover:
on:
- quota_exceeded
- rate_limited
- provider_unavailable
- timeout
retry:
attempts: 1
backoff_ms: 300
Feature hasn't been suggested before.
Describe the enhancement you want to request
Background / Problem
In OpenCode, the available model list can come from multiple providers/entry points (e.g., Claude Subscription, GitHub Copilot, various API providers). This often leads to:
Request / Desired Behavior
Add a mechanism to group/merge models by the underlying model identity, and within a merged model, automatically route requests through a user-defined provider priority order, with transparent failover to the next provider offering the same model.
Example desired flow
Proposed Solution (High-level)
1) Model De-duplication / Grouping (Model Group / Alias)
Introduce a “Model Group / Alias” concept:
opus-4.6(or user-defined alias likeopus46)provider=claude_subscription_pro, model=opus-4.6provider=github_copilot, model=opus-4.6provider=api_provider_a, model=opus-4.62) Provider Priority Order (Cost/Quota-aware)
For each model group, allow configuring a provider priority list (user adjustable), e.g.:
claude_subscription_progithub_copilotapi_provider_aapi_provider_b3) Seamless Failover (Transparent fallback)
At request time:
quota exceeded,insufficient credits, etc.)UX / UI Suggestions
Example Config (concept)