You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom models for models.dev providers silently ignored, falls back to most expensive model #20743
When defining custom models in opencode.json for a provider that exists in models.dev (e.g. requesty), the custom model is silently ignored. OpenCode falls back to the most expensive/capable model from the models.dev snapshot instead. No error or warning is shown.
Actual: Uses google/gemini-3-pro-preview ($2/M input) — the most expensive model in the Requesty snapshot
The --model flag, the config model field, and the custom model definition are all silently ignored.
Root cause
In provider.ts, the defaultModel() function (line ~1564) checks cfg.model and calls parseModel() to get { providerID, modelID }. The TUI then validates this with isModelValid() which checks provider.models[modelID].
The custom model IS merged into the provider's models map during config loading (line ~1043). But the model key in the snapshot uses a different internal ID than what parseModel() produces, so isModelValid() returns false and the selection falls through to sort(Object.values(provider.models)) which picks the "best" (most expensive) model.
The model google/gemini-3.1-flash-lite-preview exists on Requesty's API and works fine via curl, but isn't in the models.dev snapshot for the requesty provider. Adding it via config should work per the docs but doesn't.
Impact
Users unknowingly burn 8-10x more money than intended. In our case, a witness agent meant to run on a $0.25/M model was running on a $2/M model, costing $1+ in minutes with no indication anything was wrong.
Environment
opencode v1.3.13
Provider: requesty (exists in models.dev)
Custom model: google/gemini-3.1-flash-lite-preview (not in models.dev snapshot for requesty)
This issue might be a duplicate of existing issues. Please check:
Vultr provider model selection not respected #18352: Vultr provider model selection not respected — same symptom of the selected model being silently ignored and a different (more expensive) model being used instead
Activity
github-actions commentedon Apr 2, 2026
This issue might be a duplicate of existing issues. Please check:
If any of these cover your issue, please consider adding a comment there rather than opening a new report.
feat: add missing Gemini Flash Lite models to Requesty provider
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.