Model Configuration
model_list is the new model-centric config pattern. Define each LLM once with all its credentials, then reference it by name everywhere else in config.
ModelConfig fields
| Field | Type | Description |
|---|---|---|
model_name | string | User-defined alias (e.g. "claude") |
model | string | Provider model ID (e.g. "claude-sonnet-4-6") |
api_base | string | Custom API endpoint (optional) |
api_key | SecureString | API key — stored in .security.yml, never in config.json |
proxy | string | HTTP proxy URL (optional) |
auth_method | string | Auth scheme override (optional) |
connect_mode | string | Connection mode override (optional) |
workspace | string | Workspace path override (optional) |
rpm | int | Requests-per-minute rate limit (optional) |
request_timeout | int | Timeout in seconds (optional) |
thinking_level | string | Extended thinking: "none" | "low" | "high" (Claude only) |
Example: ~/.khunquant/config.json
{
"model_list": [
{
"model_name": "claude",
"model": "claude-sonnet-4-6",
"api_key": "ANTHROPIC_API_KEY"
},
{
"model_name": "gpt4o",
"model": "gpt-4o",
"api_key": "OPENAI_API_KEY"
},
{
"model_name": "local",
"model": "llama3.2",
"api_base": "http://localhost:11434/v1",
"api_key": "ollama"
}
]
}
API keys referenced above are resolved from .security.yml — the value in config.json is just the key name.
Example: ~/.khunquant/.security.yml
model_list:
- model_name: claude
api_key: sk-ant-...
- model_name: gpt4o
api_key: sk-...
- model_name: local
api_key: ollama
tip
Use enc:// prefix to store encrypted values in .security.yml. See .security.yml Reference for details.
Selecting the default model
Set the default model for your agent in the agent config:
{
"agents": {
"defaults": {
"model_name": "claude"
}
}
}