citeformer

citeformer — a bulletproof way to generate verifiably cited text from language models.

The public API surface:

  • Citeformer — the orchestrator. Wrap a Backend, call generate().

  • Types: Source, Citation, Reference, GenerationResult, Policy.

  • Verification: VerificationReport, CitationSupport.

  • Backends: Backend (ABC) and MockBackend live here. Concrete backends live on submodules that you import only if you install their extras: citeformer.backends.hf.HFBackend, citeformer.backends.llamacpp.LlamaCppBackend, citeformer.backends.vllm.VLLMBackend.

  • Prompt helper: build_rag_prompt — assembles the canonical RAG prompt.

  • Metadata helpers: fetch_crossref, fetch_arxiv, extract_pdf, extract_url.

See https://citeformer.readthedocs.io for documentation.

Subpackages

Submodules