Complete reference for all MetaGen commands and options.
metagen [OPTIONS] COMMAND [ARGS]Bundled specs are organized under examples/specs/<domain>/. Browse the full list in
docs/reference/specs.md or start with a common spec:
metagen synth examples/specs/text/text_llm_8b.yaml --out outputs/
metagen synth examples/specs/image/object_detector_yolo.yaml --out outputs/Synthesize a complete release package from a specification.
metagen synth [OPTIONS] SPEC_PATHArguments:
SPEC_PATH- Path to model spec YAML/JSON (required)
Options:
| Option | Type | Default | Description |
|---|---|---|---|
-o, --out |
PATH | outputs |
Output directory |
--run-id |
TEXT | auto | Custom run identifier |
--seed |
INTEGER | 42 | Base seed for determinism |
Examples:
# Basic synthesis
metagen synth examples/specs/text/text_llm_8b.yaml
# Detection spec
metagen synth examples/specs/image/object_detector_yolo.yaml --out outputs/
# Custom output directory
metagen synth my_spec.yaml --out my_outputs/
# Specific seed for reproducibility
metagen synth my_spec.yaml --seed 123Output: Creates a directory with blueprint, code, docs, paper, and logs.
Run demo synthesis on bundled example specs.
metagen demoOptions: None
Output: Synthesizes packages for multiple example specs and displays summaries.
Generate only the LaTeX paper project (without full synthesis).
metagen paper [OPTIONS] SPEC_PATHArguments:
SPEC_PATH- Path to model spec (required)
Options:
| Option | Type | Default | Description |
|---|---|---|---|
-o, --out |
PATH | paper |
Paper output directory |
--seed |
INTEGER | 42 | Base seed |
Examples:
# Generate paper
metagen paper examples/specs/text/text_llm_8b.yaml --out paper/
# Time series spec
metagen paper examples/specs/time_series/time_series_forecaster.yaml --out paper/
# Build PDF (requires LaTeX)
cd paper && make pdfOutput:
main.tex- Main LaTeX filesections/- Individual section filesfigures/- Generated plotsbibliography.bib- ReferencesMakefile- Build automation
Run AutoML architecture search.
metagen automl [OPTIONS] SPEC_PATHArguments:
SPEC_PATH- Path to model spec (required)
Options:
| Option | Type | Default | Description |
|---|---|---|---|
-o, --out |
PATH | outputs |
Output directory |
--search-budget |
INTEGER | 10 | Candidates to sample |
--top-k |
INTEGER | 3 | Top candidates to display |
-O, --objectives |
TEXT | all | Objectives (comma-separated) |
--strategy |
TEXT | random |
Search strategy: random, evolution |
--generations |
INTEGER | 3 | Evolution generations |
--population-size |
INTEGER | auto | Population per generation |
--train-prototypes |
FLAG | off | Train tiny prototypes |
--prototype-steps |
INTEGER | 100 | Steps per prototype |
--seed |
INTEGER | 42 | Random seed |
Examples:
# Quick random search
metagen automl my_spec.yaml --search-budget 20
# Evolutionary search
metagen automl my_spec.yaml \
--strategy evolution \
--generations 10 \
--population-size 20
# With prototype training
metagen automl my_spec.yaml \
--train-prototypes \
--prototype-steps 200Output:
- Console table with top candidates
automl_results.jsonwith full results
Validate a specification without synthesis.
metagen validate SPEC_PATHArguments:
SPEC_PATH- Path to model spec (required)
Examples:
metagen validate my_spec.yaml
# Output: "Spec valid: my_model"
metagen validate invalid_spec.yaml
# Output: Validation errorsPrint the JSON schema for MetaGen specifications.
metagen schemaOptions: None
Every synthesis emits code/train.py with a small CLI for quick experiments.
Options:
| Option | Type | Default | Description |
|---|---|---|---|
--dataset |
TEXT | none | Curated remote dataset name or hf:<path> |
--list-datasets |
FLAG | off | List curated remote datasets |
--dataset-split |
TEXT | train |
Remote dataset split |
--dataset-size |
INTEGER | 1024 |
Max remote samples (0 = full split) |
--dataset-config |
TEXT | none | Optional Hugging Face dataset config |
--dataset-cache-dir |
PATH | none | Optional cache directory for datasets |
--sample-data |
TEXT | none | Synthetic dataset name (auto, synthetic_*) |
--sample-size |
INTEGER | 256 |
Max synthetic samples |
--data |
PATH | none | Local .txt/.bin path |
Examples:
python outputs/run-*/code/train.py --dataset auto --dataset-size 512 --epochs 1
python outputs/run-*/code/train.py --sample-data auto --sample-size 256 --epochs 1
python outputs/run-*/code/train.py --data /path/to/data.bin --epochs 1Output: JSON schema to stdout. Pipe to file or jq for formatting:
metagen schema > schema.json
metagen schema | jq .Generate model code and run training.
metagen train [OPTIONS] SPEC_PATHArguments:
SPEC_PATH- Path to model spec (required)
Options:
| Option | Type | Default | Description |
|---|---|---|---|
-o, --out |
PATH | outputs |
Output directory |
--data |
PATH | required | Training data path |
--epochs |
INTEGER | 1 | Training epochs |
--batch-size |
INTEGER | 4 | Batch size |
Use the same seed for identical outputs:
metagen synth spec.yaml --seed 42
metagen synth spec.yaml --seed 42 # Identical outputFull workflow from spec to PDF:
# Synthesize
metagen synth my_spec.yaml --out outputs/
# Find the run
RUN=$(ls -t outputs/ | head -1)
# Build paper PDF
cd outputs/$RUN/paper && make pdfIterative search workflow:
# Quick exploration
metagen automl spec.yaml --search-budget 10
# Detailed search
metagen automl spec.yaml \
--strategy evolution \
--generations 20 \
--train-prototypes
# Apply best architecture
# (manually update spec based on results)
metagen synth updated_spec.yaml| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
| Variable | Description |
|---|---|
METAGEN_SEED |
Default seed (overridden by --seed) |
METAGEN_OUT |
Default output directory |