Model Failover 模型故障转移
Model Failover 机制确保在主模型不可用时自动切换到备用模型。
故障转移策略
yaml
models:
primary: "gpt-4"
fallbacks:
- "claude-3-opus"
- "claude-3-sonnet"
- "gpt-3.5-turbo"
failover:
enabled: true
max_retries: 3
retry_delay: 1000 # 毫秒
health_check: true故障检测
1. 超时检测
yaml
failover:
timeout:
gpt-4: 30000 # 30秒
gpt-3.5-turbo: 15000 # 15秒2. 错误码检测
yaml
failover:
error_codes:
- "rate_limit" # 限流
- "model_overloaded" # 模型过载
- "server_error" # 服务器错误手动切换
bash
# 切换到备用模型
openclaw model switch --to=claude-3-sonnet
# 查看当前模型状态
openclaw model status相关概念
- 模型 (Models) - 模型配置
- 模型提供商 - 提供商配置