Hallucination Check
/install 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
| Mode | When | Accuracy |
|---|---|---|
| UQLM | pip install uqlm done |
High (semantic entropy + min token prob) |
| Rule fallback | UQLM unavailable | Medium (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\x3C5.0.0(see pypi for version compat) - Rule fallback is zero-dependency, works everywhere
- Best used before critical operations (code execution, SQL, external sends)
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install hallucination-check - After installation, invoke the skill by name or use
/hallucination-check - Provide required inputs per the skill's parameter spec and get structured output
What is Hallucination Check?
LLM hallucination detector with dual strategy (UQLM + rule-based fallback). Scores any AI output's confidence and flags potential hallucination risks. It is an AI Agent Skill for Claude Code / OpenClaw, with 50 downloads so far.
How do I install Hallucination Check?
Run "/install hallucination-check" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Hallucination Check free?
Yes, Hallucination Check is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Hallucination Check support?
Hallucination Check is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Hallucination Check?
It is built and maintained by li8476295-bot (@li8476295-bot); the current version is v1.0.0.