check-hallucinations
A command-line tool to detect hallucinated references in BibTeX files before submitting a paper to arXiv.
It checks each reference against Semantic Scholar and flags any title that cannot be found.
Installation
pip install check-hallucinations
Usage
check-hallucinations references.bib
Entries that cannot be found on Semantic Scholar are printed in red as potential hallucinations.
How it works
For each entry in the BibTeX file, the tool queries Semantic Scholar by title. If no match is found, the entry is flagged as a likely hallucination (a reference invented by an LLM or a typo). misc entries without an eprint field are skipped unless they lack a howpublished URL.
API key
By default the tool uses the public Semantic Scholar API (rate-limited). For higher throughput, set the SEMANTICSCHOLAR_API_KEY environment variable:
export SEMANTICSCHOLAR_API_KEY=your-key-here
check-hallucinations references.bib
Development
uv venv && uv pip install -e '.[dev]'
.venv/bin/pytest && .venv/bin/ruff check . && .venv/bin/mypy check_hallucinations tests
License
MIT
Metadata
Release files for check-hallucinations 0.20.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| check_hallucinations-0.20.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / check_hallucinations-0.20.0-py3-none-any.whl
| Download URL | check_hallucinations-0.20.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6b66173800660a3d1395dc8e2bead27c1a20dee992ddd09f304efd476fd3e77c
|
|
BLAKE2b-256 checksum How to use checksums |
221c61099185bb0823e4c13b9db898b920c5eac4283a154a9fcca9e5b17404a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logSecurity for check-hallucinations 0.20.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 1 file in this release has been uploaded with provenance metadata.
Attestation for check_hallucinations-0.20.0-py3-none-any.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.