Skip to content
广告 · 本站推荐广告

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>输出格式:textjsontabletable
--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

相关命令

基于MIT协议开源 | 内容翻译自 官方文档,同步更新