返回顶部
m

model-tester模型测试器

Test agents or models against predefined test cases to validate model routing, performance, and output quality. Use when: (1) verifying a specific agent or model works correctly, (2) debugging model fallback chains, (3) testing model selection behavior, (4) validating extraction/reasoning/classification across different models, or (5) verifying a model actually got used after routing. Supports --agent, --model, --case parameters with structured JSON output.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
316
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

model-tester

技能名称: model-tester
详细描述:
使用 scripts/model_tester.py 运行可重复的测试提示,并从 OpenClaw 日志中比较请求的模型使用情况与实际模型使用情况。

运行

从技能目录(或传递绝对路径):

bash
python3 scripts/model_tester.py --agent menial --case extract-emails
python3 scripts/model_tester.py --model openai/gpt-4.1 --case math-reasoning
python3 scripts/model_tester.py --agent chat --model openai/gpt-4.1 --case all --out /tmp/model-test.json

输入参数

  • - --agent <名称>: 目标代理(chat、menial、coder 等)
  • --model <名称>: 要测试的请求模型别名/名称
  • --case : 来自 references/test-cases.json 的测试用例或 all
  • --timeout <秒>: 每个用例的超时时间(默认 120)
  • --out <文件>: 可选的 JSON 输出文件

至少需要 --agent 或 --model 中的一个。

运行器执行的操作

  1. 1. 从 references/test-cases.json 加载测试用例。
  2. 并行启动 openclaw logs --follow --json。
  3. 使用受限的测试提示运行 openclaw agent --json(要求代理为任务使用子代理)。
  4. 解析响应 + 尾部日志。
  5. 输出机器可读的 JSON 和简短的人类可读摘要。

输出格式

顶层 JSON:

  • - tool
  • timestamp
  • agent
  • requested_model
  • results[]

每个结果条目返回:

  • - testcase
  • agent
  • requestedmodel
  • actualmodel(从日志中解析,如果可用)
  • status(ok/error)
  • resultsummary
  • runtime_seconds
  • tokens(如果可发现)
  • errors[]

隐私与安全

测试器仅使用预定义的测试提示生成隔离的子代理任务——不会向模型传递任何用户数据。它会跟踪 OpenClaw 日志以提取:

  • - 实际选择的模型(路由验证)
  • 令牌使用统计
  • 运行时指标

日志提取使用正则表达式模式查找模型/令牌字段。不会捕获任何个人身份信息或任意日志内容——仅捕获与测试执行相关的结构化字段。

注意事项

  • - 模型提取和令牌提取是尽力而为的,因为日志字段可能因 OpenClaw/提供商版本而异。
  • 如果 openclaw 配置无效或网关不可用,脚本将返回 status=error 并附带 stderr 详细信息。
  • 编辑 references/test-cases.json 以添加自定义提示到您的基准测试集。
  • 所有测试用例都是通用的;不包含任何工作区或用户数据。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 model-tester-1776128057 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 model-tester-1776128057 技能

通过命令行安装

skillhub install model-tester-1776128057

下载

⬇ 下载 model-tester v1.0.0(免费)

文件大小: 5.26 KB | 发布时间: 2026-4-15 13:27

v1.0.0 最新 2026-4-15 13:27
Initial release of model-tester.

- Provides a command-line tool to validate agents or models against predefined test cases.
- Supports testing model routing, performance, and output quality with structured JSON reporting.
- Allows targeting specific agents or models using `--agent`, `--model`, and `--case` parameters.
- Extracts actual model usage, token counts, and runtime from OpenClaw logs for verification.
- Ensures privacy by using only static prompts and structured log fields—no user data involved.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部