Skip to content
Draft
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
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,19 @@ JINA_API_KEY=your_jina_key # Web content extraction
# GEMINI_API_KEY=your_gemini_key # Google Gemini support
```

# ZAI (OpenAI-compatible proxy)
# Option A (explicit provider)
# DEFAULT_API_PROVIDER=zai
# ZAI_API_KEY=your_zai_key
# ZAI_MODEL=glm-4.5 # or the model your proxy exposes
# ZAI_BASE_URL=https://<your-z-proxy>/v1
# Or run with: python launcher.py --mode backend --backend-mode unified --api-type zai
# Option B (no code changes, reuse openai path)
# OPENAI_API_KEY=your_zai_key
# OPENAI_MODEL=glm-4.5
# OPENAI_BASE_URL=https://<your-z-proxy>/v1


💡 **Tip**: The `configs/env.example` file contains all available configuration options with detailed comments.

### Launch
Expand Down
18 changes: 18 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ SERPER_API_KEY=your_serper_key # For Google search results - Get API ke
JINA_API_KEY=your_jina_key # For web content extraction - Get API key at: https://jina.ai/
```

#### ZAI (OpenAI-compatible) quick setup
Option A: use dedicated provider
```bash
DEFAULT_API_PROVIDER=zai
ZAI_API_KEY=your_zai_key
ZAI_MODEL=glm-4.5 # adjust to your proxy’s model id
ZAI_BASE_URL=https://<your-z-proxy>/v1
# Or select at runtime:
python launcher.py --mode backend --backend-mode unified --api-type zai
```
Option B: reuse OpenAI path (no code changes)
```bash
OPENAI_API_KEY=your_zai_key
OPENAI_MODEL=glm-4.5
OPENAI_BASE_URL=https://<your-z-proxy>/v1
```


💡 **Note**: The `configs/env.example` file contains the complete configuration template with all available options and detailed comments.

---
Expand Down
8 changes: 8 additions & 0 deletions configs/env.example
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,11 @@ DEEPSEEK_BASE_URL=https://api.deepseek.com/v1
# Google Gemini Configuration
GEMINI_API_KEY=${GEMINI_API_KEY}
GEMINI_MODEL=gemini-2.5-pro

# ZAI Configuration (OpenAI-compatible proxy)
# Point ZAI_BASE_URL to your OpenAI-compatible Z proxy (e.g., https://<your-z-proxy>/v1)
# Set DEFAULT_API_PROVIDER=zai or use --api-type zai to select it
ZAI_API_KEY=${ZAI_API_KEY}
ZAI_MODEL=glm-4.5
ZAI_BASE_URL=${ZAI_BASE_URL}

2 changes: 1 addition & 1 deletion configs/mode_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def create_argument_parser() -> argparse.ArgumentParser:

parser.add_argument(
'--api-type', '-a',
choices=['basic', 'azure_openai', 'openai', 'claude', 'deepseek', 'basic_claude4', 'basic_deepseek_r1'],
choices=['basic', 'azure_openai', 'openai', 'claude', 'deepseek', 'zai', 'basic_claude4', 'basic_deepseek_r1'],
default='basic',
help='API type (default: basic)'
)
Expand Down
12 changes: 11 additions & 1 deletion configs/oai_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
import warnings

# Default provider priority order
# --- Codegen: add ZAI to provider priority (OpenAI-compatible via base_url) ---

DEFAULT_PROVIDER_PRIORITY = [
'openai',
'zai',
'claude',
'deepseek',
'basic',
Expand All @@ -26,6 +29,13 @@ def get_api_config():
"base_url": os.environ.get("ANTHROPIC_BASE_URL")
}]
},
'zai': {
"config_list": [{
"model": os.environ.get("ZAI_MODEL", os.environ.get("OPENAI_MODEL", "glm-4.5")),
"api_key": os.environ.get("ZAI_API_KEY"),
"base_url": os.environ.get("ZAI_BASE_URL")
}]
},
'deepseek': {
"config_list": [{
"model": os.environ.get("DEEPSEEK_MODEL", "deepseek-v3"),
Expand Down Expand Up @@ -210,4 +220,4 @@ def get_llm_config(api_type: str = None, timeout: int = 240, temperature: float
def load_envs_func():
pwd = os.getcwd()
from dotenv import load_dotenv
load_dotenv(os.path.join(pwd, "configs", ".env"))
load_dotenv(os.path.join(pwd, "configs", ".env"))