Skip to content

feat(provider): add Routerra as a built-in OpenAI-compatible provider preset#1997

Merged
zerob13 merged 1 commit into
ThinkInAIXYZ:devfrom
cunninghamcard-bit:feature/routerra-preset
Jul 19, 2026
Merged

feat(provider): add Routerra as a built-in OpenAI-compatible provider preset#1997
zerob13 merged 1 commit into
ThinkInAIXYZ:devfrom
cunninghamcard-bit:feature/routerra-preset

Conversation

@cunninghamcard-bit

@cunninghamcard-bit cunninghamcard-bit commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

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)

  1. Default preset — added routerra to DEFAULT_PROVIDERS in src/main/provider/defaults.ts, mirroring the existing OpenAI-compatible aggregator entries (openrouter, opencode-go). apiType: 'openai-completions', enable: false by default.

  2. Icon — added Routerra's brand logo at src/renderer/src/assets/llm-icons/routerra.svg and registered it in modelIconRegistry.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/status config (system_name: "Routerra", logo: ".../site/favicon.svg") — deliberately not the default New API gateway image that routerra.ai/logo.png serves. It is a colored logo, so it is intentionally not added to the monochrome-tint set.

  3. Deeplink — no provider-specific code. Covered by the generic provider/install flow: handleProviderInstallparseProviderInstallParams validates a builtin id via providerInstall.hasProvider(id); adding routerra to DEFAULT_PROVIDERS makes that resolve, and iconModelId: id picks up the icon above.

    A working install deeplink (payload = {"id":"routerra","baseUrl":"https://routerra.ai/v1","apiKey":"<ROUTERRA_API_KEY>"}):

    deepchat://provider/install?v=1&data=eyJpZCI6InJvdXRlcnJhIiwiYmFzZVVybCI6Imh0dHBzOi8vcm91dGVycmEuYWkvdjEiLCJhcGlLZXkiOiI8Uk9VVEVSUkFfQVBJX0tFWT4ifQ%3D%3D
    

    (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.)

  4. i18nno provider-specific locale key exists or is needed. The provider's display name comes from the name field in defaults.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 no welcome.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 uses https://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-compatible 401 {"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 to api.routerra.ai if 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: pass
  • test:main (incl. providerDeeplink.test.ts): pass
  • provider/icon renderer tests (iconWhitelist, ModelIcon, ModelProviderSettings, ProviderApiConfig, providerDeeplinkImportStore, SettingsApp.providerDeeplink): pass
  • Manual (pnpm 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

  • New Features
    • Added Routerra as an available provider option.
    • Added Routerra model branding and icon support.
    • Routerra is disabled by default and can be enabled when needed.

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.
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds Routerra as a disabled OpenAI-compatible default provider and registers its color icon in the renderer model icon map.

Changes

Routerra registration

Layer / File(s) Summary
Provider and icon registration
src/main/provider/defaults.ts, src/renderer/src/components/icons/modelIconRegistry.ts
Adds Routerra provider metadata with its API base URL and website links, then maps the routerra icon key to routerraColorIcon.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested reviewers: zerob13

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding Routerra as a built-in provider preset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a9ea0e7 and 6ad26db.

⛔ Files ignored due to path filters (1)
  • src/renderer/src/assets/llm-icons/routerra.svg is excluded by !**/*.svg
📒 Files selected for processing (2)
  • src/main/provider/defaults.ts
  • src/renderer/src/components/icons/modelIconRegistry.ts

Comment thread src/main/provider/defaults.ts
@zerob13
zerob13 merged commit 3464d91 into ThinkInAIXYZ:dev Jul 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants