Skip to content

feat(provider): add Synthorai - #3876

Open
cuihuan wants to merge 1 commit into
chatboxai:mainfrom
cuihuan:feat-synthorai-provider
Open

feat(provider): add Synthorai#3876
cuihuan wants to merge 1 commit into
chatboxai:mainfrom
cuihuan:feat-synthorai-provider

Conversation

@cuihuan

@cuihuan cuihuan commented Aug 28, 2026

Copy link
Copy Markdown

Disclosure: I am affiliated with Synthorai — this adds our own product, not demand I am relaying from elsewhere. Flagging it so the change is judged with that on the table. No expectation of priority, and "not now" is a fine answer.

Prepared with an AI agent. Every value below came from a command I ran; where something was copied rather than checked, that is said outright.

Supersedes my issue #3872, which asked rather than implemented.

What this adds

Synthorai as a provider, following docs/adding-new-provider.md:

File
src/shared/providers/definitions/models/synthorai.ts model class, extends OpenAICompatible
src/shared/providers/definitions/synthorai.ts provider definition
src/shared/types/provider.ts one ModelProviderEnum entry
src/shared/providers/index.ts one side-effect import

Where I followed the code rather than the guide

The guide is slightly behind definitions/, and I went with the checked-in files. Flagging it in case the doc is meant to be the contract:

  • The field table omits modelsDevProviderId and curatedModelIds; 16 of 24 definitions carry the first and the contract test validates the second.
  • The guide's createModel reads config.providerSetting.apiKey; the checked-in providers read config.effectiveApiKey.
  • Model entries carry maxOutput and nickname, neither of which appears in the guide's example.

Happy to send a docs patch for those separately if useful.

modelsDevProviderId is omitted deliberately

Synthorai has no models.dev entry yet, so naming one would point at nothing and index.contract.test.ts validates that mapping. Eight definitions omit the field, including vercel-ai-gateway, so this follows existing practice rather than skipping something.

The model numbers are reproducible

Every contextWindow, maxOutput and capability came from https://synthorai.io/api/models, which is public and needs no key:

  • vision where input_modalities contains image
  • tool_use where capabilities contains tools
  • reasoning likewise
curl -s https://synthorai.io/api/models | python3 -c "
import json,sys
for r in json.load(sys.stdin)['data']:
    if r['alias'] == 'claude-opus-5':
        print(r['max_input_tokens'], r['max_output_tokens'], r['capabilities'])
"

Seven models are listed, and curatedModelIds names the same seven so the contract test's backing requirement holds.

One honest caveat. For gemini-3.7-flash I initially copied the two numbers from the vercel-ai-gateway entry instead of reading them from the catalog. They happen to match, and I checked afterwards — but the process was wrong, so I would rather you know that one pair was verified late than imply all seven were verified the same way.

No icon

ProviderIcon.tsx takes a 24-grid SVG path and we do not publish a simplified mark at that size. The guide lists the icon as optional, so this omits it rather than shipping something that would look wrong next to the others. Happy to add one if you would prefer a placeholder.

Checks

vitest run src/shared/providers/ — the three contract tests plus the registry suite. Run under Node 22 as engines.node requires; my default is 26 and pnpm correctly refuses it, so I switched rather than passing --engine-strict=false, since a green result from a bypassed engine check would not mean anything.

Where to look

The seven curated models. That is a judgement call about which subset is useful by default rather than something I can verify, and I would rather have your view than guess — the full list is at https://synthorai.io/models/.

Synthorai is an OpenAI-compatible gateway, so the model class extends
OpenAICompatible the way groq and siliconflow do. Four files, matching the four
steps in docs/adding-new-provider.md.

Followed the checked-in definitions rather than the guide where the two differ: the
guide's field table omits modelsDevProviderId and curatedModelIds, its createModel
reads config.providerSetting.apiKey where the providers read config.effectiveApiKey,
and its model entries lack maxOutput and nickname.

modelsDevProviderId is omitted on purpose - Synthorai has no models.dev entry, so
naming one would point at nothing and index.contract.test.ts validates that mapping.
Eight of the 24 definitions omit it, including vercel-ai-gateway.

Every contextWindow, maxOutput and capability came from the public
https://synthorai.io/api/models: vision from input_modalities containing image,
tool_use and reasoning from the capabilities array. One exception worth stating: the
gemini-3.7-flash pair was first copied from the vercel-ai-gateway entry and verified
against the catalog afterwards. It matches, but the process was wrong.

No icon: ProviderIcon.tsx takes a 24-grid SVG path and we publish no simplified mark
at that size, and the guide lists the icon as optional.

Tests: vitest run src/shared/providers/ - 68 passed, 6 skipped, including the three
contract tests. Verified registration with a throwaway probe (since removed) that
asserted getAllProviders() contains the provider, createModel returns our base URL,
and modelsDevProviderId is undefined. biome reports nothing on the two new files and
the same 3 warnings with and without this change.

Run under Node 22 as engines.node requires; pnpm correctly refuses my default v26 and
I switched rather than passing --engine-strict=false.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d412364c-6dc6-4e05-bb5b-e3770c720b19

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

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.

1 participant