AGENT SKILL

llm-judge-scorer

LLM-as-Judge trace quality scorer. Evaluates Hermes conversation traces in Langfuse using a local Ollama model and posts quality scores back to Langfuse. Cron schedule: weekdays 12pm/8pm, weekends 10pm KST.

License 许可
MIT
最近更新
2026-11-14
Stars
★ 4
Forks
1

01 前言 Front Matter

name
llm-judge-scorer
author
Steadfaste Fleet
license
MIT
version
1.0.0
category
devops
metadata
{ "hermes": { "tags": [ "langfuse", "scoring", "quality", "eval", "ollama", "cron" ] } }
description
LLM-as-Judge trace quality scorer. Evaluates Hermes conversation traces in Langfuse using a local Ollama model and posts quality scores back to Langfuse. Cron schedule: weekdays 12pm/8pm, weekends 10pm KST.

03 SKILL.md 正文

LLM Judge Scorer

A no_agent cron script that evaluates Hermes conversation traces in Langfuse using qwen2.5:3b as the judge model. Scores are posted back to Langfuse under helpfulness, clarity, depth, and overall.

How It Works

Langfuse (traces)
    │
    ▼
llm-judge-scorer.py (no_agent cron)
    │
    ├── Fetches unscored traces from past 14 days
    ├── Sends input/output to Ollama (qwen2.5:3b)
    ├── Parses JSON response: helpfulness, clarity, depth, overall
    └── Posts scores back to Langfuse API

Prerequisites

Dependency Check Fix
Langfuse running curl -s http://localhost:3000/api/public/health docker compose -f ~/langfuse/docker-compose.yml up -d
Ollama running curl -s http://localhost:11434/api/tags brew services start ollama
Judge model ollama list | grep qwen2.5:3b ollama pull qwen2.5:3b
Env file ~/steadfaste-fleet/.env (symlink to ~/langfuse/.env) or --env-path ln -sf ~/langfuse/.env ~/steadfaste-fleet/.env

Invocation

# Default (finds unscored traces, evaluates, posts scores)
python3 ~/.hermes/scripts/llm-judge-scorer.py

# Dry run (no scores posted)
python3 ~/.hermes/scripts/llm-judge-scorer.py --dry-run

# Specific trace
python3 ~/.hermes/scripts/llm-judge-scorer.py --trace-id=<id>

# Quiet mode (silent when no traces to score)
python3 ~/.hermes/scripts/llm-judge-scorer.py --quiet

# Custom env path
python3 ~/.hermes/scripts/llm-judge-scorer.py --env-path ~/langfuse/.env

Score Interpretation

Score Name Meaning
1-5 helpfulness How well the response addresses the user's request
1-5 clarity Structure, formatting, readability
1-5 depth Substance beyond surface-level
1-10 overall Holistic quality assessment

What Agents Should Do With Low Scores

When overall < 5 on your traces:

  • Be more thorough — include concrete code, verify with actual execution, don't summarize plans
  • Improve readability — use proper formatting, concise explanations
  • Check completeness — did you answer the full question or just the first part?
  • Verify before claiming — run tools, don't fabricate results

Troubleshooting

Symptom Fix
FileNotFoundError: .env Create symlink: ln -sf ~/langfuse/.env ~/steadfaste-fleet/.env
HTTP 401 from Langfuse Check LANGFUSE_INIT_PROJECT_PUBLIC_KEY and SECRET_KEY in .env
ollama: connection refused brew services start ollama or ollama serve
Model not found ollama pull qwen2.5:3b
Zero traces scored Normal if all traces already scored. Check Langfuse has traces.
False low-score alerts on no-op cron turns Delivery-suppressed turns ending in the literal [SILENT] token are no-op ticks, not quality regressions — the scorer skips them (guard after the no-content skip, ~line 419/427). If a low-score alert fires on a [SILENT] trace, update the deployed script from repo source; do not chase the alert. (Learned 2026-09-18.)

Deployment

Script lives at ops/scripts/manage/llm-judge-scorer.py in the fleet repo. Deployed to ~/.hermes/scripts/llm-judge-scorer.py via fleet-update.

04 同仓库更多 Skills