feat: add Atlas Cloud LLM provider - #21
Conversation
Reviewer's GuideAdds a new OpenAI-compatible Atlas Cloud LLM provider and wires it into the runtime: provider manager, env resolution, auto-detection, provider defaults, response-format handling, provider assignment, tests, docs, and platform knowledge copy are all updated to treat Atlas Cloud as the 12th first-class provider. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider removing or gating the
console.logcalls inAtlasCloudProvider.initializeandshutdownto avoid noisy logs in production; other providers tend to avoid logging at this level. - The
ProviderConfigEntry.configunion inAIModelProviderManageris becoming large; you might want to refactor it into a mapped type keyed by providerId or a discriminated union to keep the type easier to maintain as new providers likeatlascloudare added.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider removing or gating the `console.log` calls in `AtlasCloudProvider.initialize` and `shutdown` to avoid noisy logs in production; other providers tend to avoid logging at this level.
- The `ProviderConfigEntry.config` union in `AIModelProviderManager` is becoming large; you might want to refactor it into a mapped type keyed by providerId or a discriminated union to keep the type easier to maintain as new providers like `atlascloud` are added.
## Individual Comments
### Comment 1
<location path="src/core/llm/providers/implementations/AtlasCloudProvider.ts" line_range="128-129" />
<code_context>
+ }
+
+ public async listAvailableModels(filter?: { capability?: string }): Promise<ModelInfo[]> {
+ if (filter?.capability) {
+ return ATLAS_CLOUD_MODELS.filter(m => m.capabilities.includes(filter.capability!));
+ }
+ return [...ATLAS_CLOUD_MODELS];
</code_context>
<issue_to_address>
**nitpick:** Avoid the non-null assertion in the capabilities filter to keep the implementation cleaner and safer.
Within the `if (filter?.capability)` block, `filter.capability` is already typed as `string`, so the `!` is unnecessary. Use `includes(filter.capability)` instead to avoid redundant assertions and keep the code safer if the filter type changes in the future.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
PR Summary by QodoAdd Atlas Cloud as a new OpenAI-compatible LLM provider
AI Description
Diagram
Files changed (18)
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAtlas Cloud was added as an OpenAI-compatible LLM provider. Runtime resolution, provider assignment, structured responses, tests, documentation, and provider-count references were updated. ChangesAtlas Cloud provider support
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AIModelProviderManager
participant AtlasCloudProvider
participant OpenAIProvider
AIModelProviderManager->>AtlasCloudProvider: initialize provider configuration
AtlasCloudProvider->>OpenAIProvider: initialize compatible transport
AtlasCloudProvider->>OpenAIProvider: delegate completion or streaming request
OpenAIProvider-->>AtlasCloudProvider: return completion response
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 846378f240
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Code Review by Qodo
1.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/features/LLM_PROVIDERS.md`:
- Line 3: Update the provider breakdown in the introductory text and the
corresponding reference around the provider matrix: describe twelve providers as
9 API-key providers, Ollama, and 2 CLI providers, ensuring the category counts
sum to twelve and removing the incorrect “10 via API key” wording.
In `@src/orchestration/planning/ProviderAssignmentEngine.ts`:
- Line 109: Update the assignBalanced method’s cheap, strong, and standard
preferred-provider lists to include atlascloud in the same priority positions
used by the corresponding best and cheapest strategies, while preserving the
existing balanced rotation keys and tier selection logic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: bedc9ccf-dd65-4f83-8f1c-c8e0f74832fb
📒 Files selected for processing (18)
CITATION.cffREADME.mddocs/architecture/ARCHITECTURE.mddocs/features/LLM_PROVIDERS.mdpackage.jsonscripts/build-knowledge-corpus.mjssrc/api/model.tssrc/api/runtime/__tests__/provider-defaults.test.tssrc/api/runtime/__tests__/responseFormatForProvider.test.tssrc/api/runtime/provider-defaults.tssrc/api/runtime/responseFormatForProvider.tssrc/core/llm/providers/AIModelProviderManager.tssrc/core/llm/providers/__tests__/OpenAICompatProviders.test.tssrc/core/llm/providers/implementations/AtlasCloudProvider.tssrc/orchestration/pipeline/query/__tests__/platform-knowledge.test.tssrc/orchestration/planning/ProviderAssignmentEngine.tstests/api/model.spec.tstests/e2e/platform-knowledge.e2e.spec.ts
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
docs/features/LLM_PROVIDERS.md (2)
62-62: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winMake Atlas Cloud’s cost tier consistent.
The provider matrix says
Varies, while the Cost Tiers section classifies Atlas Cloud as$$ (Standard). Choose one source of truth and update both sections accordingly.Also applies to: 249-249
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/features/LLM_PROVIDERS.md` at line 62, Update the Atlas Cloud entries in the provider matrix and Cost Tiers section of LLM_PROVIDERS.md to use one consistent cost classification. Choose either “Varies” or “$$ (Standard)” as the authoritative value, then apply that same value to both sections.
62-62: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winQualify Atlas Cloud capabilities as model-dependent.
The provider’s model catalog shows tool use and structured outputs for DeepSeek, but Qwen is chat-only. Mark these table entries as model-dependent, or limit the “Yes” claims to models that support those capabilities.
Also applies to: 517-517
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/features/LLM_PROVIDERS.md` at line 62, Update the Atlas Cloud row in the provider capabilities table so tool use and structured outputs are marked as model-dependent rather than unconditionally supported, reflecting that DeepSeek supports them while Qwen is chat-only.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/orchestration/pipeline/query/types.ts`:
- Line 814: The Atlas cheap-tier defaults and assignments currently use the Pro
model; update the Atlas cheap paths in src/orchestration/pipeline/query/types.ts
(814-814) and src/orchestration/planning/ProviderAssignmentEngine.ts (26-26) to
use the cheaper Atlas Flash/V4 Flash model. Relax the corresponding expectations
in src/orchestration/pipeline/query/__tests__/QueryRouter.test.ts (278-282) and
src/orchestration/__tests__/ProviderAssignmentEngine.test.ts (82-90) so
cheap-tier tests no longer require the Pro model.
---
Outside diff comments:
In `@docs/features/LLM_PROVIDERS.md`:
- Line 62: Update the Atlas Cloud entries in the provider matrix and Cost Tiers
section of LLM_PROVIDERS.md to use one consistent cost classification. Choose
either “Varies” or “$$ (Standard)” as the authoritative value, then apply that
same value to both sections.
- Line 62: Update the Atlas Cloud row in the provider capabilities table so tool
use and structured outputs are marked as model-dependent rather than
unconditionally supported, reflecting that DeepSeek supports them while Qwen is
chat-only.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c9649070-86bf-4703-a076-1eea2d61e334
📒 Files selected for processing (11)
README.mddocs/features/LLM_PROVIDERS.mdpackage.jsonsrc/api/runtime/provider-defaults.tssrc/core/llm/providers/__tests__/OpenAICompatProviders.test.tssrc/core/llm/providers/implementations/AtlasCloudProvider.tssrc/orchestration/__tests__/ProviderAssignmentEngine.test.tssrc/orchestration/pipeline/query/QueryRouter.tssrc/orchestration/pipeline/query/__tests__/QueryRouter.test.tssrc/orchestration/pipeline/query/types.tssrc/orchestration/planning/ProviderAssignmentEngine.ts
💤 Files with no reviewable changes (1)
- src/core/llm/providers/implementations/AtlasCloudProvider.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- package.json
- README.md
- src/api/runtime/provider-defaults.ts
- src/core/llm/providers/tests/OpenAICompatProviders.test.ts
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/orchestration/pipeline/query/types.ts (1)
791-791: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winDo not route embeddings through Atlas by default.
When
ATLASCLOUD_API_KEYis the available credential,resolveDefaultProvider()returnsatlascloud;DEFAULT_QUERY_ROUTER_CONFIGthen uses that same provider for embeddings while selectingtext-embedding-3-small. The provider documentation states Atlas has no embedding support, so default knowledge/retrieval paths can fail. Resolve embeddings independently to a supported provider or disable them for Atlas-only configurations.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/orchestration/pipeline/query/types.ts` at line 791, Update resolveDefaultProvider and DEFAULT_QUERY_ROUTER_CONFIG so an ATLASCLOUD_API_KEY does not select Atlas for embeddings; resolve embeddings through a supported provider independently, or disable embeddings when Atlas is the only configured provider, while preserving Atlas as the default query provider.docs/features/LLM_PROVIDERS.md (1)
116-125: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAlign the documented auto-detection order with the runtime resolver.
The guide lists OpenRouter first, but
resolveDefaultProvider()checksOPENAI_API_KEY, thenATLASCLOUD_API_KEY, and only laterOPENROUTER_API_KEY. With multiple keys set, the documentation and runtime choose different providers. Update either the list or the resolver so this priority contract is accurate.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/features/LLM_PROVIDERS.md` around lines 116 - 125, Align the auto-detection priority documented in LLM_PROVIDERS.md with resolveDefaultProvider(): place OPENROUTER_API_KEY after OPENAI_API_KEY and ATLASCLOUD_API_KEY, matching the runtime resolver’s actual order. Preserve the remaining provider order and descriptions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@docs/features/LLM_PROVIDERS.md`:
- Around line 116-125: Align the auto-detection priority documented in
LLM_PROVIDERS.md with resolveDefaultProvider(): place OPENROUTER_API_KEY after
OPENAI_API_KEY and ATLASCLOUD_API_KEY, matching the runtime resolver’s actual
order. Preserve the remaining provider order and descriptions.
In `@src/orchestration/pipeline/query/types.ts`:
- Line 791: Update resolveDefaultProvider and DEFAULT_QUERY_ROUTER_CONFIG so an
ATLASCLOUD_API_KEY does not select Atlas for embeddings; resolve embeddings
through a supported provider independently, or disable embeddings when Atlas is
the only configured provider, while preserving Atlas as the default query
provider.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 892221bf-6810-490e-87a7-2caf5692f12a
📒 Files selected for processing (8)
docs/features/LLM_PROVIDERS.mdpackage.jsonsrc/api/runtime/provider-defaults.tssrc/core/llm/providers/__tests__/OpenAICompatProviders.test.tssrc/orchestration/__tests__/ProviderAssignmentEngine.test.tssrc/orchestration/pipeline/query/__tests__/QueryRouter.test.tssrc/orchestration/pipeline/query/types.tssrc/orchestration/planning/ProviderAssignmentEngine.ts
🚧 Files skipped from review as they are similar to previous changes (6)
- src/orchestration/tests/ProviderAssignmentEngine.test.ts
- package.json
- src/api/runtime/provider-defaults.ts
- src/orchestration/pipeline/query/tests/QueryRouter.test.ts
- src/orchestration/planning/ProviderAssignmentEngine.ts
- src/core/llm/providers/tests/OpenAICompatProviders.test.ts
- preserve Atlas as QueryRouter default text provider - disable vector embeddings for Atlas-only environments - clarify runtime versus QueryRouter auto-detection order - add focused regression coverage Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
|
Follow-up pushed in
Validation:
|
Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
|
Resolved the merge conflict with the current upstream The QueryRouter feedback is also covered by the current branch: Atlas Cloud is included in default provider detection, LLM API-key resolution, cheap/strong model mappings, and regression coverage. Embeddings intentionally remain on embedding-capable providers. Validation:
GitHub now reports the PR as mergeable. The exact-head CI workflow currently requires maintainer approval. |
Summary
atlascloudOpenAI-compatible LLM provider wrapper with Atlas Cloud defaultsValidation
./node_modules/.bin/vitest run src/core/llm/providers/__tests__/OpenAICompatProviders.test.ts src/api/runtime/__tests__/provider-defaults.test.ts src/api/runtime/__tests__/responseFormatForProvider.test.ts tests/api/model.spec.ts src/orchestration/pipeline/query/__tests__/platform-knowledge.test.ts(88 tests passed)./node_modules/.bin/tsc --noEmit./node_modules/.bin/eslint "src/**/*.ts"(passes with existing warnings)git diff --checkdeepseek-ai/deepseek-v4-proandqwen/qwen3.5-flashNote:
pnpm install --frozen-lockfilecompleted dependency resolution and ran the repository build successfully, but exited afterward withERR_PNPM_IGNORED_BUILDSbecause this local pnpm setup requires approving build scripts for optional native dependencies.Summary by Sourcery
Add Atlas Cloud as an OpenAI-compatible LLM provider and wire it into runtime defaults, auto-detection, provider assignment, and JSON response-format handling.
New Features:
Enhancements:
Tests:
Summary by CodeRabbit
New Features
ATLASCLOUD_API_KEYis configured, with optional base URL customization.Documentation