Environment variables#
This page catalogues the environment variables KonfAI reads or sets — the
user-facing ones you may set yourself, and the KONFAI_* runtime variables the
CLI wrappers manage. Reach for it when a run behaves differently across shells
or machines, or when you are debugging the runtime wrappers themselves.
User-facing variables#
CUDA_VISIBLE_DEVICES#
Controls which GPUs are visible to PyTorch and therefore to KonfAI.
KonfAI also rewrites this variable internally when you pass --gpu.
KONFAI_API_TOKEN#
Bearer token used by:
konfai-appsin remote modekonfai-apps-serverin bearer-auth mode
Hugging Face authentication#
The repository and CI also rely on Hugging Face-hosted assets. KonfAI itself
uses huggingface_hub, so standard Hugging Face authentication variables may be
relevant in practice, but they are not KonfAI-specific.
Runtime variables set by KonfAI#
These variables are normally set by the CLI wrappers and are not expected to be managed manually in day-to-day usage.
Variable |
Set by |
Purpose |
|---|---|---|
|
train/predict/evaluate wrappers |
Active YAML file path. |
|
train/predict/evaluate wrappers |
Root config object: |
|
train/predict/evaluate wrappers |
Active workflow state. |
|
training wrapper |
Checkpoint output directory. |
|
training wrapper |
Statistics output directory. |
|
prediction wrapper |
Prediction output directory. |
|
evaluation wrapper |
Evaluation output directory. |
|
distributed wrapper |
Mirrors the |
|
distributed wrapper |
Selected TensorBoard port. |
|
distributed wrapper |
Mirrors the inverse of |
|
cluster wrapper |
Marks cluster execution. |
Internal debug/config variables#
The codebase also references internal variables such as:
KONFAI_CONFIG_MODEKONFAI_CONFIG_PATHKONFAI_CONFIG_VARIABLEKONFAI_APPS_CONFIGKONFAI_DEBUGKONFAI_DEBUG_LAST_LAYER
These are part of KonfAI’s internal execution model and are best treated as implementation details unless you are actively extending the framework.
Next steps#
CLI reference — the wrappers that set the
KONFAI_*runtime variablesExecution flow — where in the launch sequence they are set