Overview
pandora_llm is a red-teaming library against Large Language Models (LLMs) that assesses their vulnerability to train data leakage.
It provides a unified PyTorch API for evaluating membership inference attacks (MIAs).
Please refer to the documentation for the API reference as well as tutorials on how to use this codebase.
pandora_llm abides by the following core principles:
- Open Access — Ensuring that these tools are open-source for all.
- Reproducible — Committing to providing all necessary code details to ensure replicability.
- Self-Contained — Designing attacks that are self-contained, making it transparent to understand the workings of the method without having to peer through the entire codebase or unnecessary levels of abstraction, and making it easy to contribute new code.
- Model-Agnostic — Supporting any HuggingFace model and dataset, making it easy to apply to any situation.
- Usability — Prioritizing easy-to-use starter scripts and comprehensive documentation so anyone can effectively use
pandora_llmregardless of prior background.
We hope that our package serves to guide LLM providers to safety-check their models before release, and to empower the public to hold them accountable to their use of data.
Installation
From pip:
pip install pandora-llm
From source:
git clone https://github.com/safr-ai-lab/pandora-llm.git
pip install -e .
Quickstart
We maintain a collection of starter scripts in our codebase under experiments/. If you are creating a new attack, we recommend making a copy of a starter script for a solid template.
python experiments/mia/run_loss.py --model_name EleutherAI/pythia-70m-deduped --model_revision step98000 --num_samples 2000 --pack --seed 229
bash scripts/run_mia_baselines_olmo.sh
bash scripts/run_mia_baselines_pile.sh
Contributing
We welcome contributions! Please submit pull requests in our GitHub.
Authors
This library was created by Jeffrey G. Wang, Jason Wang, Marvin Li, and Seth Neel.
Metadata
Release files for pandora-llm 0.0.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 |
|---|---|---|---|---|
| pandora_llm-0.0.0.tar.gz | 64.2 kB | With provenance | Details for pandora_llm-0.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pandora_llm-0.0.0-py3-none-any.whl | Python 3 | none | any | Details for pandora_llm-0.0.0-py3-none-any.whl |
Total release size: 146.7 kB
Release files / pandora_llm-0.0.0.tar.gz
| Download URL | pandora_llm-0.0.0.tar.gz |
|---|---|
| Size | 64.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27678fb3e3bde6a39bba6be40b9c2993e598f1287ce4332f78765b87c949fe3b
|
|
BLAKE2b-256 checksum How to use checksums |
6070fe436d76fca3712ed36b114dcdb530285e4d60d02859b17188dc81743bb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 1, 2025.
Transparency logRelease files / pandora_llm-0.0.0-py3-none-any.whl
| Download URL | pandora_llm-0.0.0-py3-none-any.whl |
|---|---|
| Size | 82.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e0230d498021528f8599dc23b949926c8a633eddee96d12152d0680e14f14810
|
|
BLAKE2b-256 checksum How to use checksums |
ae42d7972d9fd7327f39b9fa4bcd3c3d606bee36ce8df8c441468610aac83c02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 1, 2025.
Transparency logSecurity for pandora-llm 0.0.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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for pandora_llm-0.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 1, 2025.
Transparency logA 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.