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
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ codewiki --version

### 2. Configure Your Environment

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).
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).

```bash
# OpenAI-compatible
Expand All @@ -60,6 +60,14 @@ codewiki config set \
--cluster-model claude-sonnet-4 \
--fallback-model glm-4p5

# Atlas Cloud — base URL auto-set to https://api.atlascloud.ai/v1;
# API key read from $ATLASCLOUD_API_KEY when --api-key is omitted.
codewiki config set \
--provider atlas-cloud \
--main-model anthropic/claude-sonnet-4.6 \
--cluster-model anthropic/claude-sonnet-4.6 \
--fallback-model zai-org/GLM-4.6

# Anthropic
codewiki config set \
--provider anthropic \
Expand Down Expand Up @@ -100,6 +108,8 @@ codewiki config set \
--cluster-model gpt-5.5
```

**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.

**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.

> **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.
Expand Down
21 changes: 19 additions & 2 deletions codewiki/cli/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

import json
import os
import sys
import click
from typing import Optional, List
Expand Down Expand Up @@ -86,11 +87,12 @@ def config_group():
@click.option(
"--provider",
type=click.Choice(
['openai-compatible', 'anthropic', 'bedrock', 'azure-openai', 'claude-code', 'codex'],
['openai-compatible', 'atlas-cloud', 'anthropic', 'bedrock', 'azure-openai', 'claude-code', 'codex'],
case_sensitive=False,
),
help=(
"LLM provider type (default: openai-compatible). "
"Use 'atlas-cloud' for Atlas Cloud (base URL auto-set; reads ATLASCLOUD_API_KEY). "
"Use 'claude-code' or 'codex' to run on a CLI subscription instead of an API key."
),
)
Expand Down Expand Up @@ -139,6 +141,11 @@ def config_set(
$ codewiki config set --api-key sk-abc123 --base-url https://api.anthropic.com \\
--main-model claude-sonnet-4 --cluster-model claude-sonnet-4 --fallback-model glm-4p5

\b
# Atlas Cloud (OpenAI-compatible) — base URL auto-set,
# API key read from ATLASCLOUD_API_KEY if --api-key is omitted
$ codewiki config set --provider atlas-cloud --main-model <atlas-model> --cluster-model <atlas-model>

\b
# Subscription mode (Claude Code) — no API key needed,
# authenticate via 'claude login' on the host first
Expand Down Expand Up @@ -169,7 +176,17 @@ def config_set(
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]):
click.echo("No options provided. Use --help for usage information.")
sys.exit(EXIT_CONFIG_ERROR)


# Atlas Cloud convenience defaults: it's an OpenAI-compatible endpoint, so
# auto-fill its base URL and pull the API key from ATLASCLOUD_API_KEY when the
# user does not pass them explicitly.
if provider and provider.lower() == "atlas-cloud":
from codewiki.src.config import ATLAS_CLOUD_BASE_URL
if not base_url:
base_url = ATLAS_CLOUD_BASE_URL
if not api_key:
api_key = os.getenv("ATLASCLOUD_API_KEY")

# Validate inputs before saving
validated_data = {}

Expand Down
2 changes: 1 addition & 1 deletion codewiki/cli/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Configuration:
cluster_model: Model for module clustering
fallback_model: Fallback model for documentation generation
default_output: Default output directory
provider: LLM provider type (openai-compatible, anthropic, bedrock, azure-openai)
provider: LLM provider type (openai-compatible, atlas-cloud, anthropic, bedrock, azure-openai)
aws_region: AWS region for Bedrock provider
api_version: Azure OpenAI API version
azure_deployment: Azure OpenAI deployment name
Expand Down
8 changes: 6 additions & 2 deletions codewiki/src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def is_cli_context() -> bool:
LLM_BASE_URL = os.getenv('LLM_BASE_URL', 'http://0.0.0.0:4000/')
LLM_API_KEY = os.getenv('LLM_API_KEY', 'sk-1234')

# Atlas Cloud default endpoint (OpenAI-compatible). Used to auto-fill the base URL
# when the user selects the `atlas-cloud` provider without passing --base-url.
ATLAS_CLOUD_BASE_URL = "https://api.atlascloud.ai/v1"

@dataclass
class Config:
"""Configuration class for CodeWiki."""
Expand All @@ -58,7 +62,7 @@ class Config:
cluster_model: str
fallback_model: str = FALLBACK_MODEL_1
# Provider configuration
provider: str = "openai-compatible" # openai-compatible, anthropic, bedrock, azure-openai
provider: str = "openai-compatible" # openai-compatible, atlas-cloud, anthropic, bedrock, azure-openai
aws_region: str = "us-east-1"
api_version: str = "2024-12-01-preview" # Azure OpenAI API version
azure_deployment: str = "" # Azure OpenAI deployment name
Expand Down Expand Up @@ -181,7 +185,7 @@ def from_cli(
main_model: Primary model
cluster_model: Clustering model
fallback_model: Fallback model
provider: LLM provider type (openai-compatible, anthropic, bedrock, azure-openai)
provider: LLM provider type (openai-compatible, atlas-cloud, anthropic, bedrock, azure-openai)
aws_region: AWS region for Bedrock provider
api_version: Azure OpenAI API version
azure_deployment: Azure OpenAI deployment name
Expand Down