Skip to main content

CLI for haluguard — verify LLM output for hallucinations from your terminal, CI/CD, or auto-verify every Claude Code response via a Stop hook.

Project description

haluguard CLI

PyPI version License

Verify LLM output for hallucinations directly from your terminal or CI/CD pipeline. Plugs into the haluguard hosted API.

Install

pip install haluguard

Zero runtime dependencies — pure stdlib, installs in seconds.

Quick start

# 1. Save your API token (get one at haluguard.com)
haluguard auth login

# 2. Verify a file
haluguard check report.md

# 3. Or pipe input
echo "Microsoft was founded in 1981 by Bill Gates." | haluguard check

# JSON output for scripts / CI
haluguard check report.md --json | jq .

# Exit non-zero only above a confidence threshold (useful in CI)
haluguard check report.md --threshold 0.7

Output

Human-readable by default:

✗ HALLUCINATIONS    severity=clear  score=0.95  claims=1/2  latency=4ms
verdict source: data_contradicted

  [CONTRADICTED] high · wikidata
    claim:    Microsoft was founded in 1981
    evidence: Wikidata confirms Microsoft was founded in 1975
    source:   https://www.wikidata.org/wiki/Q2283
    fix:      1975

--json returns the raw API response (verdict, severity_tier, score, findings, etc).

Exit codes

Code Meaning
0 Clean / no hallucinations above threshold
1 Hallucinations detected
2 Transient API error (rate-limited, 5xx, network)
3 Auth error (no token / invalid token)
4 Bad input / usage

CI/CD example — GitHub Actions

- name: Verify generated docs
  env:
    HALUGUARD_TOKEN: ${{ secrets.HALUGUARD_TOKEN }}
  run: |
    pip install haluguard
    haluguard check generated/release-notes.md --threshold 0.7

For a dedicated GitHub Action with richer output, see haluguard-action.

Env vars

Var Default Purpose
HALUGUARD_TOKEN (required) Bearer token. Used in CI. Overrides ~/.haluguard/config.json.
HALUGUARD_API_URL https://api.haluguard.com Override for self-host / dev.
NO_COLOR unset Disable ANSI colors.

License

MIT (the CLI itself). The hosted API behind it is a paid subscription service — see haluguard.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

haluguard-0.4.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

haluguard-0.4.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file haluguard-0.4.0.tar.gz.

File metadata

  • Download URL: haluguard-0.4.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for haluguard-0.4.0.tar.gz
Algorithm Hash digest
SHA256 96ff26be12e1a09e114a3a7416f97e6fa8ded9f562dc3a0260ba7488b79a83d4
MD5 754f39643a85cbb47eea09ce7ecdfb5f
BLAKE2b-256 1ba8867571587c0c4065e4464bc1a98449029b837b2a14d78b5a6e7b13b6c870

See more details on using hashes here.

File details

Details for the file haluguard-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: haluguard-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for haluguard-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fabb0de6ddf8ab703149a146e7b2bd3b099dd872d23e2f2b98b738aa98b6c0ac
MD5 5604c1ea7a2176af8361039f44c2e036
BLAKE2b-256 f2230eb268e02081fa48bb65b50abb0abebb5bfe75c0e4f08a31279bbc0fd08c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page