Skip to content

feat(provider): add Atlas Cloud support - #16

Open
binyangzhu000-sudo wants to merge 2 commits into
869413421:mainfrom
binyangzhu000-sudo:feat/atlascloud-provider
Open

binyangzhu000-sudo wants to merge 2 commits into
869413421:mainfrom
binyangzhu000-sudo:feat/atlascloud-provider

Conversation

@binyangzhu000-sudo

@binyangzhu000-sudo binyangzhu000-sudo commented Jul 29, 2026 •

Copy link
Copy Markdown

Summary

  • add Atlas Cloud to the API key provider registry with https://api.atlascloud.ai/v1 as its default OpenAI-compatible endpoint
  • expose the provider in both API key settings views and default to deepseek-ai/deepseek-v4-pro
  • route Atlas Cloud through the existing CustomProvider implementation and cover the factory endpoint contract

Validation

  • pytest backend/tests/unit/test_atlascloud_provider.py backend/tests/unit/test_custom_provider.py: 2 passed
  • npm run build: passed
  • Python 3.11 compileall: passed
  • Atlas model catalog: HTTP 200 and default model present
  • Atlas chat completions live probe: HTTP 200
  • targeted ESLint could not start because the repository config references the undeclared @vue/eslint-config-prettier package

Scope

No README, documentation, logo, sponsor, credits, or partner promotion changes.

binyangzhu000-sudo and others added 2 commits July 29, 2026 11:34
Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
Upstream's 'unify model providers and migrate AICON gateway' refactor replaced
almost everything this branch touched, so most of the PR is now deleted rather
than merged. Net diff against main drops from 8 files to 3.

What upstream changed:
- ProviderFactory's per-provider match statement became one GatewayProvider
  plus registry.connection(), so the 'case "atlascloud"' branch has no home.
- The hardcoded frontend provider list was removed in favour of a backend
  /api-keys/provider-presets endpoint that serves registry.PROVIDERS verbatim.
- APIKeys.vue / APIKeysSettings.vue gained applyProviderPreset, which does
  exactly what this branch's handleProviderChange did, but driven by that
  endpoint.
- validate_provider now derives its list from PROVIDERS, and get_models now
  reads the catalog instead of hardcoding per-provider model names.

So the whole change is one registry entry:

    'atlascloud': ('Atlas Cloud', 'https://api.atlascloud.ai/v1'),

Two things the merge would otherwise have shipped quietly:
- APIKeys.vue and APIKeysSettings.vue auto-merged into a select carrying two
  @change attributes, with this branch's handler calling
  apiKeyUtils.getProviderDefaultBaseUrl — a function upstream deleted. Both
  handlers and the duplicate attribute are removed; upstream's preset path
  stands alone.
- The contract test asserted ProviderFactory.create returns a CustomProvider,
  which is no longer true. It is rewritten against the new architecture and now
  covers the registry preset, connection() resolution for both default and
  explicit base URLs, rejection of credentialed/queried/non-HTTP base URLs, and
  acceptance by the schema validator and the provider enum.

Verified locally: the four tests pass, and the presets endpoint returns the
Atlas Cloud row alongside the six existing providers. Note libmagic is not
installed on this machine, so the test had to be run with the app's optional
python-magic import stubbed; the repository has no CI workflow to fall back
on.
@binyangzhu000-sudo

Copy link
Copy Markdown
Author

已同步 main。「统一模型供应商 + 迁移 AICON 网关」这次重构把本分支改过的东西替换掉了大半,所以这次不是解冲突,而是把 PR 的大部分删掉——相对 main 的净改动从 8 个文件降到 3 个。

上游的变化,以及对应的处置:

  • ProviderFactory 的 per-provider match 换成了单一 GatewayProvider + registry.connection(),所以 case "atlascloud" 分支已无落点,整段取上游。
  • 前端硬编码的 provider 列表被删掉,改由后端 /api-keys/provider-presets 端点(直接返回 registry.PROVIDERS)供数,所以本分支在 apiKeys.js 的两个函数一并删除。
  • APIKeys.vue / APIKeysSettings.vue 新增了 applyProviderPreset,功能与本分支的 handleProviderChange 完全相同,但走的是那个端点。
  • validate_provider 改为从 PROVIDERS 派生,get_models 改为读目录,本分支的硬编码列表也随之删除。

于是整个改动收敛成注册表里的一行:

'atlascloud': ('Atlas Cloud', 'https://api.atlascloud.ai/v1'),

有两处是这次合并本会静默带过去的,说明一下:

  1. 两个 .vue 自动合并后,<el-select> 上同时挂了 @change="applyProviderPreset" 和 @change="handleProviderChange",而后者调用的 apiKeyUtils.getProviderDefaultBaseUrl 已被上游删除。git 没有报冲突。两个 handler 和重复属性都已移除,只保留上游的方案。
  2. 契约测试断言 ProviderFactory.create 返回 CustomProvider,在新架构下不再成立。已按新架构重写,覆盖注册表预设、connection() 对默认与显式 base_url 的解析、对带凭据/查询串/非 HTTP 地址的拒绝,以及 schema 校验器和 provider 枚举的接受。

本地验证:4 个测试通过,provider-presets 会在原有 6 个供应商之外返回 Atlas Cloud 这一行。需要说明的是,本机没有装 libmagic,应用的 python-magic 导入链跑不起来,所以测试是在把该模块打桩后运行的(未改动仓库任何文件);这个仓库没有 CI workflow 可以作为兜底,编译/运行层面的最终验证还请以你们的环境为准。

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.

1 participant