Skip to content

feat(providers): add Atlas Cloud provider - #8783

Open
binyangzhu000-sudo wants to merge 1 commit into
simstudioai:mainfrom
binyangzhu000-sudo:feat/atlas-cloud-provider
Open

binyangzhu000-sudo wants to merge 1 commit into
simstudioai:mainfrom
binyangzhu000-sudo:feat/atlas-cloud-provider

Conversation

@binyangzhu000-sudo

Copy link
Copy Markdown

What this adds

atlascloud — Atlas Cloud, an OpenAI-compatible gateway at https://api.atlascloud.ai/v1 serving DeepSeek, GLM, Kimi, Qwen and MiniMax behind one key.

Disclosure: I work at Atlas Cloud. GET /v1/models is public, so the catalog can be browsed without a key.

Shaped like the Baseten reseller

isReseller: true with models: [], so the catalog comes from /api/providers/atlascloud/models at runtime instead of a Sim release — the gateway adds models weekly and a hard-coded list would be stale on arrival. The provider is 74 lines on top of openai-compat/chat-completions; the only non-boilerplate choice is reasoningFields: ['reasoning_content'], which is where this gateway's reasoning models actually put their chain of thought.

Testing

Provider + BYOK suites: 2022 → 2033 passing, no failures. The 11 new tests are the two suites that travel with the provider, both mirrored from Baseten's.

$ vitest run providers lib/api-key
baseline   Test Files  181 passed | 1 skipped (182)    Tests  2022 passed | 5 skipped (2027)
after      Test Files  183 passed | 1 skipped (184)    Tests  2033 passed | 5 skipped (2038)

$ tsc --noEmit -p apps/sim/tsconfig.json
0 errors

Live round trip through the repo's own atlascloudProvider.executeRequest, not a mock:

deepseek-ai/deepseek-v4-flash -> "OK"
zai-org/glm-5.3               -> "OK"
moonshotai/kimi-k2.6          -> "OK"

and the registry resolves it next to its precedent:

baseten->baseten/Baseten | atlascloud->atlascloud/Atlas Cloud | openai->openai/OpenAI | together->together/Together AI

Every model id above was called against the live endpoint before being written down.

Registration points

The compiler found most of these for me — ProviderId, ProviderName and BYOKProviderId are exhaustive unions, so tsc named each Record<ProviderId, …> that needed an entry:

providers/atlascloud/{index.ts,index.test.ts} and app/api/providers/atlascloud/models/{route.ts,route.test.ts} (new) · providers/registry.ts · providers/types.ts · providers/models.ts · providers/history-adapters.ts · providers/utils.ts · providers/openai-compat/chat-completions.ts · stores/providers/{types.ts,store.ts} · tools/types.ts · lib/api-key/byok.ts · lib/api/contracts/{providers.ts,byok-keys.ts} · lib/core/config/env.ts · hooks/queries/providers.ts · the BYOK settings panel · app/(landing)/models/utils.ts · components/icons.tsx · and the docs (cost table, env-var table, agent block, docs icons).

I found the non-type-checked ones by grepping every current occurrence of baseten, not by copying the file list from the commit that added it.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 8, 2026

Copy link
Copy Markdown

@binyangzhu000-sudo is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium risk] Adds a new LLM provider integration for Atlas Cloud.

Fix Atlas model discovery and the explicit repository-rule violations before merging.

Findings

  1. P1 Atlas models never load ▶
  2. P2 Browsing requires a key ▶
  3. P2 Tests assert mock calls ▶
  4. P2 Route owns protected access ▶
  5. P2 Query type is missing ▶
  6. P2 Docs icon is unused ▶
  7. P2 Icon props lack an interface ▶

Summary

Adds Atlas Cloud inference, BYOK settings, a catalog route, provider metadata, icons, and documentation.

  • The workspace loader never fetches or syncs Atlas models.
  • The catalog route also blocks browsing without a key.
  • New tests, the protected key lookup, contract types, and icon declarations need changes to meet repository requirements.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Workspace opens] --> B[ProviderModelsLoader]
  B --> C[Existing provider queries]
  B -. Atlas query missing .-> D[Atlas catalog route]
  D --> E{Key available?}
  E -->|No| F[Empty catalog]
  E -->|Yes| G[Fetch models]
  H[Atlas store starts empty] --> I[No Atlas models in pickers]
  J[Typed Atlas model ID] --> K[Provider registry]
  K --> L[BYOK or supplied or environment key]
  L --> M[Shared chat executor]
  M --> N[Atlas inference API]
Loading

Reviews (1) · Last reviewed commit: "feat(providers): add Atlas Cloud provide..." · Reviewed by Greptile

Comment on lines +296 to +297
contextInformationAvailable: false,
models: [],

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.

P1 Atlas models never load

atlascloud has no static models, but the PR never adds it to ProviderModelsLoader, the model-sync helpers, or DYNAMIC_MODEL_PROVIDERS. Opening a workflow therefore never fetches its catalog, even with a saved key. Model pickers stay empty, and access-control settings treat it as a static provider with no models. Add the full discovery and sync wiring used by baseten.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +49 to +52
if (!apiKey) {
logger.info('No Atlas Cloud API key available, returning empty models')
return NextResponse.json({ models: [] })
}

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 Browsing requires a key

The route returns an empty catalog whenever neither a saved key nor ATLASCLOUD_API_KEY exists. If /v1/models is public as the PR description states, this unnecessarily prevents users from browsing before adding a key. Fetch the public catalog without requiring a key; keep the key requirement for inference.

expect(res.status).toBe(200)
expect(await res.json()).toEqual({ models: ['atlascloud/model-a'] })

expect(mockGetBYOKKey).toHaveBeenCalledWith('ws-1', '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 Tests assert mock calls

Both new suites assert mock calls, including mockGetBYOKKey here and mockExecuteTool in the provider suite. The repository explicitly says never to write tests that assert mocks were called. These checks depend on internal calls rather than proving the integration works. Replace them with tests through the real boundary that prove which key or tool result was used. This repository requirement must be satisfied before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +35 to +37
const permission = await getUserEntityPermissions(session.user.id, 'workspace', workspaceId)
if (permission) {
const byokResult = await getBYOKKey(workspaceId, '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 Route owns protected access

The handler decides workspace access and reads a protected key directly. The repository requires protected reads to enter through an authorized application use case and says route adapters must not decide resource authorization. Move the workspace check and key lookup into that shared use case, then call it from the route. This repository requirement must be satisfied before merging.

Context Used: CLAUDE.md (source)

Comment on lines +39 to +41
export const atlascloudProviderModelsQuerySchema = z.object({
workspaceId: z.string().min(1).optional(),
})

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 Query type is missing

atlascloudProviderModelsQuerySchema has no exported named type alias. The repository requires contracts to export both named schemas and named type aliases. Add AtlascloudProviderModelsQuery alongside the schema so callers can import its type rather than define their own. This repository requirement must be satisfied before merging.

Suggested change
export const atlascloudProviderModelsQuerySchema = z.object({
workspaceId: z.string().min(1).optional(),
})
export const atlascloudProviderModelsQuerySchema = z.object({
workspaceId: z.string().min(1).optional(),
})
export type AtlascloudProviderModelsQuery = z.input<typeof atlascloudProviderModelsQuerySchema>

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +5487 to +5501
export function AtlasCloudIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
{...props}
fill='currentColor'
fillRule='evenodd'
height='1em'
width='1em'
viewBox='0 0 24 24'
xmlns='http://www.w3.org/2000/svg'
>
<path d='M20.2,18.01L12,0.47,3.8,18.01l-2.58,5.52c1.62,-1.05,3.39,-1.86,5.26,-2.41,1.76,-0.51,3.61,-0.79,5.52,-0.79,0.98,0,1.95,0.08,2.9,0.22l-1.86,-4.3c-0.53,-0.1,-2.87,-0.1,-4.59,0.3l3.56,-8.28,5.52,12.85c0.01,0,0.02,0.01,0.03,0.01,1.86,0.55,3.62,1.36,5.23,2.4l-2.58,-5.52Z' />
</svg>
)
}

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 Docs icon is unused

The docs export AtlasCloudIcon, but nothing in the docs app imports it. The repository forbids exports that nothing imports. Remove this unused copy or connect it to an actual docs consumer. This repository requirement must be satisfied before merging.

Suggested change
export function AtlasCloudIcon(props: SVGProps<SVGSVGElement>) {
return (
<svg
{...props}
fill='currentColor'
fillRule='evenodd'
height='1em'
width='1em'
viewBox='0 0 24 24'
xmlns='http://www.w3.org/2000/svg'
>
<path d='M20.2,18.01L12,0.47,3.8,18.01l-2.58,5.52c1.62,-1.05,3.39,-1.86,5.26,-2.41,1.76,-0.51,3.61,-0.79,5.52,-0.79,0.98,0,1.95,0.08,2.9,0.22l-1.86,-4.3c-0.53,-0.1,-2.87,-0.1,-4.59,0.3l3.56,-8.28,5.52,12.85c0.01,0,0.02,0.01,0.03,0.01,1.86,0.55,3.62,1.36,5.23,2.4l-2.58,-5.52Z' />
</svg>
)
}

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

)
}

export function AtlasCloudIcon(props: SVGProps<SVGSVGElement>) {

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 Icon props lack an interface

The new AtlasCloudIcon components use SVGProps directly instead of a props interface. The component guide requires every component to have a props interface. Define AtlasCloudIconProps extending SVGProps<SVGSVGElement> and use it for these declarations. This repository requirement must be satisfied before merging.

Context Used: Component patterns and structure for React components (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Add Atlas Cloud as an OpenAI-compatible provider with BYOK support,
dynamic model listing, docs and tests. Rebased onto current main: wired into
the new attachment-provider map and usage-consumer icon map, and accounts for
the pending turn at the tool-loop cap like the other reseller providers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
@binyangzhu000-sudo
binyangzhu000-sudo force-pushed the feat/atlas-cloud-provider branch from 96e5fa5 to 1c7f5a0 Compare October 12, 2026 06:55
@binyangzhu000-sudo

Copy link
Copy Markdown
Author

I rebased this PR onto the current main (261 commits ahead of the old base) and resolved the conflicts in the BYOK settings, byok.ts, byok-keys.ts, history-adapters.ts, chat-completions.ts, registry.ts, types.ts, utils.ts and tools/types.ts. In each case Nebius had landed in the same spot, so both providers are kept.

Two additions were needed because of changes on main since the PR was opened:

  • providers/attachments.ts: Atlas Cloud is added to the attachment-provider map (images through image_url parts, like the other OpenAI-compatible resellers).
  • ee/organization-usage/components/usage-consumers.tsx: Atlas Cloud icon added to PROVIDER_ICONS, which the usage-consumers test requires to cover every registry provider.

I also set recordPendingUsage: true in the Atlas Cloud provider, which Together, OpenRouter and Nebius already use.

Checks I ran in apps/sim:

  • tsc --noEmit: clean.
  • biome check on the touched provider, BYOK, usage and settings paths: clean.
  • vitest run providers ee/organization-usage lib/api-key app/api/providers: 2122 passed, 5 skipped.
  • A temporary vitest (deleted afterwards) calling atlascloudProvider.executeRequest for atlascloud/qwen/qwen3.5-flash against the live gateway returned ok.

Not run: the full repo test suite and the browser UI for the BYOK settings page.

This branch has not been deployed

No deployments
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