闲社服务运行正常AI智能体自动化平台
l

LLM回归监控

技能标识:llm-regression-monitor

Use this skill when the user wants to monitor LLM behavior over time and get alerted when outputs change unexpectedly. Triggers on requests like "set up LLM regression monitoring", "alert me when my prompts start behaving differently", "watch my LLM for regressions", "run behavioral tests on my AI outputs on a schedule", or "detect when my model starts drifting". Handles first-time setup, baseline capture, scheduled monitoring, and alert configuration.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.2
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

LLM回归监控

LLM 回归监控器

概述

针对LLM应用的自动化行为回归监控。捕获基线输出,按计划检测漂移,并在出现回归时立即通过WhatsApp或Slack发送警报。



工作流决策树

用户请求
├── 设置监控 / 首次使用 → 完整设置(步骤1-5)
├── 立即运行监控 → 仅步骤4
├── 我修改了提示词/模型 → 步骤3b(更新基线)
└── 配置警报 → 步骤5



步骤1 — 安装

bash
pip install llm-behave[semantic] pyyaml requests



步骤2 — 创建 test_suite.yaml

在项目根目录创建。最小示例:

yaml
tests:
- name: support_response
prompt: 客户说他们没有收到订单。你如何回应?
provider: openai # openai | anthropic | ollama | custom
model: gpt-4o-mini
assertions:
- type: tone
expected: 富有同理心
drift:
enabled: true
threshold: 0.80

为所选提供商设置API密钥:
bash
export OPENAIAPIKEY=sk-...
export ANTHROPICAPIKEY=sk-ant-... # 如果使用anthropic

ollama无需密钥

阅读 references/test-suite-format.md 获取完整字段说明。
阅读 references/providers.md 获取环境变量和Ollama设置。



步骤3 — 捕获基线

bash
python scripts/capture_baseline.py

将基准输出保存到 .llmbehavebaselines/。在开始监控前运行一次。

3b — 有意修改提示词/模型后更新

bash

重置单个测试


python scripts/capture_baseline.py --update-baseline <测试名称>

重置所有

python scripts/capture_baseline.py --force

步骤4 — 运行监控器

bash
python scripts/run_monitor.py

写入 monitor_report.json。全部通过时退出码为0,任何失败时退出码为1(兼容CI)。



步骤5 — 配置警报

bash

WhatsApp(需要安装并登录wacli)


export ALERTWHATSAPPTO=+1234567890

Slack

export ALERTSLACKWEBHOOK=https://hooks.slack.com/services/...

添加到项目根目录的 .env 文件 — 脚本会自动加载。通过以下命令发送:
bash
python scripts/send_alert.py

运行正常时保持静默。所有警报均记录到 monitor_alerts.log。



步骤6 — 使用OpenClaw Cron调度

与用户确认调度计划(默认:每天上午9点),然后添加:

  • - 调度: 0 9 *
  • 命令: python runmonitor.py && true || python sendalert.py
  • 目录: 项目根目录(test_suite.yaml所在位置)

|| sendalert.py 仅在 runmonitor.py 退出码为1(发现失败)时触发。



常见错误


错误修复方法
llm-behave is not installedpip install llm-behave[semantic]
OPENAIAPIKEY is not set
导出密钥或添加到 .env |
| No baseline found | 先运行步骤3 |
| test_suite.yaml not found | 在项目根目录创建 |
| 报告中出现LLM调用错误 | API问题 — 非回归问题 |

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 llm-regression-monitor-1775978882 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 llm-regression-monitor-1775978882 技能

通过命令行安装

skillhub install llm-regression-monitor-1775978882

下载

⬇ 下载 llm-regression-monitor v1.0.2(免费)

文件大小: 14.19 KB | 发布时间: 2026-4-13 10:53

v1.0.2 最新 2026-4-13 10:53
All provider keys are now optional — only set the key for the provider you actually use.
返回顶部