Skill Tracer
Skills › Scientific Agent Skills › waypoint-bio › cli-reference.md

cli-reference.md

234 lines · skills/waypoint-bio/references/cli-reference.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# `waypoint` CLI reference
2
3Reviewed 2026-10-01 against `waypoint-bio` 1.0.2 (PyPI wheel) and GitHub main
41.0.4 (`f45eee6d07a480bfc90f84ab8082bbc969dec15d`). Flags below are shared;
5export/logging differences and known failures are recorded in `upstream-review.md`.
6Hub-backed training examples are illustrative, without authenticated scientific execution.
7
8```
9waypoint {pretrain,benchmark,finetune,embed,prepare-dataset} ...
10```
12Config paths are resolved first against the working directory, then against the bundled
13`waypoint_bio/configs/` tree inside the installed wheel. So `--config configs/benchmark.yaml`
14works from anywhere without cloning the repo. The same fallback applies to the bundled example
15data (`examples/abundance_matrix.tsv`, `examples/finetune_classification.parquet`, …).
17---

waypoint CLI reference

Reviewed 2026-10-01 against waypoint-bio 1.0.2 (PyPI wheel) and GitHub main 1.0.4 (f45eee6d07a480bfc90f84ab8082bbc969dec15d). Flags below are shared; export/logging differences and known failures are recorded in upstream-review.md. Hub-backed training examples are illustrative, without authenticated scientific execution.

waypoint {pretrain,benchmark,finetune,embed,prepare-dataset} ...

Config paths are resolved first against the working directory, then against the bundled waypoint_bio/configs/ tree inside the installed wheel. So --config configs/benchmark.yaml works from anywhere without cloning the repo. The same fallback applies to the bundled example data (examples/abundance_matrix.tsv, examples/finetune_classification.parquet, …).


Raw lines 1 to 18
19## `waypoint prepare-dataset`
21Converts a sample × taxa abundance matrix into waypoint format.
23| Flag | Default | Notes |
24| --- | --- | --- |
25| `--input` | *required* | `.csv` / `.tsv` abundance matrix. |
26| `--output` | *required* | `.parquet` recommended; `.csv` supported. |
27| `--orientation` | `auto` | `auto`, `samples_as_rows`, `taxa_as_rows`. |
28| `--taxonomy_format` | `full` | `full` for lineage strings; a rank name (`genus`, `species`, …) to prefix bare names. |
29| `--no_normalize` | off | Skip row-normalisation to relative abundances. |
30| `--keep_zeros` | off | Keep zero-abundance entries in each sample's lists. |
31| `--metadata` | none | CSV/TSV/parquet of per-sample metadata, indexed by sample ID, merged in as extra columns. |
33`auto` treats the file as taxa-as-rows when the first column header is `taxonomy`, `lineage`,
34`taxon`, `otu`, or `#otu id` (case-insensitive); otherwise samples-as-rows with the first column
35as the sample ID.
37`--taxonomy_format genus` prefixes bare column names with `g__`. It disables higher-rank fallback,
38because a bare name carries no lineage to fall back to — prefer real lineage strings.
40---

waypoint prepare-dataset

Converts a sample × taxa abundance matrix into waypoint format.

FlagDefaultNotes
--inputrequired.csv / .tsv abundance matrix.
--outputrequired.parquet recommended; .csv supported.
--orientationautoauto, samples_as_rows, taxa_as_rows.
--taxonomy_formatfullfull for lineage strings; a rank name (genus, species, …) to prefix bare names.
--no_normalizeoffSkip row-normalisation to relative abundances.
--keep_zerosoffKeep zero-abundance entries in each sample's lists.
--metadatanoneCSV/TSV/parquet of per-sample metadata, indexed by sample ID, merged in as extra columns.

auto treats the file as taxa-as-rows when the first column header is taxonomy, lineage, taxon, otu, or #otu id (case-insensitive); otherwise samples-as-rows with the first column as the sample ID.

--taxonomy_format genus prefixes bare column names with g__. It disables higher-rank fallback, because a bare name carries no lineage to fall back to — prefer real lineage strings.


Raw lines 19 to 41
42## `waypoint embed`
44One fixed-size vector per sample from a pretrained checkpoint. No fine-tuning, no labels needed.
46| Flag | Default | Notes |
47| --- | --- | --- |
48| `--model` | `outpost-bio/Waypoint-6m` | Hub id or local checkpoint directory. |
49| `--data` | *required* | Waypoint-format `.parquet` / `.csv` / `.tsv`. |
50| `--output` | *required* | `.parquet`, or `.csv` if the path ends in `.csv`. |
51| `--pooling` | `last_token` | `last_token`, `mean`, `first_token`, `cls_token`. |
52| `--batch_size` | `32` | |
53| `--max_length` | `512` | Keeps at most max_length - 2 ordered entries; no guarantee discarded taxa are uninformative. |
54| `--device` | auto | `cuda`, `mps`, or `cpu`; auto-detects in that order. |
56Output columns are `dim_0 … dim_{H-1}`, indexed by sample ID. Hidden size `H` is 256 (6m),
57512 (45m), 768 (170m).
59**Behaviour worth knowing:** tokens that map to `<unk>` are *dropped* before ordering, not encoded.
60A row with no in-vocabulary taxa still produces an output row, but its sequence is `[BOS][EOS]` and
61the embedding is meaningless. Run `scripts/vocab_coverage.py` first.
63Ordering: by descending abundance z-score when `token_std_means.parquet` is present (it ships with
64every published checkpoint and with `waypoint pretrain` output), otherwise by descending raw
65relative abundance.
67---

waypoint embed

One fixed-size vector per sample from a pretrained checkpoint. No fine-tuning, no labels needed.

FlagDefaultNotes
--modeloutpost-bio/Waypoint-6mHub id or local checkpoint directory.
--datarequiredWaypoint-format .parquet / .csv / .tsv.
--outputrequired.parquet, or .csv if the path ends in .csv.
--poolinglast_tokenlast_token, mean, first_token, cls_token.
--batch_size32
--max_length512Keeps at most max_length - 2 ordered entries; no guarantee discarded taxa are uninformative.
--deviceautocuda, mps, or cpu; auto-detects in that order.

Output columns are dim_0 … dim_{H-1}, indexed by sample ID. Hidden size H is 256 (6m), 512 (45m), 768 (170m).

Behaviour worth knowing: tokens that map to <unk> are dropped before ordering, not encoded. A row with no in-vocabulary taxa still produces an output row, but its sequence is [BOS][EOS] and the embedding is meaningless. Run scripts/vocab_coverage.py first.

Ordering: by descending abundance z-score when token_std_means.parquet is present (it ships with every published checkpoint and with waypoint pretrain output), otherwise by descending raw relative abundance.


Raw lines 42 to 68
Runs code scripts/vocab_coverage.py :61
69## `waypoint finetune`
71Fine-tunes a checkpoint on your own labelled waypoint-format data.
73| Flag | Default | Notes |
74| --- | --- | --- |
75| `--model` | *required* | Hub id or local checkpoint. |
76| `--data` | *required* | Waypoint-format file containing `--target`. |
77| `--output_dir` | *required* | |
78| `--task_type` | *required* | `classification` or `regression`. |
79| `--target` | *required* | Target column name. |
80| `--covariate_column` | none | Categorical column, one-hot encoded and concatenated to the pooled embedding before the head. |
81| `--config` | task default | Flat YAML; defaults to the bundled classification/regression config. |

waypoint finetune

Fine-tunes a checkpoint on your own labelled waypoint-format data.

FlagDefaultNotes
--modelrequiredHub id or local checkpoint.
--datarequiredWaypoint-format file containing --target.
--output_dirrequired
--task_typerequiredclassification or regression.
--targetrequiredTarget column name.
--covariate_columnnoneCategorical column, one-hot encoded and concatenated to the pooled embedding before the head.
--configtask defaultFlat YAML; defaults to the bundled classification/regression config.
Raw lines 69 to 82
83### Fine-tuning config keys
85```yaml
86split_column: null # column holding train/validation/test; null = random split
87val_fraction: 0.1
88test_fraction: 0.1
90max_length: 512 # 2 <= max_length <= checkpoint n_positions
91pooling_strategy: last_token
92filter_unk_taxa: true # drop out-of-vocabulary taxa rather than feed <unk>
94seed: 42
95learning_rate: 0.00003
96num_epochs: 1 # raise this; early stopping is what should terminate training
97batch_size: 64
98warmup_steps: 1000 # lower to ~50 for small datasets
99weight_decay: 0.001
100eval_strategy: steps
101eval_steps: 400
102logging_steps: 5
103patience: 5 # eval steps without improvement before early stopping
104save_total_limit: 1
106use_lora: false
107lora_r: 8
108lora_alpha: 16 # convention: 2 * r
109lora_dropout: 0.05
110lora_target_modules: [c_attn, c_proj] # GPT-2 fused QKV and output projection
111lora_bias: none
112lora_fan_in_fan_out: true # required for GPT-2 Conv1D layouts
113```
115The shipped configs use `num_epochs: 1`, whereas the paper describes up to 300 fine-tuning
116epochs with early stopping. The default CLI config does not reproduce that training budget.
117On small datasets, choose enough epochs and a suitable evaluation interval for validation
118and early stopping to occur. Likewise `eval_steps: 400` may never fire; lower it so early stopping
119and best-checkpoint selection can actually work.
121GitHub 1.0.4 merges LoRA adapters before export. PyPI 1.0.2 saves an adapter-only model when
122`use_lora: true`; plain `AutoModel.from_pretrained` cannot load that export. Keep LoRA disabled
123for the released-package workflow, or explicitly load/merge via PEFT with the original base model.
124Both versions also require a tokenizer that actually implements vocabulary serialization.
126The fine-tuning config `seed` affects initial RNG setup and random splits, but its value is
127not passed to `TrainingArguments` either. Explicitly wire trainer seeds for controlled repeats.

Fine-tuning config keys

split_column: null        # column holding train/validation/test; null = random split
val_fraction: 0.1
test_fraction: 0.1

max_length: 512           # 2 <= max_length <= checkpoint n_positions
pooling_strategy: last_token
filter_unk_taxa: true     # drop out-of-vocabulary taxa rather than feed <unk>

seed: 42
learning_rate: 0.00003
num_epochs: 1             # raise this; early stopping is what should terminate training
batch_size: 64
warmup_steps: 1000        # lower to ~50 for small datasets
weight_decay: 0.001
eval_strategy: steps
eval_steps: 400
logging_steps: 5
patience: 5               # eval steps without improvement before early stopping
save_total_limit: 1

use_lora: false
lora_r: 8
lora_alpha: 16            # convention: 2 * r
lora_dropout: 0.05
lora_target_modules: [c_attn, c_proj]   # GPT-2 fused QKV and output projection
lora_bias: none
lora_fan_in_fan_out: true               # required for GPT-2 Conv1D layouts

The shipped configs use num_epochs: 1, whereas the paper describes up to 300 fine-tuning epochs with early stopping. The default CLI config does not reproduce that training budget. On small datasets, choose enough epochs and a suitable evaluation interval for validation and early stopping to occur. Likewise eval_steps: 400 may never fire; lower it so early stopping and best-checkpoint selection can actually work.

GitHub 1.0.4 merges LoRA adapters before export. PyPI 1.0.2 saves an adapter-only model when use_lora: true; plain AutoModel.from_pretrained cannot load that export. Keep LoRA disabled for the released-package workflow, or explicitly load/merge via PEFT with the original base model. Both versions also require a tokenizer that actually implements vocabulary serialization.

The fine-tuning config seed affects initial RNG setup and random splits, but its value is not passed to TrainingArguments either. Explicitly wire trainer seeds for controlled repeats.

Raw lines 83 to 128
129### Outputs
131These describe successful exports; see the tokenizer/LoRA limitations above.
133| Path | Contents |
134| --- | --- |
135| `best_model/` | Fine-tuned base transformer in standard HF format, plus tokenizer and `token_std_means.parquet`. |
136| `best_model/finetuned_model_state.pt` | Full torch state dict: transformer + head + covariate embedding. |
137| `validation_metrics.json`, `test_metrics.json` | Per-split scores, benchmark-equivalent. |
138| `training_log.csv`, `training_log.html` | GitHub 1.0.4 only, when log rows exist; HTML uses Plotly from a CDN. |
139| `validation_predictions.csv`, `test_predictions.csv` | GitHub 1.0.4 only; prediction order, without original sample IDs. |
140| `finetune_results.json` | Run config, label maps, covariate map, val/test scores. |
142---

Outputs

These describe successful exports; see the tokenizer/LoRA limitations above.

PathContents
best_model/Fine-tuned base transformer in standard HF format, plus tokenizer and token_std_means.parquet.
best_model/finetuned_model_state.ptFull torch state dict: transformer + head + covariate embedding.
validation_metrics.json, test_metrics.jsonPer-split scores, benchmark-equivalent.
training_log.csv, training_log.htmlGitHub 1.0.4 only, when log rows exist; HTML uses Plotly from a CDN.
validation_predictions.csv, test_predictions.csvGitHub 1.0.4 only; prediction order, without original sample IDs.
finetune_results.jsonRun config, label maps, covariate map, val/test scores.

Raw lines 129 to 143
144## `waypoint benchmark`
146| Flag | Default | Notes |
147| --- | --- | --- |
148| `--model` | `outpost-bio/Waypoint-6m` | Hub id or local checkpoint. |
149| `--config` | bundled `configs/benchmark.yaml` | Shared by all eight tasks. |
150| `--output_dir` | `outputs/benchmark` | |
151| `--tasks` | all 8 | Space-separated task numbers, e.g. `--tasks 1 6`. |
152| `--seed` | `42` | |
153| `--max_samples` | none | Caps each split; use for smoke tests only, never for a reported score. |
155`configs/benchmark.yaml` is the fine-tuning config applied identically to every task:
156`learning_rate: 3e-5`, `num_epochs: 1`, `batch_size: 64`, `warmup_steps: 1000`,
157`weight_decay: 0.001`, `patience: 5`, `pooling_strategy: last_token`, `eval_steps: 400`,
158`filter_unk_taxa: true`, `seed: 42`. The paper describes up to 300 fine-tuning epochs with early
159stopping, so the shipped one-epoch config already differs from the paper. Record the actual
160training budget and completed evaluation steps instead of claiming automatic comparability.
162The paper reports repeated runs. The CLI `--seed` seeds Torch/NumPy before tasks, but
163`TrainingArguments` does not receive that value and resets training randomness to its default
16442; YAML `seed` is unused here. Changing `--seed` alone does not establish independent training
165seeds. Use an explicitly reviewed local change passing the seed to the trainer for a seed study.
166Record the dataset/model revisions, package/dependency versions and hardware;
167unchanged YAML alone is not a claim to reproduce the paper.
169---

waypoint benchmark

FlagDefaultNotes
--modeloutpost-bio/Waypoint-6mHub id or local checkpoint.
--configbundled configs/benchmark.yamlShared by all eight tasks.
--output_diroutputs/benchmark
--tasksall 8Space-separated task numbers, e.g. --tasks 1 6.
--seed42
--max_samplesnoneCaps each split; use for smoke tests only, never for a reported score.

configs/benchmark.yaml is the fine-tuning config applied identically to every task: learning_rate: 3e-5, num_epochs: 1, batch_size: 64, warmup_steps: 1000, weight_decay: 0.001, patience: 5, pooling_strategy: last_token, eval_steps: 400, filter_unk_taxa: true, seed: 42. The paper describes up to 300 fine-tuning epochs with early stopping, so the shipped one-epoch config already differs from the paper. Record the actual training budget and completed evaluation steps instead of claiming automatic comparability.

The paper reports repeated runs. The CLI --seed seeds Torch/NumPy before tasks, but TrainingArguments does not receive that value and resets training randomness to its default 42; YAML seed is unused here. Changing --seed alone does not establish independent training seeds. Use an explicitly reviewed local change passing the seed to the trainer for a seed study. Record the dataset/model revisions, package/dependency versions and hardware; unchanged YAML alone is not a claim to reproduce the paper.


Raw lines 144 to 170
171## `waypoint pretrain`
173| Flag | Default | Notes |
174| --- | --- | --- |
175| `--model_config` | `configs/models/gpt2-6m.yaml` | Architecture YAML. |
176| `--pretrain_config` | `configs/pretraining.yaml` | Hyperparameter YAML. |
177| `--output_dir` | `outputs/pretrain` | Best checkpoint written to `<output_dir>/best_model/`. |
178| `--max_samples` | none | Limit training samples for a quick test. |
179| `--data` | none | Local waypoint-format corpus instead of downloading Atlas. |
181**Known blocker:** both reviewed upstream versions call the local tokenizer
182`save_pretrained()` before training; it raises `NotImplementedError` because `save_vocabulary`
183is missing. A repaired tokenizer and save/reload test are prerequisites.
185Intended steps: download the Atlas `pretrain` split → build a taxonomic tokenizer from the corpus →
186compute per-token abundance mean/std for z-score ordering → train GPT-2 with next-token prediction
187and early stopping → save `best_model/`.

waypoint pretrain

FlagDefaultNotes
--model_configconfigs/models/gpt2-6m.yamlArchitecture YAML.
--pretrain_configconfigs/pretraining.yamlHyperparameter YAML.
--output_diroutputs/pretrainBest checkpoint written to <output_dir>/best_model/.
--max_samplesnoneLimit training samples for a quick test.
--datanoneLocal waypoint-format corpus instead of downloading Atlas.

Known blocker: both reviewed upstream versions call the local tokenizer save_pretrained() before training; it raises NotImplementedError because save_vocabulary is missing. A repaired tokenizer and save/reload test are prerequisites.

Intended steps: download the Atlas pretrain split → build a taxonomic tokenizer from the corpus → compute per-token abundance mean/std for z-score ordering → train GPT-2 with next-token prediction and early stopping → save best_model/.

Raw lines 171 to 188
189### `configs/pretraining.yaml`
191```yaml
192training_type: next_token_prediction
193taxon_rank: genus # tokenization rank; changing it means re-pretraining
194fallback_to_higher_rank: true # use the most specific higher rank when genus is absent
195max_length: 512
196learning_rate: 0.001
197warmup_steps: 1000
198weight_decay: 0.001
199batch_size: 32
200num_epochs: 100
201patience: 10
202eval_steps: 3261
203save_steps: 3261
204logging_steps: 100
205val_split: 0.1
206seed: 42
207```

configs/pretraining.yaml

training_type: next_token_prediction
taxon_rank: genus              # tokenization rank; changing it means re-pretraining
fallback_to_higher_rank: true  # use the most specific higher rank when genus is absent
max_length: 512
learning_rate: 0.001
warmup_steps: 1000
weight_decay: 0.001
batch_size: 32
num_epochs: 100
patience: 10
eval_steps: 3261
save_steps: 3261
logging_steps: 100
val_split: 0.1
seed: 42
Raw lines 189 to 208
209### Architectures
211All share `model_type: gpt2` and `n_positions: 512`. Per-head dimension is 64 except
212`gpt2-6m-mgm.yaml`, where 256 / 8 = 32.
214| Config | Layers | Hidden | Heads | ~Params |
215| --- | --- | --- | --- | --- |
216| `gpt2-6m.yaml` | 8 | 256 | 4 | 6M |
217| `gpt2-6m-mgm.yaml` | 8 | 256 | 8 | 6M — matches the MGM baseline architecture |
218| `gpt2-10m.yaml` | 8 | 320 | 5 | 10M |
219| `gpt2-18m.yaml` | 10 | 384 | 6 | 18M |
220| `gpt2-29m.yaml` | 12 | 448 | 7 | 29M |
221| `gpt2-45m.yaml` | 14 | 512 | 8 | 45M |
222| `gpt2-79m.yaml` | 16 | 640 | 10 | 79M |
223| `gpt2-85m-gpt-small.yaml` | 12 | 768 | 12 | 85M — GPT-2 small geometry |
224| `gpt2-170m.yaml` | 24 | 768 | 12 | 170M |
226Only 6m, 45m, and 170m are published as checkpoints. The rest exist so the paper's scaling study is
227reproducible; `gpt2-6m-mgm` isolates the effect of head count against the MGM baseline.
229Parameter counts exclude token and positional embeddings, so the Hub's reported sizes are larger
230(the 6m checkpoint reports ~10.1M, the 45m ~51.8M).
232Pretraining Atlas end to end is a multi-GPU-day job. After resolving serialization, validate the pipeline with a tiny local corpus and architecture
233before a full run. `--max_samples` caps rows after `load_dataset`, so it does not bound the Atlas
234download size.

Architectures

All share model_type: gpt2 and n_positions: 512. Per-head dimension is 64 except gpt2-6m-mgm.yaml, where 256 / 8 = 32.

ConfigLayersHiddenHeads~Params
gpt2-6m.yaml825646M
gpt2-6m-mgm.yaml825686M — matches the MGM baseline architecture
gpt2-10m.yaml8320510M
gpt2-18m.yaml10384618M
gpt2-29m.yaml12448729M
gpt2-45m.yaml14512845M
gpt2-79m.yaml166401079M
gpt2-85m-gpt-small.yaml127681285M — GPT-2 small geometry
gpt2-170m.yaml2476812170M

Only 6m, 45m, and 170m are published as checkpoints. The rest exist so the paper's scaling study is reproducible; gpt2-6m-mgm isolates the effect of head count against the MGM baseline.

Parameter counts exclude token and positional embeddings, so the Hub's reported sizes are larger (the 6m checkpoint reports ~10.1M, the 45m ~51.8M).

Pretraining Atlas end to end is a multi-GPU-day job. After resolving serialization, validate the pipeline with a tiny local corpus and architecture before a full run. --max_samples caps rows after load_dataset, so it does not bound the Atlas download size.

Raw lines 209 to 234