cairn-pack-dataset-prep
Prepare a dataset once for cairn: pin the source, audit
it, split it by group and register frozen train, val and test versions with their roles. A
fine-tune then reads the same three versions for its baseline, its validation and its one-time
test comparison, and cairn's holdout door refuses a training run that would meet the test set.
The fine-tune pack (cairn-pack-finetune) accepts these versions only.
A domain pack: YAML and a sample, no code. Every stage comes from
cairn-operator-dataset-checks.
The prepare pipeline
source-ok ⏸ → prepare (one data leg) → format → data-ok
-
source-ok: a person confirms the source, its revision and the name the versions are registered under, before anything is written. -
prepare: the stages inflows/prepare.yaml:ingest.normalize: reads the source; a Hub dataset is loaded atrevision.dedup.exact: drops exact duplicates.fields.derive: labels for a dataset that has none, for example a topic or a template family.dedup.near: drops near duplicates, on the same text and 5-word shingles the holdout door compares, so no near-duplicate pair can end up split between train and test. Needs the[all]extra; skipped, with a note, without it.profile.tokens: prompt+response lengths againstmax_seq_len.profile.fields: topic counts, and group sizes.export.jsonl: the cleaned corpus.split: group-aware, and registers<register>-train,-valand-testwith roles training, validation and test.dataset.manifest: source, revision and commit, hashes, rows, fields, licence and citation, and the fetch time.
Each registered version gets its intake verdict.
-
format: checks every example's structure against TRL and Unsloth. -
data-ok: stops the pipeline when a version came back blocked or invalid, or an example is malformed.
The record carries stats, hashes, counts and version ids, never row content. A template family is prompt text, so it is reported by group size only.
Run it
pip install cairn-pack-dataset-prep # the pipeline; near dedup and tokenizers: [all]
cairn remote presets dataset-prep/prepare # the shipped presets
cairn remote launch dataset-prep/prepare --preset ifc-bim-alpaca --watch
cairn remote advance <pipeline-id> source-ok # a person confirms the source
cairn remote findings <pipeline-id> # rows in, duplicates dropped, lengths, the three versions
The package publishes to PyPI soon (cairn-extensions#10). Until then, install it from a checkout
of this repository, with the operator pack and contract wheels it needs:
pip install ./packages/cairn-contracts-dataset ./packages/cairn-contracts-dataset-stages './packages/cairn-operator-dataset-checks[minhash,tokenizers]' ./packs/cairn-pack-dataset-prep.
Runs need a durable store (CAIRN_STORAGE) to survive a restart, as every pipeline does; the
cairn-pack-finetune README's "Run it" covers the control plane end to end.
Any dataset: -i path=<hub id | file | s3://…> -i register=<name>, plus -i revision=<commit>
for a Hub source. Add group_by, derive, topic_fields and group_fields when the rows carry,
or can be given, a group.
The versions live in S3. Registering them needs the s3 artifact store: -i store=s3, or a
profile with artifact_store = "s3" (as cairn-pack-finetune's finetune-ssh has), plus
CAIRN_ARTIFACT_S3_BUCKET (CAIRN_ARTIFACT_S3_PREFIX optional, CAIRN_ARTIFACT_S3_ENDPOINT for
MinIO or another S3-compatible store). With the local store the split refuses to register:
its files sit in the leg's temporary workdir, which a reboot deletes and another machine cannot
read.
Presets
| Preset | What it prepares |
|---|---|
ifc-bim-alpaca |
Dietmar2020/ifc-bim-high-quality-alpaca at a pinned commit, 90/5/5. topic is the first building element the answer defines and family is the request with numbers and names replaced; the split groups by family. Lengths use the Qwen/Qwen3-4B-Base tokenizer against 2048. |
The topic is matched with a regular expression, not parsed. An IFC parse belongs to the IFC validator (cairn-extensions#12).
Support
| Path | Status | Evidence | Proven on cairndev |
|---|---|---|---|
prepare on the builtin data engine, s3 store |
EXPERIMENTAL | tests/test_prepare.py: the pack's flow, the core runner and registration in process, on the 200-row sample and a mocked S3 bucket |
0.2.1 (the released wheel from PyPI: a local run and CI's scripts/test_wheels.sh) |
prepare on a Hub source with revision, through cairn remote launch |
not yet | the qualification run, cairn-extensions#9 | not yet |
Apache-2.0 — see LICENSE.
Metadata
Release files for cairn-pack-dataset-prep 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 |
|---|---|---|---|---|
| cairn_pack_dataset_prep-0.1.0.tar.gz | 18.5 kB | With provenance | Details for cairn_pack_dataset_prep-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cairn_pack_dataset_prep-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for cairn_pack_dataset_prep-0.1.0-py3-none-any.whl |
Total release size: 37.5 kB
Release files / cairn_pack_dataset_prep-0.1.0.tar.gz
| Download URL | cairn_pack_dataset_prep-0.1.0.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a0f0e6fd0199e04dd557b01a0230f45f80d9e37d9f04783ea232848ab24a2ee
|
|
BLAKE2b-256 checksum How to use checksums |
32819499bf7f9aa52c18e11c743168a2bf40d885dea45a7e35bc5ee4593b9c0d
|
| 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 Oct 26, 2026.
Transparency logRelease files / cairn_pack_dataset_prep-0.1.0-py3-none-any.whl
| Download URL | cairn_pack_dataset_prep-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92240ee1026a30f95e5b38161b556a12d7967e204aabbaf4f94da433c2512e90
|
|
BLAKE2b-256 checksum How to use checksums |
475b6bd173a72423a6ee84d3cd9499b5399aa2bd3345a6f59125678b9f21866b
|
| 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 Oct 26, 2026.
Transparency logSecurity for cairn-pack-dataset-prep 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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for cairn_pack_dataset_prep-0.1.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 Oct 26, 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.