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/.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file legal_citation_check-0.1.0.tar.gz.
File metadata
- Download URL: legal_citation_check-0.1.0.tar.gz
- Upload date:
- Size: 55.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8c89b88640cff4a3f957bc6974fef120f36c91adaeb30b0d3b531719776fd4f
|
|
| MD5 |
4f65f0fc8b1dd8525182f0dea990f78b
|
|
| BLAKE2b-256 |
bebba2ded170d1d93692021d57d717bbf9ccb4f82647660d69ea84aef1891104
|
File details
Details for the file legal_citation_check-0.1.0-py3-none-any.whl.
File metadata
- Download URL: legal_citation_check-0.1.0-py3-none-any.whl
- Upload date:
- Size: 50.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bff35aac62c12ee9da16b646036b040e7e6bb6a6b3484e7b6acb8da132d6ec6
|
|
| MD5 |
d0071b2439876eb375b7aea439c6b1ce
|
|
| BLAKE2b-256 |
bfe3c6f8175c7ba473c6513c90dc8aa970ea09837e3154565efcd09aae850572
|