Skip to main content

pycurate

Curation is a compute multiplier: train on the right subset of your data and you reach the same quality with less compute. pycurate does it in one call. Point it at a table of training data. It detects what kind of data it is, scores every row with the signals that matter for that kind, applies the strongest established public filter, and hands you the subset to train on as a view: read straight from the table without copying it, in a globally shuffled order. Seven kinds of data are routed from the schema: web text, noisy labels, image-text pairs, SFT chats, preference pairs, RL prompts and robot episodes. Nothing in a default path calls an LLM. Give it your evaluation and it tunes the recipe; add agent=True and an LLM agent surveys the literature and writes recipes. A tuned recipe is applied only if it beats the default on your held-out metric. This is research code, and APIs may change.

Install

pip install "pycurate[all]"   # torch, transformers, fastText (DCLM), open_clip, optuna (TPE search), anthropic (opt-in agent)
# from a checkout: pip install -e ".[all]"

One verb, three levels

import pycurate as pc

ds = pc.load("data/*.parquet", name="pool", uri="./db")      # parquet, pandas, pyarrow, hf://... into a Lance table

def train_eval(recipe, ids):                                 # your proxy training; higher is better
    model = train(ds.view(ids, columns=["text"]))
    return {"score": evaluate(model), "heldout": evaluate(model)}   # use a held-out set the search never sees
cur = pc.curate(ds)                                          # 1. default: domain recipe, no LLM, no training
cur = pc.curate(ds, eval=train_eval, budget=8)               # 2. tuned: TPE on your eval, guarded by the default
cur = pc.curate(ds, eval=train_eval, budget=8, agent=True)   # 3. agent: literature signals + LLM recipes, guarded
print(cur, cur.report["level"], cur.report["guard"])         # what ran, what was picked and why
loader = cur.to_torch(columns=["text"], batch_size=256)      # zero-copy, globally shuffled batches

pc.diagnose(ds) runs pre-flight checks before you spend compute. Level 2 is TPE by default (no LLM); level 3 is opt-in and the only path that calls an LLM (a logged-in claude CLI, ANTHROPIC_API_KEY, OPENAI_API_KEY or the codex CLI). Without eval=, agent=True only runs signal discovery and applies the default. Every signal is a column, cataloged with its citations and provenance. Tables live on local disk or an object store (S3).

Defaults

kind of data detected from pc.curate(ds) applies vs no curation
web text one long text column DCLM fastText top 10% + SemDeDup 1.8× (GPT-2-small, 4B tokens)
image-text pairs image + caption DFN top 30% + SemDeDup 3.3× (DataComp-medium)
noisy labels a class label column lowest k-NN label disagreement per class 1.0-6.0×, median 2.8× (13 tasks)
SFT chats messages or prompt/response reward-model top 50% + prompt SemDeDup 2.2× (Tulu-3 → Qwen2.5-0.5B)
preference pairs prompt/chosen/rejected top 75% by reward-model margin better held-out z; no curve
RL prompts problem/answer learnability: 0 < pass rate < 1, ranked by p(1-p) ≈1×
robot episodes episode/action columns lowest k-NN task-label disagreement per task n.s. on small sims
object detection / instance masks box-list or COCO annotation column ObjectLab: drop flagged images not benchmarked
semantic segmentation image + label map cleanlab.segmentation score ≥ 0.1 not benchmarked

Each is a compute multiplier against training on the whole pool at matched quality, read off measured curves and never extrapolated (gross; DataComp-medium is the 80.2M-pair pool). An agent-searched recipe scored above DFN top 30% there on all 3 seeds (3.90×, p = 0.051). Net of curation compute, and against the strongest public filter, see results. Fallbacks when a model cannot run are logged in cur.report.

Docs

pip install -e ".[docs]" && mkdocs serve, or read them in docs/: quickstart · which level do I need? · the guard · guides · agent mode · API · results · benchmarks · contributing. Runnable before/after examples on real noisy data (CIFAR-10N, FineWeb, COCO, VOC): docs/examples.md.

Continuing the project? Start at HANDOFF.md (state, results, open items); the full account of what was built and why is docs/DEVELOPMENT_HISTORY.md, and the day-by-day log is bench/PLAN.md.

License

Apache-2.0.

Metadata

Release files for pycurate 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycurate 0.4.0
File Size Uploaded Provenance Actions
pycurate-0.4.0.tar.gz 281.3 kB Without provenance Details for pycurate-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pycurate 0.4.0
File Interpreter ABI Platform Actions
pycurate-0.4.0-py3-none-any.whl Python 3 none any Details for pycurate-0.4.0-py3-none-any.whl

Total release size: 519.8 kB

Release files / pycurate-0.4.0.tar.gz

Download URL pycurate-0.4.0.tar.gz
Size 281.3 kB
Tags Source
SHA-256 checksum
How to use checksums
999a96c22dad51960215183a557789aa4e6be2b5b12a6a50191f9d2ea81394a6
BLAKE2b-256 checksum
How to use checksums
b899ebe8ad4add8029265537e76b9b03b443917f0756401ca062f21b54c1a437
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Release files / pycurate-0.4.0-py3-none-any.whl

Download URL pycurate-0.4.0-py3-none-any.whl
Size 238.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74a533de6149d861d95bff482f09dc927b8b9c4748088ac62755a6330c69d493
BLAKE2b-256 checksum
How to use checksums
c6e7f88d31bebea3e50653b8c8edac314cafa167468a6aa04d30aa20edbefb82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for pycurate 0.4.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.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page