PrivateLabBench
Evaluate scientific models on private data, from your terminal.
Quickstart · Documentation · v0.1.5 release · Contributing
PrivateLabBench is a local evaluation framework for scientific machine learning. Bring model predictions and a validation table to compare candidates, estimate uncertainty, and find failures across sites, assays, or other groups. Keep the underlying data in your environment and share approved aggregate receipts with collaborators.
Evaluation runs without an account, hosted service, or data upload. A receipt records the evaluation protocol, selected results, and the evidence available to verify them.
Installation
The current release is v0.1.5, available on PyPI and GitHub Releases. The core has clean-install checks on Linux for Python 3.10–3.14 and on Windows/macOS for 3.12 and 3.14. See the tested-support matrix for exact scope and optional-integration limits.
This release includes the v0.1.4 correctness fixes for multiclass scoring, membership-risk diagnostics, privacy-policy validation, and input-safe report writing. Rerun affected evaluations from the original predictions when upgrading from earlier releases.
Create a virtual environment:
python -m venv .venv
Activate it with source .venv/bin/activate on macOS/Linux, or .venv\Scripts\Activate.ps1 in Windows PowerShell. Then install:
python -m pip install private-lab-bench==0.1.5
plb --help
The longer command name, privatelabbench, works too. See the installation guide for optional dependencies and source installs, or open the quickstart in Colab.
1. Try a scientific decision in five minutes
The candidate improves overall. Does it still fail on a required instrument? Run this fully synthetic calibration example: 160 simulated specimens, two instruments, a baseline, and acceptance thresholds fixed before evaluation. No training or model download is needed.
In a fresh working directory, download the small example and run it:
python -c "from urllib.request import urlretrieve; urlretrieve('https://raw.githubusercontent.com/dipeshbabu/private-lab-bench/main/examples/first_run.py', 'first_run.py')"
python first_run.py --output-dir plb-demo
plb verify plb-demo/evaluation/evaluation_receipt.json
These commands work in PowerShell, bash, and zsh with the installed v0.1.5 package. The observed result, rounded for display:
Candidate MAE 0.272; baseline MAE 0.497 (lower is better).
Paired improvement 0.225; 95% CI [0.178, 0.267]; required improvement 0.05.
Instrument B MAE 0.797 exceeds the prespecified maximum 0.50.
Decision: REJECT for instrument B despite the overall improvement; quality gate FAIL.
The interval and subgroup checks are computed by the normal evaluation APIs.
Inspect plb-demo/decision.json, plb-demo/paired.md, and the local evaluation
receipt. This constructed example illustrates a decision; it supplies no evidence
about a real biological task or outside-researcher adoption. See the
walkthrough for
assumptions, optional synthetic export, troubleshooting, and the
Colab notebook.
2. Evaluate your own predictions
Export a local CSV with stable sample_id, observed target, model prediction,
and optional group columns such as instrument. Then run:
plb evaluate YOUR.csv --task-type regression --slice instrument --output-dir YOUR_RESULTS
plb verify YOUR_RESULTS/evaluation_receipt.json
This keeps results local. The default confidence interval needs at least 20 observations; each evaluated group needs at least five. Repeated patients, compounds, or batches need a declared sampling design. Choose quality thresholds for your scientific use case before looking at results.
Binary classification and multiclass probability tables are also supported. Class order and probability meaning matter: use explicit labels when needed. The prediction-table reference covers column bindings, missing values, and classification examples.
Save the settings for another run:
plb init predictions.csv --task-type regression --slice site --out evaluation.yaml
plb validate-config evaluation.yaml
plb run evaluation.yaml
Use a versioned evaluation protocol when collaborators need the same metrics, sampling rules, and decision criteria. Receipts bind its identity and digest.
Compare models
Provide one prediction table per model, with identical sample IDs and targets:
plb compare model-a.csv model-b.csv --target target --task-type regression --metric rmse --practical-threshold 0.01
The comparison reports the paired improvement, bootstrap interval, and whether the evidence supports your practical threshold. Subgroup comparisons help locate the difference. See the paired-comparison guide for noninferiority, sampling assumptions, and interval interpretation.
3. Share approved evidence
| Artifact | Purpose |
|---|---|
<run>_receipt.json |
Local evidence, including paths, configuration, and exact results |
<run>_receipt.shareable.json |
Approved aggregate evidence for exchange |
<run>_receipt.md |
Human-readable receipt summary |
A reviewed release policy controls export. When export is blocked, the run keeps its local results and release audit and removes a previous shareable receipt. Bundled packs use policies for synthetic examples; private-data evaluations need their own review.
plb release-check local_receipt.json --policy release.yaml
plb verify receipt.shareable.json --trust-store trusted-labs.yaml --require-trusted-signer --json
Verification distinguishes artifact integrity from an authenticated signer statement. Execution and scientific validity require separate evidence. The receipt trust guide covers signing and pinned keys.
Keeping rows local limits data movement, but aggregates can still disclose sensitive information. Empirical audits, disclosure policies, and heuristic metric perturbation address different questions. Metric perturbation, including the deprecated dp alias, provides no formal differential privacy guarantee. Read the privacy guide before sharing private results.
Scientific workflows
| Evaluation needs | Guide |
|---|---|
| Check supported split, entity, or time-overlap rules | Evaluation-design audits |
| Inspect cohort degradation and changing groups | Reference/current diagnostics |
| Apply explicit acceptance thresholds | Quality gates |
| Describe an evaluated model and compare evidence across labs | External validation and receipt aggregation |
| Follow the same model over time | Longitudinal evaluation |
| Evaluate submissions against owner-held labels | Hidden benchmarks |
| Generate predictions from an approved local numeric model | Trusted local scoring |
| Isolate an untrusted Python model on a Linux/gVisor host | Sandboxed execution |
| Release a bounded mean with an explicit privacy budget | Optional OpenDP backend |
The benchmark integrations reproduce pinned upstream scoring rules:
| Ecosystem | Tested coverage |
|---|---|
| TDC ADMET | Six tasks covering permeability, transport, mutagenicity, cardiotoxicity, lipophilicity, and solubility; official splits and MAE/AUROC checks |
| Matbench | Five composition/structure tasks with official folds, target units, and aggregation |
| ProteinGym | Ten pinned substitution assays with assay Spearman and protein/function aggregation |
Sandbox execution requires a reviewed local runtime image and gVisor; it rejects missing isolation and keeps predictions private. The optional OpenDP backend uses public bounds and fixed sample size, checks upstream privacy maps, and requires a shared budget. Neither extension automatically authorizes disclosure of model outputs or existing exact evaluation reports.
The Caco2 case study follows a model-selection decision through uncertainty, critical-group checks, approved export, and signature verification. It distinguishes the real public control from a synthetic measurement-shift proxy. Independent researcher onboarding trials remain pending.
Developing and contributing
git clone https://github.com/dipeshbabu/private-lab-bench.git
cd private-lab-bench
python -m pip install -e '.[dev,docs]' build twine
python -m pre_commit install
python -m pre_commit run --all-files
python -m pytest -q
python -m mkdocs build --strict
CI checks supported Python versions, package builds, installation outside the checkout, documentation, Docker, scientific adapters, and repository history. Read CONTRIBUTING.md for extension boundaries and validation requirements.
Report bugs or propose tasks through GitHub Issues. Use the process in SECURITY.md for sensitive vulnerabilities. Contributions follow the Code of Conduct and governance guide.
License and citation
PrivateLabBench uses the MIT license. Cite the release or commit you used with CITATION.cff.
Metadata
Release files for private-lab-bench 0.1.5
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 |
|---|---|---|---|---|
| private_lab_bench-0.1.5.tar.gz | 300.2 kB | With provenance | Details for private_lab_bench-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| private_lab_bench-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for private_lab_bench-0.1.5-py3-none-any.whl |
Total release size: 571.5 kB
Release files / private_lab_bench-0.1.5.tar.gz
| Download URL | private_lab_bench-0.1.5.tar.gz |
|---|---|
| Size | 300.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f30f86d08dbe631024da74b1d5fa89ef93a80cf1be03e5096a69e506ba056fe9
|
|
BLAKE2b-256 checksum How to use checksums |
15c5cb682a532121627e097b8ac4c3617a34d98e9a576e7739481104e2e06e12
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logRelease files / private_lab_bench-0.1.5-py3-none-any.whl
| Download URL | private_lab_bench-0.1.5-py3-none-any.whl |
|---|---|
| Size | 271.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc4881fbc78ef84eabe812c672bda7ce11ba3a34133ef9eb968ae3c6e4e6980b
|
|
BLAKE2b-256 checksum How to use checksums |
68a27336fb262dd678719e85e2041b8c1d3a10a75c132b0ed95549630443a70c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logSecurity for private-lab-bench 0.1.5
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
Both files in this release have been uploaded with provenance metadata.
Attestation for private_lab_bench-0.1.5.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 Nov 5, 2026.
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.