hallucite
Finds fabricated ("hallucinated") references in academic paper PDF files. Each reference is checked
against academic databases (the offline DBLP mirror, then CrossRef, DOI resolution, arXiv,
OpenAlex and Semantic Scholar); references that no database can confirm are escalated to an interactive
LLM triage step, which writes a report for human review.
Three stages: extract and verify use no LLM (verification queries the online databases unless
--offline restricts it to the offline DBLP mirror); triage is the only step that uses an LLM,
which can be a cloud or a local model. See PLAN.md for the design and architecture.
One repo serves as the runnable project (the mise tasks below) and one shared plugin tree for
Claude Code and Codex CLI. The Claude metadata is under .claude-plugin/; the Codex metadata
lives under .codex-plugin/ and .agents/plugins/marketplace.json. The bundled skill in
skills/hallucite/ drives the same scripts for both tools.
Setup (once)
Run from this directory.
| Dependency | Needed for | Install |
|---|
| mise | provisions Python and uv | see mise docs |
pdftotext (poppler) | reference extraction shells out to it | brew install poppler |
sqlite3 | build-dblp checks the database it just built | ships with macOS |
| Playwright + Chromium | fetch-dblp-dump -- --daily only; needs a display | uv pip install playwright && playwright install chromium |
mise install # provision Python + uv (auto-venv)
mise run fetch-dblp-dump # download the newest monthly dblp snapshot (~1 GB)
mise run build-dblp # build ~/hallucite/dblp.db from it (~5 min)
The pipeline itself has no Python dependencies: extraction, parsing, verification and the DBLP
ingest are all standard library, and pdftotext is the only outside program it calls.
The offline DBLP database lives at ~/hallucite/dblp.db, outside this repo, which keeps the
3.8 GB file out of git. Set $HALLUCITE_DBLP to store it somewhere else.
API keys
Put them in .env.local in the repo root, one NAME=value per line. The file is gitignored, and
both mise and skills/hallucite/scripts/run.sh read it from the tree they run in, so the tasks
below and a plugin installed from a local checkout see the same values. A variable already set in
the environment wins.
A plugin installed from the marketplace is a different tree and never sees your clone's
.env.local. Export the values in the shell that starts Claude Code or Codex CLI, or pass
--s2-api-key and --openalex-api-key.
S2_API_KEY=s2k-... # Semantic Scholar: https://www.semanticscholar.org/product/api
OPENALEX_API_KEY=... # OpenAlex, optional: https://openalex.org/
CROSSREF_MAILTO=you@... # CrossRef, optional: a contact address, not a key
Semantic Scholar is not asked without a key. Anonymous callers share a small quota, and a
rate-limited lookup leaves a reference degraded rather than cleanly negative, which moves the
boundary between verified and "needs triage" between otherwise identical runs. OpenAlex is asked
either way and meters the day rather than the second: a hundred searches without a key, a thousand
under a free one, reset at midnight UTC. A paper's residue fits the first; a corpus needs the
second. CrossRef wants no key. A caller that gives a contact address
is routed into a pool allowing three requests at a time where an anonymous one gets a single
request, so CROSSREF_MAILTO buys throughput and nothing else. Keeping it in .env.local is what
keeps an address off every command line and out of the repository.
Run the audit (Stages 1+2, no LLM)
mise run audit -- <pdf-file-or-dir> # required: a PDF file, or a directory of PDF files
mise run audit -- <pdf-file-or-dir> [options] # everything after the target is forwarded as-is