Enhance OpenRouter integration with dynamic model fetching#94
Enhance OpenRouter integration with dynamic model fetching#94demonarch wants to merge 2 commits intovirattt:mainfrom
Conversation
- Add OpenRouter API utility to fetch available models - Update model selection to show browsable list instead of free-text input - Add graceful error handling for API failures - Update documentation in FEATURES.md
|
Thanks for the contribution — I spotted a couple of issues that need fixing before we can merge:
|
| # | Severity | Issue |
|---|---|---|
| 1 | bug | string[] → Model[] mismatch, list renders blank |
| 2 | bug | setPendingModels instead of setPendingSelectedModelId, API key flow always fails |
| 3 | nit | openrouter: prefix not stripped, no checkmark on current model |
| 4 | optional | 345+ models with no search/filter |
Summary
This PR enhances the OpenRouter integration to dynamically fetch available models from the OpenRouter API, similar to how Ollama fetches models locally.
Changes
src/utils/openrouter.ts- OpenRouter API utility to fetch 345+ available modelsFEATURES.mdto document changes and improvementsUser Experience
Before:
After:
Testing
Backward Compatibility
All existing OpenRouter configurations and stored preferences continue to work without any changes required.