LegalCiteCheck
Checks whether a legal citation exists and whether the cited authority actually supports the proposition it's offered for. It does not check the law itself.
Automated verification only. Not legal advice. Every citation flagged or cleared here must be independently confirmed by a licensed attorney before filing. Jurisdiction: US federal and state case law only.
Status
Core pipeline built and working end-to-end: corpus ingestion, label
synthesis, encoder training, decoder (explanation) training, the
verification pipeline, and the CLI. See
docs/LegalCiteCheck_Architecture_Spec.md for the full build plan and
docs/LegalCiteCheck_Research_Report.md for the rationale.
Trained artifacts:
legalcite-support-base(primary) — DeBERTa-v3-base, 4-way citation support classifier. Held-out macro F1 0.9377, false-negative rate 0.0475. Seemodel_cards/encoder-support-base.mdfor full eval numbers and known limitations, including a documented out-of-distribution generalization gap on synthetically-phrased propositions.legalcite-explain-7b-lora(secondary) — Qwen2.5-7B-Instruct QLoRA adapter that explains (never decides) the encoder's label. Seemodel_cards/explain-7b-lora.md.
Not yet done: publishing the trained weights to Hugging Face Hub (the CLI's model-path default is currently a placeholder), publishing to PyPI, the GitHub Action / LangChain tool / LlamaIndex pack integrations, a demo Space, and the LePhantomCite/CaseHOLD benchmark integrations.
What this is not
Not a legal chatbot, not a research tool, not a source of legal recommendations.
It never suggests an alternative citation and never produces argument text. See
docs/LegalCiteCheck_Architecture_Spec.md section 0 for the full non-goal list.
Setup
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -e ".[dev]"
cp .env.example .env # fill in COURTLISTENER_API_TOKEN and CONTACT_EMAIL
pytest
Some tests (test_citegraph.py, test_pipeline.py, test_train_lora.py)
require the full dependency stack (torch, transformers, eyecite,
etc.) and are skipped in a lightweight dev install.
Usage
legalcite check brief.pdf --json
Exits non-zero if any citation is found to be FABRICATED (CI-gate
friendly). Requires a trained encoder (--model-path, or
LEGALCITE_MODEL_PATH) and, for fast/free existence lookups, a local
citation index (--index-path, or LEGALCITE_INDEX_PATH) — without an
index configured, every citation falls through to the CourtListener API,
which is rate-limited to 125 requests/day.
Repository layout
Tracks docs/LegalCiteCheck_Architecture_Spec.md section 2:
src/legal_citation_check/{ingest,gen,models,verify,train,eval},
configs/, model_cards/, integrations/, tests/.
Metadata
Release files for legal-citation-check 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| legal_citation_check-0.1.0.tar.gz | 55.9 kB | Without provenance | Details for legal_citation_check-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| legal_citation_check-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for legal_citation_check-0.1.0-py3-none-any.whl |
Total release size: 106.5 kB
Release files / legal_citation_check-0.1.0.tar.gz
| Download URL | legal_citation_check-0.1.0.tar.gz |
|---|---|
| Size | 55.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e8c89b88640cff4a3f957bc6974fef120f36c91adaeb30b0d3b531719776fd4f
|
|
BLAKE2b-256 checksum How to use checksums |
bebba2ded170d1d93692021d57d717bbf9ccb4f82647660d69ea84aef1891104
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / legal_citation_check-0.1.0-py3-none-any.whl
| Download URL | legal_citation_check-0.1.0-py3-none-any.whl |
|---|---|
| Size | 50.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3bff35aac62c12ee9da16b646036b040e7e6bb6a6b3484e7b6acb8da132d6ec6
|
|
BLAKE2b-256 checksum How to use checksums |
bfe3c6f8175c7ba473c6513c90dc8aa970ea09837e3154565efcd09aae850572
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for legal-citation-check 0.1.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.
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.