Train adapters
Fine-tune with LoRA / QLoRA. You write a small config; the toolchain owns the Python stack.
One-time setup
buraaq ai doctor --fix
Creates ~/.buraaq/ai-venv and installs Transformers, PEFT, TRL, bitsandbytes (and friends). You do not hand-write pip install for the happy path.
Doctor then reports train: ready.
Config
buraaq.ai.toml in the project root:
model = "Qwen/Qwen3-8B"
data = "train.jsonl"
method = "lora"
method may be lora, qlora, or full (full only when VRAM allows; the planner usually selects QLoRA on consumer GPUs).
Dataset
JSONL chat samples:
{"messages":[{"role":"user","content":"Hi"},{"role":"assistant","content":"Hello"}]}
buraaq ai dataset validate train.jsonl
buraaq ai dataset inspect train.jsonl
buraaq ai dataset split train.jsonl
Validation catches malformed JSON, empty content, bad role order, duplicates, oversized lines.
Plan then run
buraaq ai train --plan-only
buraaq ai train --yes
The plan prints method, batch, grad accumulation, context, and estimated VRAM. --yes skips the confirm prompt.
Outputs:
target/ai/adapters/<run_id>/adapter_config.json+SHA256- Registry line under
~/.buraaq/ai/adapters.jsonl
Honest limits
- Peer Python process (not native Buraaq CUDA kernels yet)
- No DeepSpeed / full multi-node trainer in this release
- Needs CUDA for practical QLoRA; CPU is discouraged
