Sft and pretraining

From VectorSpaceLab/AREX-Skill · View interactive version

Sft and pretraining is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Guides agents creating Axolotl SFT and continual pretraining configs, LoRA or QLoRA recipes, preprocessing workflows, checkpoint resumes, sample packing, and stability triage.

How to use this skill

Skill file

SFT and Pretraining

Use this sub-skill when the task is to fine-tune with Axolotl using supervised fine-tuning, adapt a pretraining recipe, create a LoRA or QLoRA starter config, debug SFT/pretraining loss behavior, reason about checkpoint resume fields, or decide whether to run preprocessing before training.

Axolotl is config-driven: produce or edit a YAML config first, validate it, then use the same config with axolotl preprocess, axolotl train, axolotl inference, and axolotl merge-lora as appropriate.

Read First

Route Boundaries

Quick Workflow

  1. Pick the workflow: SFT via datasets, non-streaming pretraining via datasets: [{type: completion}], or streaming pretraining via pretraining_dataset.
  2. Choose the training mode: LoRA for a common adapter baseline, QLoRA for 4-bit memory pressure, or full fine-tune when all weights should update and hardware allows it.
  3. Create a config with base_model, dataset source/type, output_dir, sequence/batch settings, optimizer/LR, precision, checkpoint fields, and adapter fields when needed.
  4. Run axolotl preprocess <config.yaml> for non-streaming data when you want to validate tokenization, label masking, or reusable dataset_prepared_path before training.
  5. Run axolotl preprocess <config.yaml> --debug when label masking, chat template behavior, or empty/overlong examples are suspected.
  6. Only after validation, run axolotl train <config.yaml> in the user’s prepared Axolotl environment.

For a starter YAML, use:

python sub-skills/sft-and-pretraining/scripts/make_minimal_sft_config.py \
  --base-model NousResearch/Llama-3.2-1B \
  --dataset-path ./chat.jsonl \
  --dataset-type chat_template \
  --adapter qlora \
  --output-dir ./outputs/chat-qlora

The helper only writes YAML to standard output or to a requested file; it does not inspect models, access the network, load datasets, or train.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.