Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.
Python cliconsumer-gpudpofine-tuningggufhuggingfacellmllmopslocal-ailocal-llmloralow-vrammachine-learningollamapeftpythonpytorchqlorasfttransformers
training.freeze_layers/training.freeze_ratiodid nothing on a LoRA run: the freeze was set beforeget_peft_model, which then attached a fresh trainable adapter to every targeted module in every layer, the frozen ones included (#1432 by @AmirF194 and @VanshSharmaPES in #2145). The SFT trainer now passes the layers the freeze plan left trainable to peft aslayers_to_transform, so a frozen layer gets no adapter. On a 2-layer Llama with LoRA onq_proj/v_proj,freeze_layers: 1(orfreeze_ratio: 0.5) takes the trainable LoRA parameters from 1,024 to 512 and layer 0 no longer changes. A config that setsfreeze_layers/freeze_ratiotogether with LoRA now trains fewer layers than it did before, which is what the option always documented. Shapes peft cannot restrict by layer are refused when the model is built rather than ignoring the freeze: a stringlora.target_modules(a regex, orall-linear, including the valueautoresolves to for some architectures), a list target that resolves only outside a numbered decoder layer (such asembed_tokens),lora.target_parameters,lora.use_vera, and a plan that freezes every layer. A top-levellm_headtarget is accepted and keeps its adapter. Full fine-tuning (lora.r: 0) is unchanged.