← 返回
数据分析

Model Usage Monitor

监控并统计模型调用次数和成本,计算缓存命中率,支持实时监控与每小时自动告警。
监控统计模型调用次数与成本,计算缓存命中率,支持实时监控及每小时自动告警。
halfmoon82
数据分析 clawhub v1.0.1 2 版本 100000 Key: 无需
★ 1
Stars
📥 678
下载
💾 15
安装
2
版本
#analytics#cost#latest#model#monitor#usage

概述

model-usage-monitor Skill

OpenClaw 模型使用监控与告警技能

⚠️ Security & Permissions Declaration

This skill monitors log files and sends alerts. All operations are read-only except notifications:

OperationPurposeScope
---------------------------
Read semantic router log (semantic_check.log)Parse model usage statisticsRead-only, local file
Read OpenClaw logsDetect usage anomaliesRead-only, local files
Send alert notifications via OpenClaw messagingNotify user of cost spikesLocal OpenClaw API only

What this skill does NOT do:

  • Does NOT modify any configuration or log files
  • Does NOT access external servers or APIs
  • Does NOT access model credentials directly
  • Does NOT require elevated privileges
  • Read-only monitoring — zero side effects on system state

功能

  • 解析语义路由日志,统计模型使用分布
  • 估算各模型调用次数和成本
  • 计算缓存命中率
  • 每小时自动告警检查
  • 支持实时监控模式

安装

# 技能已包含监控脚本和自动配置
# 安装后自动创建每小时检查的 Cron Job

使用

查看监控报告

# 完整报告
python3 ~/.openclaw/workspace/.lib/model_usage_monitor_v2.py

# JSON 格式
python3 ~/.openclaw/workspace/.lib/model_usage_monitor_v2.py --format json

# 仅检查告警
python3 ~/.openclaw/workspace/.lib/model_usage_monitor_v2.py --alert-check

实时监控

python3 ~/.openclaw/workspace/.lib/model_usage_monitor_v2.py --live

告警阈值

类型阈值说明
------------------
Opus 调用频繁>5 次/小时防止意外大量使用昂贵模型
Opus 成本过高>$0.50/小时成本控制
总成本过高>$2.00/小时总体预算控制

文件结构

.skills/model-usage-monitor/
├── SKILL.md              # 本文件
├── monitor.py            # 核心监控脚本
├── setup.py              # 自动安装/配置
└── config.json           # 默认配置

技术细节

  • 全部使用本地 Ollama 模型,零 API 调用
  • 只读日志文件,零侵入
  • 基于 semantic_check.log 和 gateway.log 分析

版本历史

共 2 个版本

  • v1.0.0
    2026-03-30 18:54
  • v1.0.1 当前
    2026-03-18 22:22 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 198 📥 65,057
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,344
security-compliance

Skill Safe Install

halfmoon82
L0 级技能安全安装流程。触发“安装技能/安全安装/审查权限”时,强制执行 Step0-5(查重→检索→审查→沙箱→正式安装→白名单)。
★ 0 📥 1,289