Quick Start

Running Tasks

LlamaFactory Adapter Plugin

Configure environment variables

Before running a training task, configure these environment variables in bash:

Environment variableDescription
ECO_CLIENT_IDRegistered user email
ECO_API_KEYAPI Key authentication credential

Example:

bash
export ECO_CLIENT_ID="userxx@xx.com"
export ECO_API_KEY="XXXX"

You can also write them to ~/.bashrc and activate the shell configuration:

bash
vim ~/.bashrc
source ~/.bashrc
Security note: never commit ECO_API_KEY to repositories, shared logs, or public tickets. Use environment variables or a controlled secret manager for collaboration.

Start a training task

Replace these values based on your environment:

  • Data path
  • Model path
  • Training argument file path
  • accelerate configuration file path

Complete training example:

bash
export ECO_CLIENT_ID="userxx@xx.com" && \
export ECO_API_KEY="XXXX" && \
CUDA_VISIBLE_DEVICES=0,1 accelerate launch --config_file fsdp_config.yaml \
  --main_process_port 29501 src/train.py train_args.yaml

If the task needs to preserve the current training state so it can continue after being stopped, set the following value in train_args.yaml:

yaml
save_only_model: false

This setting saves optimizer state, learning-rate scheduler state, model weights, and other training state information.


Plugin log reference

1. Plugin imported and initialized successfully

The log includes:

text
[EcoPhase] ✅ EcoTrainAPI initialized.

2. Plugin enabled

The log includes:

text
[EcoPhase] ✅ API is enabled.

3. Plugin inactive

The log includes:

text
[EcoPhase] 🛑 API is disabled.

4. Early stop triggered

The system automatically saves the model and prints a training summary, for example:

text
✅ Task early stopped at step 200/2000. Reduction: 90.0%. Saved GPU-hours: 1.03.

This means:

FieldMeaning
200/2000The task stopped early at step 200 out of the planned 2000 steps
Reduction: 90.0%Training steps were reduced by about 90.0%
Saved GPU-hours: 1.03Estimated savings of 1.03 GPU-hours

Notes

  1. The plugin initialization code must be inserted at the correct position in trainer.py.
  2. Before running, confirm that the code uses enabled=True.
  3. Check API is enabled / API is disabled first in the logs.
  4. The plugin currently supports data parallelism only. Other parallel modes are not supported yet.
  5. The plugin currently supports Linux only.
EcoPhase Docs - Running Tasks - EcoPhase.AI