feat: add atlascloud provider#1695
Conversation
Greptile SummaryThis PR adds AtlasCloud as a new OpenAI-compatible channel/provider by reusing the existing OpenAI-compatible backend path across all relevant layers (ent schema, validator, endpoint mapping, LLM builder, frontend config, and i18n).
Confidence Score: 4/5Safe to merge; changes are purely additive and follow the well-established pattern used by every other OpenAI-compatible provider in the codebase. The AtlasCloud channel is wired correctly across all layers and is consistent with existing providers. The only notable gaps are cosmetic: the OpenAI icon is reused as a placeholder for AtlasCloud in both the channel and provider configs, and the outbound builder test omits image/video endpoint assertions that the analogous Vercel test covers. frontend/src/features/channels/data/config_channels.ts and config_providers.ts both use the OpenAI icon for AtlasCloud; internal/server/biz/channel_llm_openai_compatible_test.go could expand image/video assertions. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User selects AtlasCloud channel] --> B[frontend: config_channels.ts\nbaseURL: api.atlascloud.ai/v1\napiFormat: OPENAI_CHAT_COMPLETIONS]
B --> C[schema.ts validates\nchannelType = 'atlascloud']
C --> D[backend: ent TypeAtlascloud\nTypeValidator allows it]
D --> E[channel_endpoint.go\ndefaultEndpointsForChannelType\nAtlascloud → openAICompatibleDefaultEndpoints]
E --> F{6 built-in endpoints}
F --> F1[Chat Completion]
F --> F2[Embedding]
F --> F3[Image Generation]
F --> F4[Image Edit]
F --> F5[Image Variation]
F --> F6[Video]
D --> G[channel_llm.go\nbuildChannelWithTransformer\nTypeAtlascloud case]
G --> H[openai.NewOutboundTransformerWithConfig\nPlatformType: PlatformOpenAI\nBaseURL: from channel config]
H --> I[Outbound requests to\nhttps://api.atlascloud.ai/v1]
Reviews (1): Last reviewed commit: "feat: add atlascloud provider" | Re-trigger Greptile |
| atlascloud: { | ||
| provider: 'atlascloud', | ||
| icon: OpenAI, | ||
| color: 'bg-sky-100 text-sky-800 border-sky-200', | ||
| channelTypes: ['atlascloud'], | ||
| }, |
There was a problem hiding this comment.
Both config_providers.ts and config_channels.ts (line 85) assign icon: OpenAI to the AtlasCloud entry. Every other provider in the file uses its own branded icon (DeepSeek, Anthropic, Google, etc.). Showing the OpenAI logo for an unrelated aggregator provider is misleading to users who select a channel type in the UI. If no dedicated icon is available in @lobehub/icons yet, a generic placeholder icon would be less confusing than the OpenAI logo.
| func TestAtlasCloudChannel_BuildChannelWithOutbounds(t *testing.T) { | ||
| client := enttest.NewEntClient(t, "sqlite3", "file:ent?mode=memory&_fk=0") | ||
| defer client.Close() | ||
|
|
||
| ctx := authz.WithTestBypass(context.Background()) | ||
|
|
||
| entChannel := client.Channel.Create(). | ||
| SetName("AtlasCloud Channel"). | ||
| SetType(channel.TypeAtlascloud). | ||
| SetBaseURL("https://api.atlascloud.ai/v1"). | ||
| SetCredentials(objects.ChannelCredentials{APIKey: "test-key"}). | ||
| SetSupportedModels([]string{"deepseek-v3"}). | ||
| SetDefaultTestModel("deepseek-v3"). | ||
| SaveX(ctx) | ||
|
|
||
| channelSvc := NewChannelServiceForTest(client) | ||
|
|
||
| built, err := channelSvc.buildChannelWithOutbounds(entChannel) | ||
| require.NoError(t, err) | ||
| require.NotNil(t, built) | ||
| require.NotNil(t, built.Outbound) | ||
| require.Len(t, built.Outbounds, 6) | ||
|
|
||
| require.Equal(t, llm.APIFormatOpenAIChatCompletion, built.Outbound.APIFormat()) | ||
|
|
||
| embeddingOutbound, err := BuildOutboundByAPIFormat(built, llm.APIFormatOpenAIEmbedding.String()) | ||
| require.NoError(t, err) | ||
| require.NotNil(t, embeddingOutbound) | ||
| _, ok := embeddingOutbound.(*openai.OutboundTransformer) | ||
| require.True(t, ok) | ||
| } |
There was a problem hiding this comment.
Test coverage gap compared to the parallel Vercel test
TestAtlasCloudChannel_BuildChannelWithOutbounds asserts 6 outbounds and checks embedding, but does not verify imageOutbound or videoOutbound, unlike TestOpenAICompatibleChannel_BuildChannelWithOutbounds which validates all three extra endpoint types. Since AtlasCloud is mapped to openAICompatibleDefaultEndpoints (all 6 slots), assertions on at least image and video outbound types would make the test equally expressive and would catch any future regression if the mapping changes.
There was a problem hiding this comment.
Code Review
This pull request introduces support for the atlascloud channel and provider. Changes include adding configuration settings, updating the database schema and validators, providing localization for English and Chinese, and implementing backend logic to handle atlascloud as an OpenAI-compatible service. Unit tests were also added to verify the new channel's endpoint mapping and outbound transformation. I have no feedback to provide.
Summary
Validation