CLI reference#
This page lists the main command-line entrypoints used in the repository. Use it as the quick map of “which command should I run?”.
KonfAI uses four main command-line entrypoints:
konfaikonfai-appskonfai-apps-serverkonfai-cluster
konfai#
Low-level workflow runner for training, prediction, and evaluation.
Use konfai when you are still designing a workflow directly from YAML.
Commands#
Command |
Purpose |
|---|---|
|
Train a model from scratch. |
|
Resume training from a checkpoint. |
|
Run inference using one or more checkpoints. |
|
Compute metrics on saved outputs. |
Common options#
Option |
Meaning |
|---|---|
|
YAML file to use. |
|
Overwrite existing outputs without prompting. |
|
One or more GPU ids. |
|
Number of CPU workers when not using GPUs. |
|
Reduce console output. |
|
Launch TensorBoard. |
Default config file per command#
If -c/--config is omitted, each command falls back to a fixed filename in the
current directory:
Command |
Default config |
Root key |
|---|---|---|
|
|
|
|
|
|
|
|
|
Note
The --config help text mentions Train.yml, but the real TRAIN default is
./Config.yml. Also remember that reading a config rewrites it on disk —
after a run your YAML will contain the resolved defaults. See
Configuration model.
Command-specific options#
TRAIN
--checkpoints-dir/--checkpoints_dir(default./Checkpoints/)--statistics-dir/--statistics_dir(default./Statistics/)
RESUME
--model— checkpoint path to resume from (required)--lr— override the learning rate on resume (omit to keep the checkpoint LR)-checkpoints-dir/-statistics-dir— note the single leading dash here (an inconsistency with TRAIN’s--forms; both parse, but invoke them exactly as written)
PREDICTION
--models— one or more checkpoint paths (required); multiple = ensemble--predictions-dir/--predictions_dir(default./Predictions/)
EVALUATION
--evaluations-dir/--evaluations_dir(default./Evaluations/)
Note
Device selection quirks. The CLI default is CPU (--gpu defaults to an
empty list); pass --gpu 0 to use a GPU. Valid --gpu ids are frozen at startup
from the visible CUDA devices, so an id that isn’t visible is rejected by argparse.
--cpu must be > 0. --version works on the root parser (konfai --version)
but not on a subcommand.
konfai-apps#
Higher-level packaged workflow runner.
Use konfai-apps when a workflow is already packaged as a KonfAI App and you
want a simpler interface than the low-level YAML CLI.
This command is provided by the standalone konfai-apps package.
Commands#
Command |
Purpose |
|---|---|
|
Run inference for an app. |
|
Run evaluation for an app. |
|
Run uncertainty estimation for an app. |
|
Chain inference, evaluation, and optional uncertainty. |
|
Fine-tune an app on a dataset. |
Important command-specific options#
infer
--ensemble--ensemble-models--tta--mc-uncertainty--prediction-file(alias:--prediction_file)
eval
--gt--mask--evaluation-file(alias:--evaluation_file)
uncertainty
--uncertainty-file(alias:--uncertainty_file)
pipeline
combines the options from
infer,eval, anduncertainty
fine-tune
positional
name-d,--dataset--models— checkpoint name(s) to fine-tune, e.g.CV_0 CV_1(default: first available)--epochs--it-validation--config(aliases:--config-file,--config_file)
konfai-apps-server#
FastAPI server exposing packaged apps remotely.
This command is the server-side counterpart of konfai-apps --host ....
It is also provided by the standalone konfai-apps package.
Important options:
Option |
Meaning |
|---|---|
|
Bind address. |
|
Bind port. |
|
|
|
Environment variable holding the token. |
|
Development-only token override. |
|
JSON file listing the available apps. |
|
Pre-download configured apps at startup. |
|
Validate configured apps without downloading them. |
konfai-cluster#
Cluster-oriented wrapper around the low-level konfai commands.
It adds job-submission options such as:
--name--num-nodes--memory--time-limit--resubmit
The cluster command depends on the optional cluster extra.
ONNX export is not a subcommand#
konfai/export.py can export a trained model to ONNX (+ a manifest) for the
konfai-rs portable-inference path, but it is a Python-API-only feature —
there is no konfai export subcommand. See Python API (apps).
Next steps#
Built-in component catalogue — the component names those YAML configs can reference
Environment variables — the variables these wrappers read and set
Using KonfAI Apps — the guided workflow behind
konfai-apps