Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/types/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const THIRD_PARTY_PROVIDER_IDS = [
'qwen',
'kimi',
'glm',
'atlascloud',
'custom',
] as const;
export type ThirdPartyProviderId = (typeof THIRD_PARTY_PROVIDER_IDS)[number];
Expand Down
35 changes: 35 additions & 0 deletions src/utils/chatApiRoute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,39 @@ describe('resolveChatApiRoute', () => {
provider: expect.objectContaining({ apiKey: 'kimi-key' }),
});
});

it('routes the built-in Atlas Cloud provider through the OpenAI-compatible path', () => {
const providers = createDefaultThirdPartyApiSettings().providers;
const appSettings = createAppSettings({
isThirdPartyApiEnabled: true,
thirdPartyApi: {
activeProvider: 'atlascloud',
providers: {
...providers,
atlascloud: {
...providers.atlascloud,
apiKey: 'atlascloud-key',
enabled: true,
},
},
},
});
const chatSettings = createChatSettings({
apiMode: 'third-party',
modelId: 'deepseek-ai/deepseek-v4-pro',
thirdPartyProviderId: 'atlascloud',
thirdPartyModelId: 'deepseek-ai/deepseek-v4-pro',
});

expect(resolveChatApiRoute(appSettings, chatSettings)).toMatchObject({
apiMode: 'third-party',
modelId: 'deepseek-ai/deepseek-v4-pro',
providerId: 'atlascloud',
provider: {
apiKey: 'atlascloud-key',
baseUrl: 'https://api.atlascloud.ai/v1',
protocol: 'openai-compatible',
},
});
});
});
10 changes: 10 additions & 0 deletions src/utils/thirdPartyApiProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const THIRD_PARTY_PROVIDER_IDS = [
'qwen',
'kimi',
'glm',
'atlascloud',
'custom',
] as const;

Expand All @@ -27,6 +28,7 @@ export const THIRD_PARTY_PROVIDER_LABELS: Record<ThirdPartyProviderId, string> =
qwen: 'Qwen',
kimi: 'Kimi',
glm: 'GLM',
atlascloud: 'Atlas Cloud',
custom: 'Custom',
};

Expand Down Expand Up @@ -98,6 +100,14 @@ const DEFAULT_THIRD_PARTY_PROVIDER_CONFIGS: Record<ThirdPartyProviderId, ThirdPa
protocol: 'openai-compatible',
enabled: false,
},
atlascloud: {
apiKey: null,
baseUrl: 'https://api.atlascloud.ai/v1',
modelId: 'deepseek-ai/deepseek-v4-pro',
models: [{ id: 'deepseek-ai/deepseek-v4-pro', name: 'DeepSeek V4 Pro', isPinned: true }],
protocol: 'openai-compatible',
enabled: false,
},
custom: {
apiKey: null,
baseUrl: null,
Expand Down