Skip to content

feat: add Opper as a model provider preset - #1340

Merged
XingYu-Zhong merged 5 commits into
developfrom
codex/add-opper-provider
Sep 23, 2026
Merged

XingYu-Zhong merged 5 commits into
developfrom
codex/add-opper-provider

Conversation

@XingYu-Zhong

Copy link
Copy Markdown
Collaborator

Supersedes #1337 — carries the author's two commits unchanged and adds one fix commit on top, since "Allow edits from maintainers" is off on the fork branch.

Summary / 概要

  • Adds Opper (https://opper.ai, EU-hosted multi-provider AI gateway by Opper Technology AB, Stockholm) as a built-in model provider preset, wired exactly like the Vercel AI Gateway preset: OpenAI chat completions endpoint with an empty model list, catalog imported on demand from GET /models.
  • One API key reaches models from 30+ upstream providers at each provider's own token rates; <provider>/<model> ids (e.g. aws/claude-sonnet-4-6-eu) pin a provider or region.

Why / 背景

  • Original PR: feat: add Opper as a model provider preset #1337 by @Felixkw12 (Opper). Verified: opper exists on models.dev with api: https://api.opper.ai/v3/compat, matching the preset base URL; docs.opper.ai and platform.opper.ai resolve.
  • Fix on top: UNAMBIGUOUS_URL_MATCHES was missing 'https://api.opper.ai/v3/compat': 'opper', so custom or duplicated profiles (e.g. my-opper-gateway) pointing at the Opper endpoint could not resolve the models.dev catalog and silently got no model metadata. Vercel AI Gateway covers both the profile-id and URL paths; this restores parity.

Changes / 变更

  • src/shared/model-provider-preset-types.ts: add opper to ModelProviderPresetId
  • src/shared/model-provider-preset-catalog-extended.ts: the preset
  • packages/provider-catalog/src/index.ts: shared catalog entry (category api, chat_completions)
  • src/main/models-dev-catalog.ts: opper profile match + Opper endpoint in UNAMBIGUOUS_URL_MATCHES
  • src/main/models-dev-catalog.test.ts: deterministic + custom-id URL match cases for Opper
  • packages/provider-catalog/src/index.test.ts: catalog count updates (26→27, 32→33, api 12→13)
  • docs/model-provider-presets.md: Built-in Providers entry
  • No icon asset, matching Vercel AI Gateway (falls back to the Kun mark by design)

Media / 截图或录屏

  • No UI change.

Tests / 测试

  • npx vitest run src/main/models-dev-catalog.test.ts — 54 passed
  • npx vitest run src/shared/app-settings-provider.presets.test.ts src/renderer/src/components/provider-icon.test.ts — 49 passed
  • packages/provider-catalog: vitest run — 4 passed

Validation / 验证

  • I agree that this contribution is submitted under the Contributor License Agreement. / 我同意本贡献遵循 CLA 提交。
  • npm run test (affected files / 相关测试文件)
  • npm run typecheck
  • npm run build
  • npm run dev (no runtime or UI behavior change / 无运行时或界面行为变化)
  • Logic change: unit tests added or updated / 逻辑变更:已新增或更新单元测试

Notes / 备注

Generated with Devin

Felixkw12 and others added 3 commits September 21, 2026 13:15
Opper is an EU-hosted AI gateway run by Opper Technology AB (Stockholm):
one API key and one OpenAI-compatible endpoint reach models from 30+
upstream providers at each provider's own token rates, with no markup,
and requests can be pinned to EU-hosted regions.

It is wired exactly like the Vercel AI Gateway preset: an OpenAI chat
completions endpoint with an empty model list, so the catalog is
imported on demand from GET /models.

- src/shared/model-provider-preset-catalog-extended.ts: the preset
- src/shared/model-provider-preset-types.ts: the preset id
- packages/provider-catalog/src/index.ts: the shared catalog entry
- src/main/models-dev-catalog.ts: Opper is published on models.dev as
  `opper`, so the preset maps straight onto that catalog
- docs/model-provider-presets.md: the Built-in Providers entry

No icon asset, matching Vercel AI Gateway, so the diff stays additive.
Model ids come in two forms and the docs entry explains both: a bare
pool name such as claude-sonnet-4-6 routes across every provider serving
that model, and provider/model such as aws/claude-sonnet-4-6-eu pins one
provider or region.

I work at Opper. Happy to adjust anything to match project conventions.

Not verified locally: `npm test` needs the full dependency install, which
I did not run here. Every change is a data entry mirroring the adjacent
gateway preset, plus one union member and one catalog mapping.
packages/provider-catalog/src/index.test.ts freezes the catalog size,
the expanded entry count and the per-category counts. Adding an api
preset moves three of them: 26 -> 27 presets, 32 -> 33 entries, and
12 -> 13 in the api category. Subscription and free counts are
unchanged.
Custom or duplicated provider profiles pointing at
https://api.opper.ai/v3/compat carry a profile id other than 'opper',
so PROFILE_MATCHES misses them and catalog import silently returns
nothing. Mirror the Vercel AI Gateway wiring by adding the endpoint to
UNAMBIGUOUS_URL_MATCHES.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@XingYu-Zhong
XingYu-Zhong merged commit 59e1210 into develop Sep 23, 2026
5 checks passed
@XingYu-Zhong
XingYu-Zhong deleted the codex/add-opper-provider branch September 23, 2026 13:56
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