Repository navigation
feat(providers): add Atlas Cloud provider - #3943
Open
binyangzhu000-sudo wants to merge 1 commit into
Open
binyangzhu000-sudo wants to merge 1 commit into
binyangzhu000-sudo wants to merge 1 commit into
Conversation
Atlas Cloud is an OpenAI-compatible gateway to 300+ models (OpenAI, Anthropic, DeepSeek, Qwen, GLM, Kimi, MiniMax, ...) behind one endpoint, following the same shape as the existing SiliconFlow/Groq providers: a thin OpenAICompatible subclass with a fixed apiHost, registered via defineProvider() per docs/adding-new-provider.md. Curated model list (9 models) plus their context/max-output numbers are taken from the live GET /v1/models catalog (2026-09-20), not guessed. Capability flags are conservative: tool_use is set for all of them (the OpenAI-origin models don't advertise it in supported_features, but real usage confirms they support it), reasoning/vision are only set where the catalog's own supported_features/input_modalities say so. Touches: - types/provider.ts: ModelProviderEnum.AtlasCloud - providers/definitions/models/atlascloud.ts: the model class - providers/definitions/atlascloud.ts: the defineProvider() call - providers/builtin-registration.ts: the side-effect import - providers/index.contract.test.ts: extended the exact provider-order assertion (registration-order contract, not new coverage) - models/index.ts: added the missing entry to aiProviderNameHash - this is the legacy backward-compat map the docs' migration notes say is superseded by defineProvider(), but tsc's exhaustive Record<ModelProviderEnum, string> check still requires every enum member to have one - components/icons/ProviderIcon.tsx: the real Atlas Cloud logo mark (sourced from @lobehub/icons-static-svg, the same icon set already used elsewhere in this file), same inline-<path> pattern as the SiliconFlow/Bedrock/xAI entries above it No per-provider unit test file added: no sibling OpenAI-compatible provider (Groq, SiliconFlow, DeepSeek, ...) has one either - the registry-order contract test is this codebase's actual coverage mechanism for a new provider registration, which is what's extended here. Verified: - npx biome lint: clean - npx vitest run src/shared/ src/renderer/utils src/renderer/components/icons: 1186 passed, 6 skipped (no regressions) - npx tsc --noEmit (full workspace, node --max-old-space-size=8192): 0 errors - Live, against the real gateway: createOpenAICompatible() + streamText() with the exact baseURL/model-id shape this provider uses (openai/gpt-4.1-mini) returned a real streamed response with real token usage - the same @ai-sdk/openai-compatible + ai package primitives AtlasCloud.getProvider()/getChatModel() call internally.
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: Advanced 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 branch has not been deployed
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.
Summary
Adds Atlas Cloud as a built-in provider — an OpenAI-compatible gateway to 300+ models (OpenAI, Anthropic, DeepSeek, Qwen, GLM, Kimi, MiniMax, ...) behind one endpoint.
Followed
docs/adding-new-provider.mdand the existing SiliconFlow/Groq shape: a thinOpenAICompatiblesubclass with a fixedapiHost, registered throughdefineProvider().Changes
src/shared/types/provider.ts—ModelProviderEnum.AtlasCloudsrc/shared/providers/definitions/models/atlascloud.ts— the model class (OpenAICompatiblesubclass,apiHost: 'https://api.atlascloud.ai/v1')src/shared/providers/definitions/atlascloud.ts— thedefineProvider()callsrc/shared/providers/builtin-registration.ts— the side-effect import (appended at the end, per the file's own "preserve this import order" comment)src/shared/providers/index.contract.test.ts— extended the exact provider-order assertion (this is the registration-order contract test, not new coverage I added on top)src/shared/models/index.ts— added the missingaiProviderNameHashentry. This is the legacy backward-compat mapdocs/adding-new-provider.md's "Migration Notes" say is superseded bydefineProvider(), buttsc's exhaustiveRecord<ModelProviderEnum, string>check still requires every enum member to have one —npx tsc --noEmitcatches this immediately if it's missing.src/renderer/components/icons/ProviderIcon.tsx— the real Atlas Cloud logo mark, sourced from@lobehub/icons-static-svg(the icon set already backing several entries in this same file), same inline-<path>pattern as the SiliconFlow/Bedrock/xAI entries above it.Curated model list (9 models) and their context/max-output numbers are taken from the live
GET /v1/modelscatalog (2026-09-20), not guessed. Capability flags are conservative:tool_useis set on all of them (the OpenAI-origin models don't advertise it insupported_features, but they do support it in practice — verified live, see below);reasoning/visionare only set where the catalog's ownsupported_features/input_modalitiesactually say so.No per-provider unit test file added — no sibling OpenAI-compatible provider (Groq, SiliconFlow, DeepSeek, ...) has one; the registry-order contract test is this codebase's real coverage mechanism for a new provider registration, and that's what's extended here.
Testing
npx biome lint— cleannpx vitest run src/shared/ src/renderer/utils src/renderer/components/icons— 1186 passed, 6 skipped (no regressions)npx tsc --noEmit(full workspace) — 0 errorscreateOpenAICompatible({ baseURL: 'https://api.atlascloud.ai/v1' })+streamText()with the exact model-id shape this provider uses (openai/gpt-4.1-mini) — the same@ai-sdk/openai-compatible+aipackage primitivesAtlasCloud.getProvider()/getChatModel()call internally — returned a real streamed response with real token usage:Disclosure: I work at Atlas Cloud.