Skip to main content

ConductTraining (ctrain) — Zero-Docker Dataset Distillation and 3-Second Flashcard Labeling

CI Status PyPI Python 3.10+ Runtime Dependencies: 1 (pydantic) License: MIT

ConductTraining (ctrain)

Insert any CSV, TSV, JSONL, TXT, or image folder -> auto-label with CPU rules & blind 3-model LLM juries -> review edge cases in a 3-second flashcard UI -> emit cryptographic Cohen/Fleiss kappa receipts & a disconnect-proof Google Colab A100 LoRA trainer. Zero Docker, zero PostgreSQL, 1 runtime dependency (pydantic>=2.0).

Built by Shuhan He (https://github.com/ShuhanCS) and ConductScience (https://conductscience.com), published openly through ConductScience Foundation (https://conductsciencefoundation.org).

ATTRIBUTED TO & SUPPORTED BY

ConductScience     Shuhan He (@ShuhanCS)


Live Interface Preview

Every labeling session ships with WCAG 2.2 AA Light and Dark modes (press T anytime), keyboard-first 1-9 hotkeys, blind dual-reviewer URLs (?reviewer=alice vs ?reviewer=bob), and append-only fsync JSONL storage.

3-Second Flashcard Review UI (ctrain start / ctrain cards)

ConductTraining 3-Second Flashcard UI (Light and Dark Mode)

View both Light and Dark mode screenshots side by side
Light Mode (Warm Sand #FBFAF6) Dark Mode (Low-Glare Slate #0E1218)
Flashcard UI Light Flashcard UI Dark

Zero-Backend Local Browser App (ctrain export-webapp)

Try it live right now (zero install, files stay local in your browser): https://conductscience-foundation.github.io/conducttraining/

Drag and drop .csv, .tsv, .jsonl, .json, .txt, or image folders directly in the browser with zero server, zero upload, and instant .jsonl + kappa receipt + Colab .ipynb export:

ConductTraining Zero-Backend Browser App


What Is This?

Most data-labeling and fine-tuning stacks force you to write bespoke JSON converters, boot Docker + PostgreSQL, and stitch together five disconnected tools for programmatic rules, LLM pre-labeling, human review, inter-rater reliability, and LoRA training.

conducttraining (ctrain) installs in under one second with one runtime dependency (pydantic>=2.0) and runs straight on the raw files already on disk.

ConductTraining 3-Tier Active Distillation Pipeline


Quickstart

Install

pip install conducttraining

Or install from source for development:

git clone https://github.com/ConductScience-Foundation/conducttraining.git
cd conducttraining
python -m pip install -e ".[dev]"

Start Labeling Any File or Image Folder in One Command

# Label any CSV, TSV, JSONL, or TXT file directly:
ctrain start examples/text_and_quotes/raw_documents.csv \
  --prompt "Does the source passage support the claim?" \
  --labels "Supported,Unsupported,Contradicted"

# Or point directly at any directory of images (.png, .jpg, .webp, .svg):
ctrain start examples/shape_images/images/ \
  --prompt "Which geometric shape is shown?" \
  --labels "Circle,Square,Triangle"

Choose Your Workflow Mode

Mode Command Runtime Needed Best For
1-Command Local Server ctrain start data.csv --prompt "..." --labels "A,B,C" Python 3.10+ (pydantic) Fast keyboard labeling with append-only fsync JSONL and blind dual-reviewer links
Full 3-Tier Distillation ingest -> auto -> jury -> cards -> score -> split -> export-colab Python 3.10+ (+ optional LLM API / vLLM) Distilling 10k to 1M records down to ~400 high-entropy human cards + Colab A100 training
Zero-Backend Browser App ctrain export-webapp --out-dir ./web_app Any modern browser (no server) Sharing a single static index.html with collaborators whose files must stay on their machine

Four Native Task Card Modes

conducttraining.schema auto-detects the card layout from your columns or directory contents (and lets you override any column via --text-col, --group-col, --option-a-col, --option-b-col, --claim-col, or --image-col):

Mode Triggered By Built-In Ergonomics
text_classification Text / passage column or line-delimited .txt Automatic <mark> keyword highlighting, group badges, 1-9 hotkeys
quote_verification Claim + source passage columns Enforces character-exact substring verification (verify_verbatim_quote) to reject hallucinated LLM citations
pairwise_dpo Option A + Option B response columns Side-by-side preference layout exporting cleanly into TRL DPOTrainer
vision_card Image folder or image path/URL column Path-jailed local media serving, click-to-zoom, and low-glare dark mode (T)

Scope: What ConductTraining Is For (and What It Is Not)

In Scope

  • Zero-schema data ingestion from .csv, .tsv, .jsonl, .json, .txt, and local image folders.
  • 3-tier active distillation: deterministic CPU rules (ctrain auto), blind multi-model LLM juries (ctrain jury), and high-speed human review (ctrain cards).
  • Blind human calibration: jury predictions stay hidden on active review cards so human raters are never anchored by model guesses.
  • Zero group leakage: locks every group_id (document ID, thread ID, folder, or recording ID) into a single train/dev/test split with a Merkle SHA-256 DatasetReceipt.
  • Audit-grade inter-rater metrics: exact Cohen's kappa, Fleiss' kappa (3+ raters/models), Wilson 95% confidence intervals, confusion matrices, and Jury-vs-Human calibration tables.
  • Disconnect-proof Colab A100 notebook export: Drive-checkpointed cells for subprocess-isolated vLLM, DeBERTa-v3, and Unsloth + TRL 4-bit QLoRA (SFTTrainer / DPOTrainer).

Out of Scope (Deliberate Design Decisions)

  • Pixel polygon / bounding-box segmentation editors: vision_card is built for rapid image classification, quality triage, and preference ranking, not freehand mask drawing.
  • Hosted multi-tenant SaaS user management: ctrain runs locally with zero Docker and zero database servers by design.
  • Opaque telemetry or automatic cloud uploads: your files stay strictly on disk unless you explicitly point ctrain jury at an external API endpoint.

End-to-End CLI Pipeline

# 1. Convert any raw CSV/TSV/TXT/JSONL or image folder into TaskCard JSONL
ctrain ingest examples/text_and_quotes/raw_documents.csv \
  --prompt "Does the source passage support the claim?" \
  --labels "Supported,Unsupported,Contradicted" \
  -o work/cards.jsonl

# 2. Tier-1 deterministic rules (CPU, ~100k items/sec, $0)
ctrain auto work/cards.jsonl \
  --rules examples/text_and_quotes/rules.json \
  --silver-out work/silver_t1.jsonl \
  --remaining-out work/tier2_queue.jsonl

# 3. Tier-2 blind 3-model LLM jury (mock:* offline, or openai:/vllm:/anthropic:/gemini:/ollama:)
ctrain jury work/tier2_queue.jsonl \
  --juror mock:juror-qwen \
  --juror mock:juror-llama \
  --juror mock:juror-gemma \
  --require-quote \
  --silver-out work/silver_t2.jsonl \
  --deck-out work/review_deck.json

# 4. Tier-3 3-second flashcard web app (blind dual-annotator links)
ctrain cards work/review_deck.json --judgments work/judgments.jsonl --port 8788
# Open http://127.0.0.1:8788/?reviewer=alice and http://127.0.0.1:8788/?reviewer=bob

# 5. Compute Cohen's kappa, Fleiss' kappa, Wilson 95% CIs, and Markdown report
ctrain score work/review_deck.json examples/text_and_quotes/sample_judgments.jsonl \
  --out work/BENCHMARK_RECEIPT.json \
  --markdown work/BENCHMARK_REPORT.md

# 6. Zero-leakage group train/dev/test split with Merkle SHA-256 receipt
ctrain split work/cards.jsonl --out-dir work/splits

# 7. Export disconnect-proof Google Colab A100 trainer + standalone static web app
ctrain export-colab --out work/conducttraining_a100.ipynb --track both
ctrain export-webapp --out-dir work/web_service

Python API Example

from conducttraining import (
    ABSTAIN,
    AutoLabelPipeline,
    BlindJuryEngine,
    MockJuryProvider,
    TaskCard,
    ingest_any_data,
    labeling_function,
    split_cards_zero_leakage,
)

cards = ingest_any_data(
    "examples/text_and_quotes/raw_documents.csv",
    prompt="Does the passage support the claim?",
    labels="Supported,Unsupported,Contradicted",
)

@labeling_function(name="low_confidence_score")
def lf_low_score(card: TaskCard) -> str | None:
    score = card.metadata.get("confidence_score")
    if score is not None and float(score) < 0.25:
        return "unsupported"
    return ABSTAIN

silver_t1, queue_t2, _, _ = AutoLabelPipeline([lf_low_score]).run_batch(cards)
jury = BlindJuryEngine([
    MockJuryProvider("juror-qwen"),
    MockJuryProvider("juror-llama"),
    MockJuryProvider("juror-gemma"),
])
silver_t2, review_deck, _, _ = jury.run_batch(queue_t2)
splits, receipt = split_cards_zero_leakage(cards)
assert receipt.zero_group_leakage is True

Pluggable Jury Providers (Python Stdlib HTTP, Zero Extra SDKs)

Provider Class CLI Prefix Use Case
MockJuryProvider mock:<name> Deterministic CPU offline testing and CI smoke checks
OpenAICompatibleProvider openai:<model> OpenAI API or any OpenAI-compatible inference server
VLLMBatchProvider vllm:<model> Local or Colab A100 batched open-weight model serving
OllamaProvider ollama:<model> Local workstation models via Ollama
AnthropicProvider anthropic:<model> Anthropic Claude models
GeminiProvider gemini:<model> Google Gemini models

Runnable Examples & Documentation

Path Description
examples/text_and_quotes/ Raw CSV ingestion, quote verification, side-by-side A/B preference cards, 3-rater blind kappa scoring, and Colab export
examples/shape_images/ Raw image folder ingestion with CPU-generated SVG shapes, path-jailed local serving, and dual-rater kappa receipt
docs/COMPETITIVE_LANDSCAPE.md Architectural comparison against Argilla, Label Studio, Prodigy, Snorkel, and Doccano
STYLE_GUIDE.md WCAG 2.2 AA color tokens (Light/Dark), typography, and keyboard-first UI copy specification
CHANGELOG.md Version history (0.1.0 through 0.3.0)

Testing & Repository Hygiene (100% CPU, Ephemeral Ports)

Every push and pull request runs the full test suite on Ubuntu and Windows across Python 3.10, 3.11, and 3.12, including automated checks for zero secrets, zero local filesystem paths, and version/citation synchronization:

python -m pytest -v

Metadata

Release files for conducttraining 0.3.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 conducttraining 0.3.0
File Size Uploaded Provenance Actions
conducttraining-0.3.0.tar.gz 84.2 kB Without provenance Details for conducttraining-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 158.5 kB

Release files / conducttraining-0.3.0.tar.gz

Download URL conducttraining-0.3.0.tar.gz
Size 84.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6c95dd2f1de6216f5493b8a331a3d4759c06f559532d5fe1cb5b0102e9ca0ca9
BLAKE2b-256 checksum
How to use checksums
a3302a82ebf912e53194dab9b7c1ea6d72a46cc77266bafecf84b935f5d5485b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / conducttraining-0.3.0-py3-none-any.whl

Download URL conducttraining-0.3.0-py3-none-any.whl
Size 74.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c0a9753cbc843212b7446556da70ea9e6bd800ace15d064cdf0e90e21e0ccb5
BLAKE2b-256 checksum
How to use checksums
5d5be44af4c6941b2204a9098c1b214238b92198722ded0329d6dca131ae6ce0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for conducttraining 0.3.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.3.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