Skip to main content

LLM Citation Verifier

An LLM plugin that verifies academic citations against the Crossref database to catch hallucinated references in AI-generated content.

The Problem

AI research tools sometimes hallucinate citations - generating plausible-looking DOIs for papers that don't exist.

The Solution

This plugin automatically verifies citations in real-time, flagging fake DOIs and validating real papers with full metadata.

Installation

llm install llm-citation-verifier

Usage Examples

Real-Time Citation Verification

# Verify citations as the LLM generates content
llm -T verify_citation "What's new in dye sensitized solar cells? Check all the references." --td

# Single breakthrough with verification
llm -T verify_citation "What's one recent breakthrough in cancer immunotherapy? Cite just one paper and verify it." --td

Quality Control for AI Content

# Review suspicious AI-generated content
llm -T verify_citation "This AI tool cited these papers: 10.1038/nature12373 and 10.1234/fake.doi.2024. Check if they're real." --td

# Batch verification
llm -T verify_citation "Verify these DOIs from an AI summary: 10.1038/nature12373, 10.1126/science.abc123, 10.1234/fake.journal.2024" --td

Research Integrity

# Audit AI research tools
llm -T verify_citation "Tell me about recent AI alignment breakthroughs. Verify any papers you cite." --td

# Fact-check literature reviews
llm -T verify_citation "What are the latest developments in quantum computing? Make sure all citations are real." --td

What It Does

  • ✅ Catches fake citations - Flags DOIs that don't exist in Crossref
  • ✅ Validates real papers - Returns title, authors, journal, year
  • ✅ Real-time verification - Works during content generation
  • ✅ Prevents hallucination - Stops fake references from appearing

Example Output

Tool call: verify_citation({'doi': '10.1038/s41591-023-02452-7'})
{
  "verified": false,
  "doi": "10.1038/s41591-023-02452-7", 
  "error": "DOI not found in Crossref database - likely hallucinated"
}

Tool call: verify_citation({'doi': '10.1016/j.cell.2023.02.029'})
{
  "verified": true,
  "doi": "10.1016/j.cell.2023.02.029",
  "title": "Discovery of phage determinants that confer sensitivity to bacterial immune systems",
  "authors": "Avigail Stokar-Avihail, Taya Fedorenko, Jens Hör, et al.",
  "journal": "Cell",
  "year": "2023"
}

Use Cases

  • Publishing workflows - Verify citations before publication
  • AI content review - Quality control for AI writing assistants
  • Research integrity - Audit AI-generated literature reviews
  • Fact-checking - Validate suspicious citation claims

Development

git clone https://github.com/your-org/llm-citation-verifier
cd llm-citation-verifier
uv sync
uv pip install -e .
uv run pytest

Pro Tips

  • Use --td flag to see verification calls in real-time
  • Chain limits prevent infinite verification loops
  • Works with any topic - just add "verify citations" to your prompt
  • Catches both completely fake DOIs and real DOIs used in wrong context

Metadata

Release files for llm-citation-verifier 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-citation-verifier 0.1.2
File Size Uploaded Provenance
llm_citation_verifier-0.1.2.tar.gz 4.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-citation-verifier 0.1.2
File Interpreter ABI Platform
llm_citation_verifier-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.8 kB

Release files / llm_citation_verifier-0.1.2.tar.gz

Download URL llm_citation_verifier-0.1.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4b5d9bd1c8511976f3a52bdf4276d027ff317438fafdaab87141d55c2ffa06f8
BLAKE2b-256 checksum
How to use checksums
8370349e81b35388547ecb395035133df759487d009e0fee0c2c4677c355d801
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.20

Release files / llm_citation_verifier-0.1.2-py3-none-any.whl

Download URL llm_citation_verifier-0.1.2-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a867b18048e383ea95bb2d9dc530900674a46f9fe95f13758308e189bc7c092e
BLAKE2b-256 checksum
How to use checksums
e01ef3c83c6943407384413b471e1c0fb319706880df5efb7288ebef7b7bc596
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.7.20

Security for llm-citation-verifier 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page