CLI Reference

pasteur-cli performs local simulation, evaluation, comparison, dataset-card generation, and staging-cache management.

simulate

pasteur-cli simulate [OPTIONS] --input <INPUT>

Important options:

Option

Default

Purpose

--input

required

Local clean parquet

--labels

none

Cohort-membership parquet; enables flipper (classifiers)

--targets, --target-col

none

Regression: targets parquet and its target column

--targets-id-col

node_id

Regression: ID column of --targets, matched as text

--output

output

Simulation bundle root

--dataset-name

input file name

Provenance label printed in the log

--id-col

node_id

Source row identifier

--feature

TSH

Feature targeted by blackout, jitter, scramble, and units

--blackout-companion

none

Repeatable column nulled with the target feature

--blackout-rate

0.1

Fraction of rows selected for blackout

--scramble-rate

none

Fraction of rows written as messy text; enables scramble

--scramble-encoding

all

Repeatable: numeric-text, censored, unit-suffix, sentinel

--unit-rate

none

Fraction of rows converted; enables units with exactly one of --unit-preset or --unit-factor

--unit-preset

none

Named conversion (see Simulations)

--unit-factor, --unit-offset

none, 0

Custom conversion: value * factor + offset

--site

none

Site file (JSON) of blackout, scramble and units steps applied together; enables site (see Simulations)

--site-draws

none

Write this many random site draws instead of the site as declared

--jitter-scale

1.0

Noise scale

--jitter-iters

3

Number of jitter variants

--positive-group-id

103

Group treated as the positive cohort. Repeat once per class or label for --task multiclass / multilabel

--task

binary

binary, multiclass, multilabel, or regression: how flipper pairs are sampled

--flip-threshold

none

Regression only: clinical cutoff, in target units, that flipper pairs are sampled across. Without it, regression skips flipper

--flipper-pairs

200

Opposite-label patient pairs to sample for flipper

--flipper-steps

20

Interpolation steps per flipper pair

--sweep

none

Feature to sweep, as feature or feature=cutoff. Repeatable. Enables the sweep grid

--sweep-range

required with --sweep

Grid range lo:hi, absolute or relative to the cutoff

--sweep-relative-to

none

Makes --sweep-range a multiplier of each feature’s cutoff, and is the cutoff for features that do not give one

--sweep-steps

25

Grid points over --sweep-range, both ends included

--sweep-near

none

Adds --sweep-steps more points within ±this fraction of the cutoff

--random-state

42

Random seed

The defaults for --id-col, --feature, and --positive-group-id come from the example thyroid dataset. Always pass them for your own data. --jitter-scale is in units of the feature’s standard deviation. See Simulations for how the sweep grid is built.

card

Generate a Hugging Face-compatible README.md for a local bundle:

pasteur-cli card \
  --input ./output \
  --source-dataset org/source \
  --dest-repo org/source-simulations \
  --source-info source-info.json

The command writes documentation only. Uploads remain explicit hf upload operations outside Pasteur.

evaluate

Score one local ONNX model:

pasteur-cli evaluate blackout \
  --sim-root ./sim \
  --labels ./labels/groups.parquet \
  --model ./models/model.onnx \
  --output ./scores.json

The positional simulation type can be blackout, jitter, flipper, sweep (classifiers only), scramble, units, or site. Each run loads only that folder; see Reading the results for which metric to read from each.

Option

Default

Purpose

--sim-root

required

Bundle written by simulate

--labels

classifiers

Cohort-membership parquet (see Data Contracts)

--targets, --target-col

regression

Targets parquet and its target column (see Data Contracts)

--targets-id-col

node_id

ID column of --targets, matched as text

--model

one of these

Local .onnx file

--predictions

one of these

Precomputed predictions parquet, PATH or NAME=PATH; see Scoring models outside Pasteur. Cannot be combined with --model

--positive-group-id

103

Group treated as the positive cohort. Repeat once per model output, in output.classes order, for multiclass and multilabel models

--task

binary

Must match the model’s metadata.json task_type

--contract

next to model

Path to metadata.json when it is not beside the ONNX file

--input-name

input

Name of the model’s input tensor

--null-fill

see below

Value sent to the model for missing inputs

--positive-class-index

1

Binary only: column of the probability output that is the positive class. Rejected for multiclass, multilabel and regression models

--flip-threshold

0.5

Decision threshold used by flipper and sweep. Multilabel: applies to labels without a contract threshold. Unused for multiclass (argmax). Regression: the clinical cutoff in target units, with no default; required for evaluate flipper and must match simulate’s

--oracle-labels

none

Parquet with the correct label for every simulated row, for models whose right answer can change under a perturbation. Adds the oracle section; see Oracle labels. Classifiers only

--abstain-class

none

Needs --oracle-labels. The model’s output class that means “cannot decide”, e.g. cannot_determine. Adds abstention metrics for the stress variant (blackout, scramble or units)

-o, --output

stdout

Write the JSON result to a file. The directory must already exist.

compare

Score multiple models over the same variants:

pasteur-cli compare blackout \
  --sim-root ./sim \
  --labels ./labels/groups.parquet \
  --model ./models/a.onnx \
  --model ./models/b.onnx \
  --predictions-out ./predictions/blackout.parquet \
  --output ./comparison.json

compare takes the same options as evaluate. --model and --predictions are both repeatable and can be mixed; at least one model is required. Models are labelled by file name, so give each one a different name (a.onnx, b.onnx); two files both called model.onnx collide. --predictions-out writes one probability column per model plus all_agree. A single --contract applies to every model.

For a multiclass or multilabel model, pass the task and one group per output:

pasteur-cli simulate --input ./clean.parquet --output ./sim \
  --labels ./labels/groups.parquet --task multiclass \
  --positive-group-id 1 --positive-group-id 2 --positive-group-id 3

pasteur-cli evaluate flipper --sim-root ./sim \
  --labels ./labels/groups.parquet --model ./models/model.onnx \
  --task multiclass \
  --positive-group-id 1 --positive-group-id 2 --positive-group-id 3

The model’s metadata.json must declare task_type and output.classes; see Data Contracts.

For a regression model, pass the targets instead of cohorts, and the clinical cutoff for flipper to both commands:

pasteur-cli simulate --input ./clean.parquet --output ./sim \
  --task regression --targets ./targets.parquet --target-col hba1c \
  --flip-threshold 6.5

pasteur-cli evaluate flipper --sim-root ./sim \
  --task regression --targets ./targets.parquet --target-col hba1c \
  --flip-threshold 6.5 --model ./models/model.onnx

--predictions-out then writes target and one prediction column per model. all_agree is true when every model puts the patient on the same side of the cutoff, and null when no --flip-threshold is given.

Scoring models outside Pasteur

A model that is not ONNX (an LLM, a rule engine, a model behind a service) can be scored in its own harness and evaluated from its predictions. Pass --predictions in place of --model:

pasteur-cli compare jitter \
  --sim-root ./sim \
  --labels ./labels/groups.parquet \
  --model ./models/a.onnx \
  --predictions ./predictions/rules.parquet \
  --predictions llm=./predictions/run_7.parquet

The parquet holds one row for every row Pasteur evaluates, across clean and every variant of the simulation type:

Column

Content

variant_name

Text: the variant file stem (clean, blackout, jitter_0, flipper, …)

source_row_id

Text: the row’s source_row_id in that variant’s parquet

one per output

Float64. Binary: the positive-class probability. Regression: the prediction. Multiclass and multilabel: one column per class, in class order, named by class

To find the rows to score, read source_row_id from <sim-root>/clean and from each variant parquet, or run compare --predictions-out once with any model. A --predictions-out file from a single model is accepted as it is: its label, target and all_agree columns are ignored, and a <model>__ prefix shared by every class column is dropped.

The model is labelled by the file stem; NAME=PATH sets the label. A missing row, a duplicate row, a null prediction or the wrong number of output columns is an error; nothing is filled in. --contract, --input-name, --null-fill and --positive-class-index apply only to ONNX models, and multilabel predictions are thresholded at --flip-threshold.

catalog

Print the perturbation toolkit as JSON: the simulators, the scramble encodings, the unit presets with their factors and offsets, and the site-file format with a working example. It takes no options and reads no data. It is meant for scripts and agents that build a site file without parsing these docs:

pasteur-cli catalog

cache

The Pasteur staging cache is separate from the Hugging Face download cache:

pasteur-cli cache list
pasteur-cli cache rm stub.onnx --kind models
pasteur-cli cache clear --kind simulations

Use pasteur-cli cache for Pasteur’s models/ and simulations/ staging directories. Use hf cache for files downloaded from the Hub.

Model contracts

An optional metadata.json preserves feature order and the model’s missing value sentinel:

{
  "input": {
    "feature_order": ["TSH", "T3", "T4"],
    "absent_sentinel": 0.0
  }
}

--null-fill resolves in this order: the flag, then the contract’s absent_sentinel, then NaN. A model that returns NaN probabilities is rejected with an error rather than scored.

A declared feature-order mismatch aborts evaluation. If no contract exists, Pasteur still checks input width, but it cannot infer feature semantics from the ONNX graph.

Run pasteur-cli <command> --help for the complete generated option list.