Add OpenPaths model provider#3761
Conversation
OpenPaths is an OpenAI-compatible model gateway (same role as OpenRouter). This registers it as a first-class provider, mirroring the OpenRouter / SiliconFlow provider definitions: - Add `OpenPaths = 'openpaths'` to ModelProviderEnum. - Add provider definition (apiHost https://openpaths.io/v1, OpenAI type) with the curated openpaths/auto + tier model ids. - Add OpenAICompatible-based model class pointing at the OpenPaths gateway. - Register the provider in the providers index and provider name hash / menu list, and mark it OpenAI-compatible in llm_utils. - Add the provider icon. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6c573a8a3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| modelId: 'openpaths/auto-image', | ||
| nickname: 'Auto Image', | ||
| capabilities: ['vision'], |
There was a problem hiding this comment.
Remove image-generation router from chat defaults
When OpenPaths is configured, this entry is treated as a chat model because ModelSelector includes models with no type or type === 'chat', but OpenPaths documents openpaths/auto-image as an image-generation model served via the image endpoint. Since the new OpenPaths class extends OpenAICompatible without image-generation support, selecting “Auto Image” in a chat session sends it through chat completions with vision capabilities and will fail for users who pick that default model; either mark/remove it from the chat defaults or add the provider to the image-generation path.
Useful? React with 👍 / 👎.
What
Adds OpenPaths as a first-class model provider.
OpenPaths is an OpenAI-compatible model gateway (same role as OpenRouter): a single
endpoint that routes to many underlying models. It exposes the standard OpenAI API at
https://openpaths.io/v1(chat completions +/v1/models), authenticates with aBearerAPI key, and offers anopenpaths/autorouter plus task-specificauto-*tiers (code / fast / cheap / reasoning / vision / image).
Because it is fully OpenAI-compatible, the implementation mirrors the existing
OpenRouter / SiliconFlow provider definitions rather than introducing any new SDK.
Changes
src/shared/types/provider.ts— addOpenPaths = 'openpaths'toModelProviderEnum.src/shared/providers/definitions/openpaths.ts— provider definition:type: OpenAI,apiHost: https://openpaths.io/v1, curatedopenpaths/auto+ tier model ids, andlinks back to openpaths.io.
src/shared/providers/definitions/models/openpaths.ts— model class extending theshared
OpenAICompatiblebase, pointed at the OpenPaths gateway (model listing reusesthe standard
/v1/modelsfetch).src/shared/providers/index.ts— register the provider in the registry.src/shared/models/index.ts— add the provider name-hash entry (required, the hash isRecord<ModelProviderEnum, string>) and a menu option (not featured).src/shared/utils/llm_utils.ts— list OpenPaths among the OpenAI-compatible providers.src/renderer/static/icons/providers/openpaths.png— provider icon.The change is purely additive; no existing provider is modified and OpenPaths is not
placed ahead of incumbents in any featured list.
Testing
npx tsc --noEmit— no new type errors introduced (the only errors present arepre-existing TanStack Router
routeTree.gencodegen errors, unrelated to this changeand present on a clean checkout before the build step generates that file).
biome linton the changed files — clean for the new files (the only warnings arepre-existing
console.debugcalls inproviders/index.ts).🤖 Generated with Claude Code