AIM Fine-tuning Standardized SFT Image Interface#
This page is the SFT image parameter reference. For the surrounding workflow, see the CLI reference, recipe schema reference, and engine concepts. engine-specific launch details are documented in the engine reference.
Environment Variables#
The environment variables use a common prefix of AIMFT_ to avoid overloading variable names and to indicate which variables correspond to AIM Fine-tuning parameters. Certain other environment variables such as HF_TOKEN might be used by AIM Fine-tuning, but derive from other sources and thus do not use the prefix.
Environment Variable Value Encoding#
The values of the environment variables are encoded in JSON. The values can any of the basic types representable in JSON: string, integer, float, object (i.e. dictionary mapping), array (i.e. list), boolean, null. Additionally, values may be unset.
Table of SFT Image Environment Variables#
Key |
Type |
Default value / Required |
Behaviour |
|---|---|---|---|
Required |
These variables must be set. |
||
|
string |
Required |
Path inside the container to the training data file, in the SFT Data Format. |
|
string |
Required |
Path inside the container to the directory that contains the model, in the Hugging Face format. |
|
string |
Required |
AIM ModelID, the canonical identifier of the model weight set. |
|
string |
Required |
Path inside the container to the directory where outputs are produced. |
Optional |
These additional variables may be set, but are not required. If not set, they take a default value. |
||
|
string|unset |
unset |
If set, manually override recipe selection and attempt to use the recipe corresponding to this ID. |
|
string |
“SFT” |
The training algorithm or method to use. In SFT images this is set to “SFT” by default. |
|
string |
False |
If True, chooses an adapter recipe (typically LoRA). If False, chooses a full model recipe. |
|
string|null |
null |
Path inside the container to the validation data in the SFT Data Format. A null value indicates no separate validation data file is used and validation is not done. |
|
integer |
1 |
Sets the number of times to iterate over the training data. |
|
integer |
42 |
Sets the random seed. |
|
integer |
1000 |
Sets the number of optimization steps between evaluations. |
|
integer |
25 |
Sets the number of optimization steps between log outputs. |
|
integer |
500 |
Sets the number of steps between intermediate checkpoint outputs. If set to -1, no checkpoints are saved. |
|
float |
Recipe-dependent |
Sets the learning rate. |
|
integer |
Recipe-dependent |
Sets the number of initial training steps over which learning rate is ramped up. |
|
integer |
Recipe-dependent |
Sets the batch size per accelerator. Total batch size is |
|
integer |
Recipe-dependent |
Sets the number of batches over which gradients are accumulated before taking an optimizer step. |
|
integer |
Recipe-dependent |
Sets the alpha parameter of the LoRA Adapter. |
|
float |
Recipe-dependent; 0.0 if unset and LoRA is enabled |
Sets the dropout probability of the LoRA Adapter. |
|
integer |
Recipe-dependent |
Sets the rank parameter of the LoRA Adapter. |
|
integer |
Recipe-dependent |
Sets the maximum context length in tokens. Examples longer than this are filtered or truncated. |