CLI Reference
CLI Command Reference
Cross-references: Schema Reference · Training Safety · Deployment · SBERT Workflows
Entrypoint
frankenstein-transformer <subcommand> [flags]
Subcommand Overview
Subcommand |
Purpose |
|---|---|
|
Run main MLM/decoder training |
|
Fine-tune a pretrained model |
|
Convert checkpoint to deployment artifacts |
|
Export checkpoint in quantized format |
|
Run deployed model inference |
|
Train SBERT sentence embedding model |
|
Run SBERT inference (similarity/search/cluster/encode) |
|
Launch Streamlit configuration builder |
|
Export checkpoint + YAML to HuggingFace Transformers format |
Device Choices
All subcommands that involve model computation accept --device:
Value |
Behavior |
|---|---|
|
Auto-detect best available device (CUDA > MPS > CPU) |
|
Force CPU execution |
|
Force CUDA GPU |
|
Force Apple Metal Performance Shaders |
train — Main Training
Flag |
Type |
Default |
Description |
|---|---|---|---|
|
string |
— |
Path to custom YAML config file |
|
string |
|
Named preset from |
|
flag |
— |
List available config presets and exit |
|
int |
— |
Override config batch size |
|
choice |
— |
Override model class: |
|
choice |
|
|
|
flag |
— |
Enable/disable GPU thermal guard |
|
float |
— |
Temperature to pause training (°C) |
|
float |
— |
Temperature to resume training (°C) |
|
float |
— |
Temperature to abort training (°C) |
|
float |
— |
Polling interval for temperature checks |
|
flag |
— |
Enable/disable thermal-based device switching |
|
flag |
|
Also export to HuggingFace format after training |
Examples
# Train with default frankenstein preset
frankenstein-transformer train
# Train with custom config
frankenstein-transformer train --config my_experiment.yaml
# Train with GPU thermal guard
frankenstein-transformer train --config-name frankenstein --gpu-temp-guard --gpu-temp-pause-threshold-c 80
# List available presets
frankenstein-transformer train --list-configs
deploy — Deployment Artifact Creation
Flag |
Type |
Default |
Description |
|---|---|---|---|
|
string |
Required |
Path to trained checkpoint (.pt) |
|
string |
Required |
Output directory for artifacts |
|
choice |
|
|
|
flag |
— |
Validate artifact after creation |
|
string |
— |
Path to YAML config for metadata |
|
string |
— |
YAML path (required for |
|
choice |
|
|
|
flag |
|
Also export to HuggingFace format |
Examples
frankenstein-transformer deploy --checkpoint checkpoints/model.pt --output ./deployed
frankenstein-transformer deploy --checkpoint checkpoints/model.pt --output ./deployed --format standard --validate
quantize — Quantized Export
Flag |
Type |
Default |
Description |
|---|---|---|---|
|
string |
Required |
Path to trained checkpoint |
|
string |
Required |
Output directory |
|
flag |
— |
Validate after quantization |
|
string |
— |
YAML config path |
|
string |
— |
YAML path (required for |
|
choice |
|
|
|
flag |
|
Also export to HuggingFace format |
Examples
frankenstein-transformer quantize --checkpoint checkpoints/model.pt --output ./quantized --validate
infer — Model Inference
Flag |
Type |
Default |
Description |
|---|---|---|---|
|
string |
Required |
Path to deployed model artifact |
|
string |
— |
Single text input for inference |
|
string |
— |
Input file path (one text per line) |
|
string |
— |
Output file for results |
|
choice |
|
|
|
flag |
— |
Use FP16 precision |
|
int |
|
Batch size for file processing |
|
flag |
— |
Run inference benchmark |
Examples
# Single text inference
frankenstein-transformer infer --model ./deployed --text "Hello world"
# Batch file inference
frankenstein-transformer infer --model ./deployed --input texts.txt --output results.json
# Benchmark
frankenstein-transformer infer --model ./deployed --benchmark --fp16
sbert-train — SBERT Training
Flag |
Type |
Default |
Description |
|---|---|---|---|
|
string |
— |
HuggingFace model identifier |
|
string |
— |
Path to pretrained checkpoint |
|
string |
|
Output directory |
|
string |
|
HuggingFace dataset |
|
int |
|
Training batch size |
|
int |
|
Training epochs |
|
int |
|
LR warmup steps |
|
int |
|
Evaluation frequency |
|
float |
|
Learning rate |
|
int |
— |
Max training samples |
|
int |
|
Max eval samples |
|
int |
|
Max sequence length |
|
int |
|
Hidden dimension |
|
int |
|
Number of layers |
|
choice |
|
|
|
flag |
— |
Trust remote code execution |
|
flag |
— |
Disable mixed precision |
|
flag |
— |
Disable data resampling |
|
float |
|
Resampling standard deviation |
|
choice |
|
|
|
flag |
— |
Thermal-based device switching |
Examples
frankenstein-transformer sbert-train --base-model answerdotai/ModernBERT-base
frankenstein-transformer sbert-train --pretrained checkpoints/model.pt --pooling_mode cls
sbert-infer — SBERT Inference
Flag |
Type |
Default |
Description |
|---|---|---|---|
|
string |
Required |
Path to trained SBERT model |
|
choice |
Required |
|
|
string |
— |
First sentence (similarity mode) |
|
string |
— |
Second sentence (similarity mode) |
|
string |
— |
Search query (search mode) |
|
string |
— |
Corpus file (search mode) |
|
int |
|
Top-k results for search |
|
string |
— |
Sentences file (cluster/encode mode) |
|
int |
|
Number of clusters (cluster mode) |
|
string |
— |
Input file (encode mode) |
|
string |
— |
Output file for results |
|
int |
|
Batch size |
|
choice |
|
|
Examples
# Pairwise similarity
frankenstein-transformer sbert-infer --model_path ./output/sbert --mode similarity --sentence1 "Hello" --sentence2 "Hi"
# Corpus search
frankenstein-transformer sbert-infer --model_path ./output/sbert --mode search --query "machine learning" --corpus_file docs.txt --top_k 10
# Clustering
frankenstein-transformer sbert-infer --model_path ./output/sbert --mode cluster --sentences_file texts.txt --n_clusters 8
# Encode and export
frankenstein-transformer sbert-infer --model_path ./output/sbert --mode encode --input_file texts.txt --output_file embeddings.npy
web-server — Streamlit Configuration Builder
Flag |
Type |
Default |
Description |
|---|---|---|---|
|
int |
|
Streamlit server port |
|
string |
|
Bind address |
|
flag |
— |
Run without opening browser |
|
flag |
— |
Enable debug logging |
Examples
frankenstein-transformer web-server
frankenstein-transformer web-server --server-port 8080 --server-headless
transformers-export — HuggingFace Export
Flag |
Type |
Default |
Description |
|---|---|---|---|
|
string |
Required |
Path to checkpoint |
|
string |
Required |
Path to training YAML |
|
string |
Required |
Output directory |
Examples
frankenstein-transformer transformers-export --model checkpoints/model.pt --yaml config.yaml --output ./hf-export
GPU Thermal Guard Flags
Available on train and sbert-train subcommands:
Flag |
Description |
|---|---|
|
Enable GPU temperature monitoring |
|
Disable GPU temperature monitoring |
|
Temperature (°C) at which training pauses |
|
Temperature (°C) at which training resumes |
|
Temperature (°C) at which training aborts |
|
Seconds between temperature checks |
|
Enable automatic device switching on thermal events |
|
Disable automatic device switching |