Skip to content

feat: add atlascloud provider#1695

Merged
looplj merged 1 commit into
looplj:unstablefrom
lucaszhu-hue:feat/atlascloud-provider
May 22, 2026
Merged

feat: add atlascloud provider#1695
looplj merged 1 commit into
looplj:unstablefrom
lucaszhu-hue:feat/atlascloud-provider

Conversation

@lucaszhu-hue

Copy link
Copy Markdown
Contributor

Summary

  • add AtlasCloud as a dedicated channel/provider option
  • reuse the existing OpenAI-compatible backend path for AtlasCloud
  • add minimal frontend config, i18n entries, and focused tests

Validation

  • verified AtlasCloud upstream API with the provided key via https://api.atlascloud.ai/v1/models
  • local AxonHub runtime validation is still constrained by dependency/network availability on this machine

@greptile-apps

greptile-apps Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This 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).

  • Backend: TypeAtlascloud is added to the ent enum, the TypeValidator switch, defaultEndpointsForChannelType (mapped to openAICompatibleDefaultEndpoints), and the buildChannelWithTransformer switch alongside other OpenAI-compatible providers; the implementation is consistent with how Vercel, DeepInfra, and similar providers are wired.
  • Frontend: Channel and provider configs are registered with baseURL, default models, and sky-blue styling; both reuse the OpenAI icon as a placeholder since no dedicated AtlasCloud icon exists in @lobehub/icons.
  • Tests: An endpoint-mapping test and an outbound-builder test are added, though the outbound test omits image/video assertions that the equivalent Vercel test includes.

Confidence Score: 4/5

Safe 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

Filename Overview
internal/server/biz/channel_llm.go Adds TypeAtlascloud to the existing OpenAI-compatible case, correctly reusing PlatformOpenAI outbound transformer with no special logic needed.
internal/server/biz/channel_endpoint.go Registers TypeAtlascloud with openAICompatibleDefaultEndpoints (6 endpoints); consistent with how Vercel, DeepInfra, and other compatible providers are registered.
internal/ent/channel/channel.go Adds TypeAtlascloud constant and includes it in the TypeValidator switch; follows the established pattern exactly.
internal/ent/migrate/schema.go Adds atlascloud to the type enum list in the migration schema; ordering matches ent/schema/channel.go.
frontend/src/features/channels/data/config_channels.ts Adds AtlasCloud channel and provider type entries; uses OpenAI icon as a placeholder since no dedicated icon exists, which is visually misleading.
frontend/src/features/channels/data/config_providers.ts Adds AtlasCloud provider config; reuses OpenAI icon instead of a dedicated or generic icon.
internal/server/biz/channel_llm_openai_compatible_test.go New AtlasCloud test verifies 6 outbounds and checks chat + embedding, but omits image/video assertions present in the parallel Vercel test.

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]
Loading

Reviews (1): Last reviewed commit: "feat: add atlascloud provider" | Re-trigger Greptile

Comment on lines +57 to +62
atlascloud: {
provider: 'atlascloud',
icon: OpenAI,
color: 'bg-sky-100 text-sky-800 border-sky-200',
channelTypes: ['atlascloud'],
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 AtlasCloud uses OpenAI icon

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.

Comment on lines +61 to +91
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)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@looplj looplj merged commit 9b395b6 into looplj:unstable May 22, 2026
4 checks passed
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