Skip to main content

Record- and token-level data provenance for AI training datasets

Project description

OriginBlame

Record- and token-level data provenance for AI training datasets.

When a data contributor requests removal, model trainers face a practical gap: unlearning algorithms require a forget set, yet no tool can locate which training records belong to a given author. OriginBlame propagates author identity through data processing pipelines and resolves revocation requests into precise forget sets via deterministic queries.

Install

pip install originblame

Python >= 3.12 required. An optional native backend (compiled via maturin) accelerates performance-critical operations; without it, a pure-Python fallback is used.

Quick Start

# 1. Initialize tracking in your dataset directory
ob init

# 2. Register an author
ob author.add "Wikimedia" "wikimedia@example.com"

# 3. Register a section (file + author + license)
ob register.add \
  --path raw/wiki.xml \
  --authors wikimedia@example.com \
  --license CC-BY-SA-4.0 \
  --year 2024
from ob import init, author_add, register_section, source, track

init()
author_add("Wikimedia", "wikimedia@example.com")
register_section("raw/wiki.xml", ["wikimedia@example.com"], "CC-BY-SA-4.0", "2024")

# Track data lines with provenance
source.append("raw/wiki.xml")
for record in read_jsonl("data.jsonl"):
    track(record, file="data.jsonl")
source.pop()

# Or use the context manager
from ob.source import sources
with sources("raw/wiki.xml"):
    track(record, file="data.jsonl")

Python API

init(force=False, ob_dir=None)

Initialize a .ob/ tracking directory. Raises OBInitError if .ob/ exists but is invalid.

author_add(name, email, ob_dir=None) -> str

Register an author. Returns the 64-char SHA-256 author_id.

register_section(path, authors, license, year, contributors=None, ob_dir=None) -> str

Register a section linking a file path to authors and license. Returns the section_hash.

track(data, file, embedding=None, model=None, *, source=None, ob_dir=None) -> TrackResult

Record a provenance entry for data (dict or str) in file.

  • source: file path, list of section hashes, or None (uses source stack).
  • Returns TrackResult with .line_hash, .file, .sources, .written.

Source stack: source.append() / source.pop()

Thread-local stack for implicit source assignment:

source.append("raw/wiki.xml")
track(data, "data.jsonl")
source.pop()

CLI Reference

ob init [PATH]                          Initialize .ob/ tracking directory
ob author.add NAME EMAIL                Register an author
ob register.add --path P --authors A    Register a section
  --license LICENSE --year YEAR

ob blame FILE LINE                      Show which section(s) a line belongs to
ob show [--author NAME] [--email EMAIL] Show provenance metadata
  [--section HASH] [--license LICENSE]
  [--revoked] [--index] [--tokenizer T]
ob revoke --author NAME                 Revoke at author level
ob revoke --section HASH                Revoke at section level
ob revoke --line-hash HASH --file FILE  Revoke at line level
ob purge FILE [--author NAME] [--dry-run]  Physically delete revoked data
ob status [--tokenizer TOKENIZER]       Show summary statistics
ob clean                                Merge PID files, archive revoked records
ob merge --absorb PATH                  Absorb provenance from another repository
ob generate-set --tokenizer T -o FILE   Generate binary forget set (bitmask)
ob log [--op OP] [--since TIMESTAMP]    Query operation audit log

ob reconcile FILE [-m MODEL]            Reconcile provenance after data edits
  [-t THRESHOLD] [-e EMBEDDING_API]
ob export-copyright [-o FILE]           Export DEP-5 copyright file
ob parse --parser FORMAT --file FILE    Parse structured data (MediaWiki XML)
ob version                              Show version

Token-Level Provenance

Add --tokenizer NAME to show, revoke, status to query token-index entries:

ob show --author InternetArchiveBot --tokenizer gpt2
ob revoke --author InternetArchiveBot --tokenizer gpt2
ob generate-set --tokenizer gpt2 -o forget.bin

Architecture

.ob/
  authors/              who: name, email, id = sha256(name+email)
  sections/             what: file path + authors + license
  document-index/       which line came from where
  token-index.gpt2/     per-document token counts (per tokenizer)
  index/                binary index for fast lookups
  log                   operation audit trail

Three layers: authors <- sections <- document-index, extended with an independent token-index for streaming pipelines.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

originblame-0.2.0.tar.gz (879.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

originblame-0.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl (948.4 kB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

originblame-0.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl (892.5 kB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

originblame-0.2.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (746.9 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64

originblame-0.2.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (717.0 kB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ ARM64

originblame-0.2.0-cp314-cp314-win_amd64.whl (568.1 kB view details)

Uploaded CPython 3.14Windows x86-64

originblame-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl (948.8 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

originblame-0.2.0-cp314-cp314-musllinux_1_2_aarch64.whl (893.2 kB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ ARM64

originblame-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (733.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

originblame-0.2.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (716.8 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ ARM64

originblame-0.2.0-cp314-cp314-macosx_11_0_arm64.whl (650.2 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

originblame-0.2.0-cp313-cp313-win_amd64.whl (556.5 kB view details)

Uploaded CPython 3.13Windows x86-64

originblame-0.2.0-cp313-cp313-win32.whl (529.8 kB view details)

Uploaded CPython 3.13Windows x86

originblame-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl (948.8 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

originblame-0.2.0-cp313-cp313-musllinux_1_2_aarch64.whl (893.0 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

originblame-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (733.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

originblame-0.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (717.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ ARM64

originblame-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (650.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

originblame-0.2.0-cp312-cp312-win_amd64.whl (556.7 kB view details)

Uploaded CPython 3.12Windows x86-64

originblame-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl (948.5 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

originblame-0.2.0-cp312-cp312-musllinux_1_2_aarch64.whl (892.9 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

originblame-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (733.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

originblame-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (716.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

originblame-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (650.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file originblame-0.2.0.tar.gz.

File metadata

  • Download URL: originblame-0.2.0.tar.gz
  • Upload date:
  • Size: 879.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for originblame-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5b520ce7502639291246c22874c3372d6f1702fdb2f1d78680ae89b17220c369
MD5 f87fe69edbca7c70d343898de3c829e4
BLAKE2b-256 b6d114ea30109f92775503b535b23e433f9ba0dcda9751843809ce863fc079db

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3617ace1954a6125f34e7d03e5c7aaf35a009294497990f3fdd0075cff0e8dca
MD5 833794c34c76ea11dbf153e8c2626144
BLAKE2b-256 40a98244cce12b7393b2457468fcbf0c949ceb860f92907bb202bc5a6eb585ac

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1689a62dce48e3616c852ecfe8b2f7cffd7da0b7b8a8e56d595b1a7f4ba946c7
MD5 60b0f4a935a76defea2a37d1e3252ba7
BLAKE2b-256 b9da1b73379e73110d930f8597332a127c679fa4e2735d828a8a508bc9d9225e

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7fe6b22046d98a457e5e63985f6ab0a07317015398451d67bd8ce30535441fb0
MD5 7f29dc2b4b6daf781a875b59eeaf3824
BLAKE2b-256 6742961230ad630854206b505f9f6cdf471a5cedce54f5a32556e27208a9400e

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b4de42514b7059d449262bf01c8f4b7277596d0ee89b1ac826c04c46b9ade8e9
MD5 17097db5f9a614d2a25ea7649ad64405
BLAKE2b-256 cb393f35b96fd0a754378cc1089fbc1da94fd95b76f2e3eef1c24c63fa660ba1

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: originblame-0.2.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 568.1 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for originblame-0.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 31594e131ddc10b97bf75eba748cc5a41369221e2ea70869cc0935460f727505
MD5 297e51c494992b69df21742c81ac6a5d
BLAKE2b-256 b30942ed73b3ddfcf58def467dcfc2ba4677e6cda30f9a5f30f95d8bce63e74e

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 601014a919b8acab7610dc3c0e1502d689cb378c79275dfddb9bf0a76a1cd1fb
MD5 8f846b23fde9312535e0cdc242abee96
BLAKE2b-256 458d90c40f64bee7b1fb1d1f6f56f91c51d8a41238a74a86a70766ed429af1f3

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp314-cp314-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp314-cp314-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4b13f74ce6aceeefe5599c9e65e359140a1efe97587d99e309ae1217ccbaa887
MD5 c079a9b928b3dc8cb8f4c92939c9a5f5
BLAKE2b-256 5ae070429b86d6b28ba388c82d0074e6240ac947013066cb66d1671138682124

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b821ecd9ecbaa1d5f4c5b61f4b6474f39a276f252f97bf26183cbb00d427e129
MD5 122dfc42430426fc767737300652ff5a
BLAKE2b-256 9a495923a5274005bd87ebd1a65d9f1b18b7a70e40d7c9a0b3ecd3f8c29174a7

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3d2b10c7acdc40e7d3a72a8b7117abe8ca52b57fcdcd5d12f487a6a59e175cbe
MD5 7ff584cdf9af569e6330768a7e862cdc
BLAKE2b-256 fe2b15aa0929b63f646d3725adef15cf3e0ad16c1e23786cd265678b9c80f37f

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9bb32a6c603512edd67aaf4285a3221df04f8a8c81dd736d84f8be13aeb2fd80
MD5 515baa6f6b32ee2ca57103900c5df580
BLAKE2b-256 408e28f04a88ba4b93aee594d6c2ee9564d40896d09e67fe78f260937b111f45

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: originblame-0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 556.5 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for originblame-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 095135026fb2daf8c87df32127a8ae0b922da6cf11ea0f1278f4d18536554a56
MD5 687f57efce8fb7d1f36c961453aa7e62
BLAKE2b-256 3476f8f82da9b1f258226706944a044135cf0cacff1bbdfe300b6e52b9f943ef

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp313-cp313-win32.whl.

File metadata

  • Download URL: originblame-0.2.0-cp313-cp313-win32.whl
  • Upload date:
  • Size: 529.8 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for originblame-0.2.0-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 258a2ecb758316444a1e5e6e66558539a1d5df117c1f934959c23c8bb68e0218
MD5 743741cc83a1469b35e0e174312897d1
BLAKE2b-256 1c1120abacd2fae6251b285727096f200ad4d272f1e3a6896f65fd47d695d6fe

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 42acdfe9ff649b83f12f0adc142e62d9343d047af6f7d225b3701fd7d72c4ad2
MD5 9c3add249bc30b5b16691c2a549201ab
BLAKE2b-256 d7c3fae83b77a84ef85e20501826b1d2dc371acae702870227a420aed118c603

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp313-cp313-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp313-cp313-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 9b4b3701fb350976c17d8e941b46e318a682cf12b98c9fe20839119db02150fe
MD5 54db67cdcc1a17ccb054eab83a0b9cb0
BLAKE2b-256 f6a5136506180d80d2c8d974bbd40a5a0716534b4ac000c72769dc0e59f26340

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38c771ec7b16a5e551286c4f30933a3b469ea6ba393d93c9c0e9b80f0c07088f
MD5 b0072238504d8bf5904d0169acbc7f2d
BLAKE2b-256 c4d5295d5c2fcd607646baee5fd5cb431b8a28431ec8834531867e4d7c18539a

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cc14a72f97eafd0f27643d17aa44082f85b95187ea8df0e700c0c21b8bb3cbce
MD5 74c73524d66d686c36025f87afc04ffc
BLAKE2b-256 79a269417079dc8f0a0c319fb9232e49709fd75460bba1e0e9b2f069b12c5b02

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6af98341dbc7e0e908b362ef7906b57114ec2972247c84b1f0fd6ce59b3817f3
MD5 e0bcd41dbb28b1f4f7f2622433628cd4
BLAKE2b-256 b2d608bc180019378ec45e2cb757233cb60c43f3a435f31008048c8d269fc49c

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: originblame-0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 556.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for originblame-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 44b89f76993548be9767676fa6a4e5e8abbe63cf0c9befba0a7e5d29b92b18c2
MD5 4443099e06bba5488bc82887263f7254
BLAKE2b-256 756e59aaa2697bc3247beafacb98b0524dd7be082ffe8dc571ed6a4e289e3729

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6cd1e8a87a345c72810631af4bdae752bee92234aee1d170fe167e1ec966703e
MD5 ed5f14b8d63722c564a4266cf25cb7a7
BLAKE2b-256 32d680c89d6d291529fb941bc3ba33ac6848f1e4a98f614755472a5a4eb54103

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp312-cp312-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 02c1232b86a42fe312e5a796b64b81c62f627505ef4603e2347eee8d183c9991
MD5 a1a1cab95709e6a02b60910db2feb1fe
BLAKE2b-256 d9dbe9114671929162c4ef270887f040b7a6cbe07156dd89f1519c145150cf45

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 00fc7a150380666650aab72b17b432006fce7bb7dce37f80bc140bfd0f30c747
MD5 87685a98a57cc20a16be8281820f6c6d
BLAKE2b-256 6418c0a4981ab3aae3dddfcf82dcc1e49ccd0d01c2350510d68c3f7e989e01b5

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2e7f13ca9dc4999be3818379051e194b43b1294eca14ba80dd463d6960eb5aaf
MD5 01010220724c31e40ab7501c3a8b8b2e
BLAKE2b-256 bb9519110c8dc995a6fdd72b33891b5aca16d70da7f53d6f021bb9d15a78176b

See more details on using hashes here.

File details

Details for the file originblame-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for originblame-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0c64aecbf06bbe0e3fff8c48397c89b798305e2049c87a023992078982a37033
MD5 9f3ea7664abdb6b6bb03167bf6a3c9c0
BLAKE2b-256 294f084aa2392d89e9c3e1905da472d01d55777d67fe17e0966e4e7304c886c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page