openclaw models
管理 AI 模型配置。
概要
bash
openclaw models <子命令> [选项]描述
openclaw models 命令用于管理 OpenClaw 所连接的各类 AI 模型。支持查看可用模型列表、测试模型连通性、设置默认模型以及管理模型别名,方便在多模型环境下灵活调配。
子命令
| 子命令 | 说明 |
|---|---|
list | 列出所有已配置的模型 |
test [name] | 测试模型连通性(不指定则测试全部) |
set-default <name> | 设置默认模型 |
alias <alias> <model> | 为模型设置别名 |
remove <name> | 移除模型配置 |
info <name> | 查看模型详细信息 |
选项
| 选项 | 缩写 | 说明 | 默认值 |
|---|---|---|---|
--format <type> | 输出格式:text、json、table | table | |
--verbose | -v | 显示详细信息 | false |
--timeout <ms> | 测试超时时间 | 10000 |
模型列表输出
$ openclaw models list
┌──────────────────────┬──────────┬──────────┬─────────┐
│ 模型名称 │ 提供商 │ 状态 │ 默认 │
├──────────────────────┼──────────┼──────────┼─────────┤
│ deepseek-chat │ DeepSeek │ ✅ 可用 │ ★ │
│ qwen-max │ 阿里云 │ ✅ 可用 │ │
│ gpt-4o │ OpenAI │ ✅ 可用 │ │
│ llama3-local │ Ollama │ ⚠️ 离线 │ │
└──────────────────────┴──────────┴──────────┴─────────┘模型别名
使用别名可以简化模型引用:
bash
# 设置别名
openclaw models alias fast deepseek-chat
openclaw models alias smart gpt-4o
# 之后可以用别名引用
openclaw message "你好" --model fast示例
bash
# 列出所有模型
openclaw models list
# 测试所有模型连通性
openclaw models test
# 测试指定模型
openclaw models test deepseek-chat
# 设置默认模型
openclaw models set-default qwen-max
# 查看模型详细信息
openclaw models info deepseek-chat
# 为模型设置别名
openclaw models alias coding deepseek-coder
# 移除模型配置
openclaw models remove gpt-4o相关命令
openclaw config- 配置管理openclaw status- 系统状态查看openclaw onboard- 初始化向导
