LLM 评估器:自动化 AI 质量评分 - Openclaw Skills

作者:互联网

2026-03-30

AI教程

什么是 LLM 评估器?

LLM 评估器是为构建智能体工作流的开发者设计的尖端质量保证工具。通过利用 Langfuse 和 LLM-as-a-Judge 方法论,它根据相关性和有用性等关键指标为 AI 输出提供客观评分。该技能是 Openclaw Skills 生态系统的重要组成部分,使团队能够通过自动化可观测性和强大的评分机制坚控性能并保持 AI 智能体的高标准。

下载入口:https://github.com/openclaw/skills/tree/main/skills/aiwithabidi/llm-evaluator-pro

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install llm-evaluator-pro

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 llm-evaluator-pro。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

LLM 评估器 应用场景

  • 量化 AI 搜索结果或对话响应的相关性和准确性。
  • 在生成内容到达终端用户之前检测其中的幻觉。
  • 对历史追踪记录执行批量评分回填,以便进行历史性能分析。
  • 将自动化质量保证集成到智能体开发生命周期中。
LLM 评估器 工作原理
  1. 该技能与 Langfuse 接口,检索特定的追踪轨迹或未评分的日志批次。
  2. 它通过 OpenRouter 利用高性能裁判模型来分析提示词-响应对。
  3. 评估器应用预定义逻辑从四个维度对追踪轨迹进行评分:相关性、准确性、幻觉和有用性。
  4. 结果被推回 Langfuse 仪表板,提供可视化反馈和分析数据。

LLM 评估器 配置指南

要在 Openclaw Skills 环境中使用此技能,请确保已配置环境变量并安装了 Python 3。

# 设置必要的 API 密钥
export OPENROUTER_API_KEY="your_key"
export LANGFUSE_PUBLIC_KEY="your_key"
export LANGFUSE_SECRET_KEY="your_key"

# 运行测试以验证配置
python3 scripts/evaluator.py test

LLM 评估器 数据架构与分类体系

评估器根据标准可观测性指标组织数据。评分按 0 到 1 的等级返回。

评估器 衡量指标 范围
relevance 响应与查询的相关性 0–1
accuracy 事实准确性 0–1
hallucination 虚假信息检测 0–1
helpfulness 整体有用性 0–1
name: llm-evaluator
version: 1.0.0
description: >
  LLM-as-a-Judge evaluator via Langfuse. Scores traces on relevance, accuracy,
  hallucination, and helpfulness using GPT-5-nano as judge. Supports single trace
  scoring, batch backfill, and test mode. Integrates with Langfuse dashboard for
  observability. Triggers: evaluate trace, score quality, check accuracy, backfill
  scores, test evaluator, LLM judge.
license: MIT
compatibility:
  openclaw: ">=0.10"
metadata:
  openclaw:
    requires:
      bins: ["python3"]
      env: ["OPENROUTER_API_KEY", "LANGFUSE_PUBLIC_KEY", "LANGFUSE_SECRET_KEY"]

LLM Evaluator ??

LLM-as-a-Judge evaluation system powered by Langfuse. Uses GPT-5-nano to score AI outputs.

When to Use

  • Evaluating quality of search results or AI responses
  • Scoring traces for relevance, accuracy, hallucination detection
  • Batch scoring recent unscored traces
  • Quality assurance on agent outputs

Usage

# Test with sample cases
python3 {baseDir}/scripts/evaluator.py test

# Score a specific Langfuse trace
python3 {baseDir}/scripts/evaluator.py score 

# Score with specific evaluator only
python3 {baseDir}/scripts/evaluator.py score  --evaluators relevance

# Backfill scores on recent unscored traces
python3 {baseDir}/scripts/evaluator.py backfill --limit 20

Evaluators

Evaluator Measures Scale
relevance Response relevance to query 0–1
accuracy Factual correctness 0–1
hallucination Made-up information detection 0–1
helpfulness Overall usefulness 0–1

Credits

Built by M. Abidi | agxntsix.ai YouTube | GitHub Part of the AgxntSix Skill Suite for OpenClaw agents.

?? Need help setting up OpenClaw for your business? Book a free consultation