Skip to content
Back to skills

Sft And Pretraining

ASecurity

"Guides agents creating Axolotl SFT and continual pretraining

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
toolspythonbashperformance

Works with

  • cli

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill sft-and-pretraining --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Sft And Pretraining?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Sft And Pretraining
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-sft-and-pretraining/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-sft-and-pretraining)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sft-and-pretraining
description: "Guides agents creating Axolotl SFT and continual pretraining
  configs, LoRA or QLoRA recipes, preprocessing workflows, checkpoint resumes,
  sample packing, and stability triage."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# 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

- [references/workflows.md](references/workflows.md) for SFT, completion-style pretraining, streaming pretraining, validation order, and checkpoint/resume workflow.
- [references/training-options.md](references/training-options.md) for LoRA/QLoRA/full fine-tune choices, core config fields, packing, batch sizing, output fields, and preprocessing reuse.
- [references/troubleshooting.md](references/troubleshooting.md) for NaN/loss spikes, OOM, tokenizer mismatch, packing length issues, dataset-prepared reuse, checkpoint confusion, and network/model path problems.
- [scripts/make_minimal_sft_config.py](scripts/make_minimal_sft_config.py) for a safe local helper that emits a starter SFT YAML without downloading models, loading datasets, or starting training.

## Route Boundaries

- Use this sub-skill for default SFT, chat-template/input-output/completion training flow, continual pretraining, minimal config construction, `axolotl preprocess` before expensive runs, `output_dir`, checkpoints, resume, `dataset_prepared_path`, and SFT/pretraining stability triage.
- Route dataset schema details, custom field mappings, and prompt-format mechanics to `data-and-configs`.
- Route DPO, IPO, KTO, ORPO, SimPO, reward modeling, GRPO, and EBFT to `preference-tuning` or `rl-and-rewards`.
- Route model architecture quirks, tokenizer/model loading internals, LoRA target-module internals, and adapter compatibility to `model-loading-and-adapters`.
- Route DeepSpeed/FSDP launch topology, throughput tuning, vLLM serving, and distributed performance to `distributed-and-performance`.
- Route complete CLI catalog, installation, fetching examples, inference UI, and operational command details to `cli-and-operations`.

## 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:

```bash
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.

Files in this skill

  • SKILL.md3.8 KB
  • references/training-options.md6 KB
  • references/troubleshooting.md7.6 KB
  • references/workflows.md6.1 KB
  • scripts/make_minimal_sft_config.py8.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…