gaige
package v0.0.4 · released

one small package, operable by one person

how to get gaige, set it up, and read your first receipt. every feature ships with a command-line path and a plain-English --help; nothing below assumes a cluster, a team, or prior calibration experience.

what is in the gaige package?

gaige scores labeled corpora with pluggable AI-text detectors and turns the results into reproducible receipts: ROC and threshold math, conformal calibration, subgroup rates, honest refusals, and an instrument fingerprint on every number. the analysis core runs anywhere Python runs; a GPU matters only when you score against a real model, and never for reading the receipt.

gaige is a Python package for python 3.10 and up. most of it needs nothing but numpy and requests: corpus handling, the ROC and threshold math, conformal calibration, subgroups, receipts, the run registry. all of that runs anywhere. the GPU extra (torch, transformers, bitsandbytes, accelerate) exists only for scoring against a real model; analysis never touches it.

once models are staged, nothing here needs a network: scoring is local, analysis is offline, and receipts replay bit-identically across an air gap.

license: AGPL-3.0, commercial licensing available. anything that surfaces an error, an interval, or a caveat is free on principle, forever.

how do you install gaige?

pip install gaige is the whole install for analysis: Python 3.10 and up, numpy and requests, nothing else. add "gaige[gpu]" when you need to score against real models. version 0.0.4 is on PyPI with its own verification receipts, and the source, history, and CI run in the open on GitHub.

from PyPI

pip install gaige · 0.0.4, on pypi.org/project/gaige, released with its own verification receipts. the core install is analysis-only (numpy + requests); add [gpu] when you need to score.

from source

github.com/ghxrk13/gaige: clone, then pip install -e .; the whole tool is one package directory and a CLI entry point. History, issues, and CI run in the open.

requirements

Python ≥ 3.10. core: numpy, requests. GPU extra: torch, transformers (< 5, pinned so 4-bit stays verified), bitsandbytes, accelerate. a GPU is optional; a receipt is not.

support

issues and receipt-backed reproductions are welcome; improvement ideas and use cases go to Discussions. maintainership is deliberately closed. licensing: ghxrk13@proton.me

what do you run first?

create a virtual environment, install the lane you need, then ask the machine before any run: gaige plan answers with measured memory floors and honest refusals, gaige corpora lists the built-in piles and the labeled-jsonl format, and gaige providers grades served-model attestation before a run wastes an evening.

$ python -m venv .venv && source .venv/bin/activate
$ pip install gaige             # core: analysis anywhere, no GPU needed
$ pip install "gaige[gpu]"      # scoring: torch + transformers<5 + bitsandbytes
$ pip install "gaige[verify]"   # provenance evidence: c2pa-python + PyWavelets + opencv

$ gaige plan                    # what can THIS machine honestly run, measured
$ gaige corpora                 # built-in corpora + the labeled-jsonl format
$ gaige providers               # served-model providers + attestation grades

gaige plan answers with measured memory floors and honest refusals: “NO — needs 8.0 GB free VRAM, have 7.9” is a feature, not an error. 4-bit quantization is CUDA-only; on CPU, use fp32 and expect the fingerprint to record a different instrument.

what does a gaige receipt contain?

$ gaige run --corpus hc3-mini --n 100 --seed 17 --detector fast-detect-gpt
→ reports/<timestamp>-fast-detect-gpt/
    report.md      the receipt, human-readable
    results.json   every statistic, wholesale
    scores.csv     per-document scores
    roc.json       the curve
    env.json       instrument fingerprint + the exact reproduce command
    run.json       run identity

$ gaige run --corpus your-labeled.jsonl      # rows: {"text": ..., "label": "human"|"ai"}
$ gaige analyze --report reports/<timestamp> # re-derive anywhere · no GPU · bit-identical
$ gaige export --report reports/<timestamp> --out site-data/  # public receipt JSON
$ gaige verify picture.png                   # provenance evidence sweep · statuses, never a score
$ gaige admit --baseline reports/<ts>-<detector>/ --candidate new.jsonl  # divergence from your accepted baseline

one run writes the whole receipt: a human-readable report, every statistic in JSON, per-document scores, the ROC curve, and the instrument fingerprint with its exact reproduce command. the headline is an AUROC with a bootstrap interval; thresholds come in two families kept apart by construction; refusals, subgroups, and the fingerprint carry the honesty. row by row:

the headlineAUROC + interval

separation with a bootstrap confidence interval, e.g. AUROC 0.9285 [0.9061, 0.9482] on a RAID benchmark slice. never a bare number.

thresholds, two waysnever confused

empirical in-sample and conformal with a finite-sample guarantee, side by side. the two families answer different questions, and the report keeps them apart by construction.

refusalsthe integrity beat

when your data cannot support the guarantee you asked for, the receipt says so and stops: α=.005: refused — needs ≥199 human calibration samples, got 120. A tighter guarantee than your data supports is not a guarantee.

subgroupsaggregates hide

error rates stratified over every axis your corpus metadata carries, each with an interval: on one RAID slice the single AUROC hid greedy 87.6% vs sampled 39.7% TPR at the same threshold.

fingerprintno fingerprint, no number

model, quantization verified at load, device recorded as resolved (never “auto”), library versions, corpus sha256, and the exact command that reproduces the number.

the figures quoted above, with their measurement conditions:

figure value measured on
separation with intervalAUROC 0.9285 [0.9061, 0.9482]fast-detect-gpt · falcon-7b · 4-bit verified · cuda · raid-g2d2a2-n60-s17 · committed receipt
decoding split the aggregate hidgreedy 87.6% vs sampled 39.7% TPR@1%FPRsame run, same threshold: the subgroup rows of the same receipt
refusalα=.005 refused: needs ≥199 human calibration samples, got 120same receipt, conformal block, quoted verbatim

what does gaige verify report?

evidence statuses, never a score: gaige verify sweeps a file for c2pa content credentials and watermarks and answers FOUND, ABSENT, INCONCLUSIVE, or NEEDS_KEYS per scheme. every negative is earned rather than assumed, every result states what it means, and the sweep records the verifier fingerprint. in detail:

gaige verify (since 0.0.3) sweeps a file for provenance evidence and emits statuses, never a score: c2pa content credentials, where absence is a typed signal: only a true “no manifest found” reads ABSENT, and a validation failure never does; the publicly checkable dwtdct image watermark behind a per-image carrier self-test, where a negative earns ABSENT only when a probe payload embedded into that same image survives a round trip, proving the carrier could have held the mark, and otherwise the answer is INCONCLUSIVE, because on an unfavourable carrier the decoder returns silence either way; and keyed text schemes reported honestly as NEEDS_KEYS. every result states what a negative from it means, and every sweep carries the verifier fingerprint, including which optional libraries were absent.

$ pip install "gaige[verify]"
$ gaige verify picture.png      # FOUND / ABSENT / INCONCLUSIVE / NEEDS_KEYS · never a verdict

what does gaige admit measure?

how far unlabeled candidate material diverges from an accepted baseline receipt, measured on the baseline’s own fingerprinted instrument. the headline is a two-sided conformal novelty rate with its exact false-alarm law printed; refusal floors, per-document placements, and stratified detail ride beside it. the receipt never says admit or reject: that stays your call. in full:

gaige admit (since 0.0.4) measures how far unlabeled candidate material diverges from an accepted baseline receipt, under the baseline’s own fingerprinted instrument. the headline number is a two-sided conformal novelty rate: the share of candidate documents outside the baseline’s acceptance band, beside what exchangeability would predict, with each side’s exact false-alarm law printed and a floor below which the guarantee is refused, not granted. ks distance and quantile shifts ride beside it with intervals, every document gets its own placement, strata are withheld under twenty documents, and the live lane refuses any instrument mismatch. supplied scores are accepted for the no-GPU lane and labeled unattested. the receipt never says admit or reject; the decision is yours.

$ gaige admit --baseline reports/<ts>-<detector>/ --candidate new-material.jsonl
$ gaige admit --baseline reports/<ts>-<detector>/ --candidate-scores scores.csv   # no-GPU lane · labeled unattested

commands

command in short what it does
gaige runscore a corpusscore a labeled corpus with a pluggable detector and write the full receipts report.
gaige analyzere-derive anywherere-derive every number from existing scores: laptop, CPU-only box, or air-gapped machine.
gaige scoreone documentscore a single document against a calibrated report’s stated operating points. measurements, never a verdict.
gaige exportreceipts as public dataturn a report into public JSON, one file per receipt plus an index: statistics verbatim, fingerprint and reproduce command attached. no fingerprint, no export, and an absolute path or an IP anywhere in the document refuses the whole thing. feeds the receipts page.
gaige verifyprovenance evidencesweep a file for marks and manifests: c2pa with typed absence, the dwtdct watermark behind a per-image carrier self-test, keyed schemes as NEEDS_KEYS. evidence statuses, never a score; the overclaiming result cannot be constructed.
gaige admitone-verb admissionmeasure divergence of unlabeled candidate material from an accepted baseline receipt: conformal novelty with its false-alarm law, per-document placements, stratified where-it-differs, refusal floors. never an admit/reject verdict.
gaige corpus prepare-raidbenchmark slicesprovenance-pinned, seeded, stratified calibration slices from the RAID benchmark; slice metadata rides into every downstream receipt.
gaige probe rundated probe setsrun dated, provenance-carrying probes against a served model and grade deterministically: the longitudinal-measurement lane.
gaige series list · show · watchdrift monitorsregistered run series with frozen instrument identity; watch applies per-interval conformal alarm bounds.
gaige planfeasibility, measuredwhat this machine can run, at what measured cost, with what attestation, and no quality column, deliberately.
gaige providers · test-connectionserved modelslist providers (local-hf, llama.cpp, ollama) with honestly graded attestation; verify reachability before a run wastes an evening.

also in the box: gaige probe new and gaige probe lint: probe-set authoring with schema enforcement, manifest-gated so a probe run refuses material that violates the declared instrument decisions.

known edges

adjacent: the receipts gallery · fast-detectgpt guide · custody · faq