feat(provider): add Synthorai - #3876
Open
cuihuan wants to merge 1 commit into
Open
Conversation
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.
Contributor
|
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 Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
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.
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:src/shared/providers/definitions/models/synthorai.tsOpenAICompatiblesrc/shared/providers/definitions/synthorai.tssrc/shared/types/provider.tsModelProviderEnumentrysrc/shared/providers/index.tsWhere 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:modelsDevProviderIdandcuratedModelIds; 16 of 24 definitions carry the first and the contract test validates the second.createModelreadsconfig.providerSetting.apiKey; the checked-in providers readconfig.effectiveApiKey.maxOutputandnickname, neither of which appears in the guide's example.Happy to send a docs patch for those separately if useful.
modelsDevProviderIdis omitted deliberatelySynthorai has no models.dev entry yet, so naming one would point at nothing and
index.contract.test.tsvalidates that mapping. Eight definitions omit the field, includingvercel-ai-gateway, so this follows existing practice rather than skipping something.The model numbers are reproducible
Every
contextWindow,maxOutputand capability came fromhttps://synthorai.io/api/models, which is public and needs no key:visionwhereinput_modalitiescontainsimagetool_usewherecapabilitiescontainstoolsreasoninglikewiseSeven models are listed, and
curatedModelIdsnames the same seven so the contract test's backing requirement holds.One honest caveat. For
gemini-3.7-flashI initially copied the two numbers from thevercel-ai-gatewayentry 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.tsxtakes 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 asengines.noderequires; 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/.