Skip to main content

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

FieldTypeDescription
model_namestringUser-defined alias (e.g. "claude")
modelstringProvider model ID (e.g. "claude-sonnet-4-6")
api_basestringCustom API endpoint (optional)
api_keySecureStringAPI key — stored in .security.yml, never in config.json
proxystringHTTP proxy URL (optional)
auth_methodstringAuth scheme override (optional)
connect_modestringConnection mode override (optional)
workspacestringWorkspace path override (optional)
rpmintRequests-per-minute rate limit (optional)
request_timeoutintTimeout in seconds (optional)
thinking_levelstringExtended 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"
}
}
}