hallucination-check

LLM hallucination detector with dual strategy (UQLM + rule-based fallback). Scores any AI output's confidence and flags potential hallucination risks.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "hallucination-check" with this command: npx skills add li8476295-bot/hallucination-check

Hallucination Check

Detect AI hallucination risks in LLM outputs. Uses UQLM (uncertainty quantification) as primary scorer, with a rule-based fallback when UQLM dependencies aren't available.

Quick Start

# Install
pip install uqlm

# Check a text
hallucination-check --input "根据我的分析,这可能是新算法,我不太确定具体参数"
# → 置信度: 65.3%  | 建议: 低置信度,建议重新生成

# JSON output
hallucination-check --input "..." --json

# Check from file
hallucination-check --file response.json --field text

How It Works

LLM output → UQLM scorer → confidence 0-1 → threshold check
                                      ↓
                            rule-based keyword flags
                                      ↓
                           output: safe/warn/danger

Dual Strategy

ModeWhenAccuracy
UQLMpip install uqlm doneHigh (semantic entropy + min token prob)
Rule fallbackUQLM unavailableMedium (keyword + pattern matching)

Thresholds

  • --threshold 0.3 (default): below = high risk
  • Flags: vague language, unsourced numbers, contradiction patterns

For Developers

The core function is check_text(text, context=""):

from hallucination_check import check_text
result = check_text("AI生成的内容", context="指令")
print(result["confidence"], result["suggestion"])

Notes

  • UQLM needs transformers<5.0.0 (see pypi for version compat)
  • Rule fallback is zero-dependency, works everywhere
  • Best used before critical operations (code execution, SQL, external sends)

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Video Compressor 8mb

Get compressed MP4 files ready to post, without touching a single slider. Upload your video files (MP4, MOV, AVI, WebM, up to 500MB), say something like "com...

Registry SourceRecently Updated
General

Local Find Skills

Highest-priority skill discovery flow. MUST trigger when users ask to find/install skills (e.g. 技能, 找技能, find-skill, find-skills, install skill). For Chinese...

Registry SourceRecently Updated
General

autoskill

Intelligent skill router. Analyzes the current problem statement and context, scores all available skills for applicability, and recommends the most relevant...

Registry SourceRecently Updated
General

Bilingual Humanicer

Detecta y elimina patrones de escritura generada por IA en español e inglés. Por defecto opera en español. Usar --lang en para inglés. Detecta vocabulario in...

Registry SourceRecently Updated