-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat: Add OpenRouter Provider Support with Dynamic Model Loading #8738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: Add OpenRouter Provider Support with Dynamic Model Loading #8738
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 6 files
Prompt for AI agents (all 2 issues)
Understand the root cause of the following 2 issues and fix them.
<file name="gui/src/pages/AddNewModel/configs/openRouterModel.ts">
<violation number="1" location="gui/src/pages/AddNewModel/configs/openRouterModel.ts:60">
Because nearly every OpenRouter model populates `architecture.modality`, this condition marks all of them as not open source—including open-weight models—so they disappear from any open-source-only filters. Please base `isOpenSource` on a discriminator that actually reflects open weights (e.g., the presence of a Hugging Face ID) instead of the modality flag.</violation>
</file>
<file name="gui/src/components/modelSelection/ModelSelectionListbox.tsx">
<violation number="1" location="gui/src/components/modelSelection/ModelSelectionListbox.tsx:161">
Popular list entries lost the pointer cursor class, so they no longer show a pointer on hover—please add `cursor-pointer` back to keep them visibly interactive.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| model: model.id, | ||
| contextLength, | ||
| }, | ||
| isOpenSource: model.architecture?.modality ? false : true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because nearly every OpenRouter model populates architecture.modality, this condition marks all of them as not open source—including open-weight models—so they disappear from any open-source-only filters. Please base isOpenSource on a discriminator that actually reflects open weights (e.g., the presence of a Hugging Face ID) instead of the modality flag.
Prompt for AI agents
Address the following comment on gui/src/pages/AddNewModel/configs/openRouterModel.ts at line 60:
<comment>Because nearly every OpenRouter model populates `architecture.modality`, this condition marks all of them as not open source—including open-weight models—so they disappear from any open-source-only filters. Please base `isOpenSource` on a discriminator that actually reflects open weights (e.g., the presence of a Hugging Face ID) instead of the modality flag.</comment>
<file context>
@@ -0,0 +1,107 @@
+ model: model.id,
+ contextLength,
+ },
+ isOpenSource: model.architecture?.modality ? false : true,
+ tags: [provider as any],
+ };
</file context>
✅ Addressed in 564e0b0
ai suggestion Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
…tha-sarathyy/continue into addmodel-openrouter-provider
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@partha-sarathyy this is great!
The only change I'd request is could you write a super simple script or similar to eliminate all the unused parameters/extra data from the operouter models JSON to whittle it down to a more manageable size? I think it should be a few hundred lines tops. You might even just prompt Continue to rewrite it with the following changes:
- Descriptions need to be shorter to fit in the UI. Once brief sentence max
- All unused fields should be eliminated (most of them)
You could include brief instructions on where you got the JSON and the prompt you used to clean it up, in a comment
|
@RomneyDa thanks for the review. |
feat(openrouter): Add OpenRouter Provider Support with Dynamic Model Loading
Overview
This PR adds OpenRouter as a model provider in Continue, with automatic model loading from OpenRouter JSON data and an enhanced model selection UI featuring fuzzy search.
Changes Made
1. OpenRouter Model Data Processing (
openRouterModel.ts)ModelPackageformat.openRouterModels.json.ModelPackagetype.openRouterModels) and array (openRouterModelsList) formats.Files:
2. Provider Configuration (
providers.ts)openRouterModelsList.OpenRouteropenrouter.pngFile:
3. Enhanced Model Selection UI (
ModelSelectionListbox.tsx)searchPlaceholderprop for context-specific labels.File:
Other modified imports:
Search Algorithm Details
UI Improvements
@heroicons/react/24/outline.Technical Details
New Dependencies
useState,useEffect,useMemo.File Structure (new / modified)
Usage Examples
For users:
gpt,claude,llama.Files Added
openrouter.png(ensure included in repo assets)Tests / Verification
openRouterModels.json.Notes for Reviewers
openRouterModels.jsonandopenrouter.pngare included in packaged assets/build.Breaking Changes
!and a BREAKING CHANGE section.Changelog (one-liner)
feat(openrouter): add OpenRouter provider with dynamic model loading and fuzzy search for model selection
Adds OpenRouter as a provider with dynamic model loading from OpenRouter data and adds fuzzy search to the model/provider selection for faster discovery.