Skip to content

Commit 8de0bdd

Browse files
authored
Merge pull request #69 from FSoft-AI4Code/promt/atlascloud
2 parents 62d6db2 + a78522b commit 8de0bdd

4 files changed

Lines changed: 37 additions & 6 deletions

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ codewiki --version
4848

4949
### 2. Configure Your Environment
5050

51-
CodeWiki supports multiple LLM providers: **OpenAI-compatible**, **Anthropic**, **AWS Bedrock**, **Azure OpenAI**, plus subscription mode via **Claude Code** and **Codex** CLIs (no API key required).
51+
CodeWiki supports multiple LLM providers: **OpenAI-compatible**, **Atlas Cloud**, **Anthropic**, **AWS Bedrock**, **Azure OpenAI**, plus subscription mode via **Claude Code** and **Codex** CLIs (no API key required).
5252

5353
```bash
5454
# OpenAI-compatible
@@ -60,6 +60,14 @@ codewiki config set \
6060
--cluster-model claude-sonnet-4 \
6161
--fallback-model glm-4p5
6262

63+
# Atlas Cloud — base URL auto-set to https://api.atlascloud.ai/v1;
64+
# API key read from $ATLASCLOUD_API_KEY when --api-key is omitted.
65+
codewiki config set \
66+
--provider atlas-cloud \
67+
--main-model anthropic/claude-sonnet-4.6 \
68+
--cluster-model anthropic/claude-sonnet-4.6 \
69+
--fallback-model zai-org/GLM-4.6
70+
6371
# Anthropic
6472
codewiki config set \
6573
--provider anthropic \
@@ -100,6 +108,8 @@ codewiki config set \
100108
--cluster-model gpt-5.5
101109
```
102110

111+
**About Atlas Cloud.** [Atlas Cloud](https://www.atlascloud.ai) is a full-modal AI inference platform that exposes LLM, image, and video models (300+) behind a single OpenAI-compatible API, so it works with CodeWiki out of the box. Browse model IDs at the [models endpoint](https://api.atlascloud.ai/v1/models) and pick a strong coding model for `--main-model` / `--cluster-model`; their [coding plan](https://www.atlascloud.ai/console/coding-plan) offers budget-friendly API access.
112+
103113
**Subscription mode** routes every LLM call through the local `claude` / `codex` CLI binary (via the [`caw`](https://github.com/zzjas/caw) library), so you can run CodeWiki on a Claude Pro/Max or Codex subscription instead of paying per-token API usage. Claude Code's built-in `Write`/`Edit`/`Bash` tools are disabled inside CodeWiki's agent loop so documentation writes still go through CodeWiki's Mermaid-validating editor.
104114

105115
> **Note on model names.** In subscription mode the model string is forwarded directly to `claude --model` / `codex --model`, so use the bare CLI model name (e.g. `gpt-5.4`, `claude-sonnet-4-6`) — **not** the litellm-style `openai/…` or `anthropic/…` prefix used by `openai-compatible`. If you previously ran with `openai-compatible`, re-run `config set` for **both** `--main-model` and `--cluster-model` to clear any stale prefixes; `config set` only updates the keys you pass.

codewiki/cli/commands/config.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
import json
6+
import os
67
import sys
78
import click
89
from typing import Optional, List
@@ -86,11 +87,12 @@ def config_group():
8687
@click.option(
8788
"--provider",
8889
type=click.Choice(
89-
['openai-compatible', 'anthropic', 'bedrock', 'azure-openai', 'claude-code', 'codex'],
90+
['openai-compatible', 'atlas-cloud', 'anthropic', 'bedrock', 'azure-openai', 'claude-code', 'codex'],
9091
case_sensitive=False,
9192
),
9293
help=(
9394
"LLM provider type (default: openai-compatible). "
95+
"Use 'atlas-cloud' for Atlas Cloud (base URL auto-set; reads ATLASCLOUD_API_KEY). "
9496
"Use 'claude-code' or 'codex' to run on a CLI subscription instead of an API key."
9597
),
9698
)
@@ -139,6 +141,11 @@ def config_set(
139141
$ codewiki config set --api-key sk-abc123 --base-url https://api.anthropic.com \\
140142
--main-model claude-sonnet-4 --cluster-model claude-sonnet-4 --fallback-model glm-4p5
141143
144+
\b
145+
# Atlas Cloud (OpenAI-compatible) — base URL auto-set,
146+
# API key read from ATLASCLOUD_API_KEY if --api-key is omitted
147+
$ codewiki config set --provider atlas-cloud --main-model <atlas-model> --cluster-model <atlas-model>
148+
142149
\b
143150
# Subscription mode (Claude Code) — no API key needed,
144151
# authenticate via 'claude login' on the host first
@@ -169,7 +176,17 @@ def config_set(
169176
if not any([api_key, base_url, main_model, cluster_model, fallback_model, max_tokens, max_token_per_module, max_token_per_leaf_module, max_depth, provider, aws_region, api_version, azure_deployment]):
170177
click.echo("No options provided. Use --help for usage information.")
171178
sys.exit(EXIT_CONFIG_ERROR)
172-
179+
180+
# Atlas Cloud convenience defaults: it's an OpenAI-compatible endpoint, so
181+
# auto-fill its base URL and pull the API key from ATLASCLOUD_API_KEY when the
182+
# user does not pass them explicitly.
183+
if provider and provider.lower() == "atlas-cloud":
184+
from codewiki.src.config import ATLAS_CLOUD_BASE_URL
185+
if not base_url:
186+
base_url = ATLAS_CLOUD_BASE_URL
187+
if not api_key:
188+
api_key = os.getenv("ATLASCLOUD_API_KEY")
189+
173190
# Validate inputs before saving
174191
validated_data = {}
175192

codewiki/cli/models/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class Configuration:
113113
cluster_model: Model for module clustering
114114
fallback_model: Fallback model for documentation generation
115115
default_output: Default output directory
116-
provider: LLM provider type (openai-compatible, anthropic, bedrock, azure-openai)
116+
provider: LLM provider type (openai-compatible, atlas-cloud, anthropic, bedrock, azure-openai)
117117
aws_region: AWS region for Bedrock provider
118118
api_version: Azure OpenAI API version
119119
azure_deployment: Azure OpenAI deployment name

codewiki/src/config.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ def is_cli_context() -> bool:
4343
LLM_BASE_URL = os.getenv('LLM_BASE_URL', 'http://0.0.0.0:4000/')
4444
LLM_API_KEY = os.getenv('LLM_API_KEY', 'sk-1234')
4545

46+
# Atlas Cloud default endpoint (OpenAI-compatible). Used to auto-fill the base URL
47+
# when the user selects the `atlas-cloud` provider without passing --base-url.
48+
ATLAS_CLOUD_BASE_URL = "https://api.atlascloud.ai/v1"
49+
4650
@dataclass
4751
class Config:
4852
"""Configuration class for CodeWiki."""
@@ -58,7 +62,7 @@ class Config:
5862
cluster_model: str
5963
fallback_model: str = FALLBACK_MODEL_1
6064
# Provider configuration
61-
provider: str = "openai-compatible" # openai-compatible, anthropic, bedrock, azure-openai
65+
provider: str = "openai-compatible" # openai-compatible, atlas-cloud, anthropic, bedrock, azure-openai
6266
aws_region: str = "us-east-1"
6367
api_version: str = "2024-12-01-preview" # Azure OpenAI API version
6468
azure_deployment: str = "" # Azure OpenAI deployment name
@@ -181,7 +185,7 @@ def from_cli(
181185
main_model: Primary model
182186
cluster_model: Clustering model
183187
fallback_model: Fallback model
184-
provider: LLM provider type (openai-compatible, anthropic, bedrock, azure-openai)
188+
provider: LLM provider type (openai-compatible, atlas-cloud, anthropic, bedrock, azure-openai)
185189
aws_region: AWS region for Bedrock provider
186190
api_version: Azure OpenAI API version
187191
azure_deployment: Azure OpenAI deployment name

0 commit comments

Comments
 (0)