-
Notifications
You must be signed in to change notification settings - Fork 239
feat: Support OpenRouter presets #1276
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?
Changes from 1 commit
1fbef24
092961b
ff6479c
66ff1bc
4c629bd
2c4bf76
509bf88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,7 @@ const URL_SCOPED_PROVIDERS: ReadonlySet<RouterName> = new Set([ | |
| // identity -- see the URL_SCOPED_PROVIDERS comment above for why this matters despite caching | ||
| // being skipped for both. | ||
| const KEY_SCOPED_PROVIDERS: ReadonlySet<RouterName> = new Set([ | ||
| providerIdentifiers.openrouter, // Per-key private/preset models (e.g. @preset/*) | ||
|
frkr marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OpenRouter fetches now use
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know |
||
| providerIdentifiers.litellm, // Per-key model allowlists are a first-class LiteLLM proxy feature | ||
| providerIdentifiers.poe, // Per-account model availability | ||
| providerIdentifiers.requesty, // Per-account custom model policies | ||
|
|
@@ -228,7 +229,10 @@ async function fetchModelsFromProvider(options: GetModelsOptions): Promise<Model | |
|
|
||
| switch (provider) { | ||
| case providerIdentifiers.openrouter: | ||
| models = await getOpenRouterModels() | ||
| models = await getOpenRouterModels({ | ||
| openRouterApiKey: options.apiKey, | ||
| openRouterBaseUrl: options.baseUrl, | ||
| }) | ||
| break | ||
| case providerIdentifiers.requesty: | ||
| // Requesty models endpoint requires an API key for per-user custom policies. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.