Model Configuration
Model Configuration
Section titled “Model Configuration”LingXiao allows separate configuration of Leader and Worker LLM models, with support for multiple providers and compatibility layers.
Configuration Methods
Section titled “Configuration Methods”Environment Variables
Section titled “Environment Variables”export LINGXIAO_LLM_PROVIDER=openaiexport LINGXIAO_LEADER_MODEL=gpt-4oexport LINGXIAO_AGENT_MODEL=gpt-4o-miniConfig File
Section titled “Config File”Edit ~/.lingxiao/settings.json:
{ "llm": { "provider": "openai", "leader_model": "gpt-4o", "agent_model": "gpt-4o-mini", "enable_streaming": true }}LLM Config Group
Section titled “LLM Config Group”Key settings in the llm group:
| Setting | Description |
|---|---|
provider | Provider selection: auto / openai / anthropic |
leader_model | Leader model |
agent_model | Worker model |
wiki_model | Wiki knowledge summary model |
model_providers | Provider model registry |
gateway_routes | Multi-model gateway routes |
gateway_fallback_models | Gateway fallback models |
request_timeout_s | Request timeout (seconds) |
connect_timeout_s | Connect timeout (seconds) |
max_retries | Max retry count |
backoff_base_ms | Backoff base milliseconds |
context_max_tokens | Context max tokens |
capped_max_tokens | Capped max tokens |
escalated_max_tokens | Escalated max tokens |
thinking_budget_tokens | Thinking budget tokens |
enable_streaming | Enable streaming output |
show_thinking_content | Show thinking content |
enable_thinking_instruction | Enable thinking instruction |
enable_extended_thinking | Enable extended thinking |
reasoning_effort | Reasoning effort |
Supported Providers
Section titled “Supported Providers”| Provider | provider value | API format | Notes |
|---|---|---|---|
| OpenAI | openai | OpenAI API | Native support |
| Anthropic | anthropic | Anthropic API | Native support |
| DeepSeek | openai | OpenAI compatible | Set LINGXIAO_OPENAI_BASE_URL |
| Qwen | openai | OpenAI compatible | Set LINGXIAO_OPENAI_BASE_URL |
| Moonshot/Kimi | openai | OpenAI compatible | Set LINGXIAO_OPENAI_BASE_URL |
| Gemini | openai | OpenAI compat layer | Via compatibility layer |
| Groq | openai | OpenAI compatible | Set LINGXIAO_OPENAI_BASE_URL |
| SiliconFlow | openai | OpenAI compatible | Set LINGXIAO_OPENAI_BASE_URL |
Compatible Provider Examples
Section titled “Compatible Provider Examples”DeepSeek example:
export LINGXIAO_LLM_PROVIDER=openaiexport LINGXIAO_OPENAI_API_KEY=sk-your-deepseek-keyexport LINGXIAO_OPENAI_BASE_URL=https://api.deepseek.com/v1export LINGXIAO_LEADER_MODEL=deepseek-chatexport LINGXIAO_AGENT_MODEL=deepseek-chatQwen example:
export LINGXIAO_LLM_PROVIDER=openaiexport LINGXIAO_OPENAI_API_KEY=sk-your-qwen-keyexport LINGXIAO_OPENAI_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1export LINGXIAO_LEADER_MODEL=qwen-plusexport LINGXIAO_AGENT_MODEL=qwen-turboLocal LLM Gateway
Section titled “Local LLM Gateway”LingXiao includes a local LLM gateway (/llm/* routes) as a unified endpoint, supporting both OpenAI and Anthropic formats.
Gateway Config
Section titled “Gateway Config”{ "llm_gateway": { "enabled": true, "provider": "openai", "model": "gpt-4o-mini", "inject_env": true, "default_rpm": 60, "default_tpm": 200000, "default_daily_token_budget": 2000000, "trace_enabled": true }}Virtual Keys
Section titled “Virtual Keys”The gateway supports virtual key management:
{ "llm_gateway": { "virtual_keys": [ { "id": "key-001", "key": "sk-virtual-xxx", "label": "Dev Test", "enabled": true, "model": "gpt-4o-mini", "rpm": 30, "tpm": 100000, "daily_token_budget": 500000 } ] }}Gateway routes authenticate with virtual keys (Authorization: Bearer <key> or x-api-key), not the server token.
Leader & Worker Model Strategy
Section titled “Leader & Worker Model Strategy”- Leader model: Responsible for task decomposition and orchestration decisions; recommend a more capable model
- Worker model: Responsible for task execution; can use a more cost-effective model
- Wiki model: Used for knowledge summaries; can use a lightweight model
{ "llm": { "leader_model": "gpt-4o", "agent_model": "gpt-4o-mini", "wiki_model": "gpt-4o-mini" }}