feat(provider): add Routerra as a built-in OpenAI-compatible provider preset#1997
Merged
zerob13 merged 1 commit intoJul 19, 2026
Merged
Conversation
Implements ThinkInAIXYZ#1911. Adds routerra to DEFAULT_PROVIDERS (openai-completions, disabled by default), registers Routerra's brand logo in modelIconRegistry, and relies on the existing generic provider/install deeplink flow (no provider-specific code). Provider name comes from defaults.ts, so no i18n key is needed. The icon is Routerra's own brand mark (routerra.svg), declared as the site logo in the provider's public /api/status config; it is intentionally NOT the default New API gateway image that routerra.ai/logo.png serves. Uses the issue body's base URL https://routerra.ai/v1; the thread's api.routerra.ai/v1 variant fails TLS from our network, flagged in the PR for maintainer confirmation.
Contributor
📝 WalkthroughWalkthroughAdds Routerra as a disabled OpenAI-compatible default provider and registers its color icon in the renderer model icon map. ChangesRouterra registration
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/provider/defaults.ts`:
- Around line 377-384: Update the Routerra provider defaults in the visible
configuration object so both baseUrl and websites.defaultBaseUrl use
https://api.routerra.ai/v1, while leaving the other website URLs unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7f20132b-3510-4aa8-800b-3005601a504c
⛔ Files ignored due to path filters (1)
src/renderer/src/assets/llm-icons/routerra.svgis excluded by!**/*.svg
📒 Files selected for processing (2)
src/main/provider/defaults.tssrc/renderer/src/components/icons/modelIconRegistry.ts
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #1911.
What
Adds Routerra as a built-in provider preset, following the proposal and @zerob13's guidance in the issue.
Scope (item-by-item to the maintainer's guidance)
Default preset — added
routerratoDEFAULT_PROVIDERSinsrc/main/provider/defaults.ts, mirroring the existing OpenAI-compatible aggregator entries (openrouter,opencode-go).apiType: 'openai-completions',enable: falseby default.Icon — added Routerra's brand logo at
src/renderer/src/assets/llm-icons/routerra.svgand registered it inmodelIconRegistry.ts. The asset is Routerra's own mark (a cyan "R" on a dark rounded square), declared as the site logo in the provider's public/api/statusconfig (system_name: "Routerra",logo: ".../site/favicon.svg") — deliberately not the default New API gateway image thatrouterra.ai/logo.pngserves. It is a colored logo, so it is intentionally not added to the monochrome-tint set.Deeplink — no provider-specific code. Covered by the generic
provider/installflow:handleProviderInstall→parseProviderInstallParamsvalidates a builtin id viaproviderInstall.hasProvider(id); addingrouterratoDEFAULT_PROVIDERSmakes that resolve, andiconModelId: idpicks up the icon above.A working install deeplink (payload =
{"id":"routerra","baseUrl":"https://routerra.ai/v1","apiKey":"<ROUTERRA_API_KEY>"}):(Minor heads-up: the example deeplink in the issue base64-encodes
api.routerra.ai/v1, which doesn't resolve from our network — see the base-URL note below.)i18n — no provider-specific locale key exists or is needed. The provider's display name comes from the
namefield indefaults.ts("Routerra"), rendered directly in the provider list — not from i18n. The only i18n-driven provider labels are the WelcomePage's hardcoded featured grid (WelcomePage.vue, 6 curated headline providers); Routerra is not one of those, so nowelcome.page.providers.*key applies. Adding one would be a dead key across all locales.Note on the base URL (please confirm)
The issue body proposes
https://routerra.ai/v1; a later example in the thread useshttps://api.routerra.ai/v1. Observed from our network they differ:https://api.routerra.ai/v1/models→ TLS connection fails, no HTTP response (http_code=000,SSL_ERROR_SYSCALL).https://routerra.ai/v1/models→ returns an OpenAI/New-API-compatible401 {"error":{"type":"new_api_error", ...}}.So this PR uses
https://routerra.ai/v1(the issue body's value). Maintainers: please confirm the canonical base URL — happy to switch toapi.routerra.aiif that's the intended host and it's reachable on your side.Testing (node 24.14.1 via the repo's
mise.toml)typecheck(node + web),oxlint,oxfmt --check: passtest:main(incl.providerDeeplink.test.ts): passiconWhitelist,ModelIcon,ModelProviderSettings,ProviderApiConfig,providerDeeplinkImportStore,SettingsApp.providerDeeplink): passpnpm run dev): Routerra appears in the provider list, is selectable, the brand icon renders, and the config panel shows the base URL / API-key fields correctly; the install deeplink above opens the Import Provider dialog with the icon, URL, and masked key.Summary by CodeRabbit