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
moe_lora: truekeeps a stringtarget_modulesand adds the MoE targets on top of it, as it already did for a list.resolve_moe_lora_targetsmerged the MoE names into a list target (#1590) but replaced a string with the MoE list (q_proj,k_proj,v_proj,o_projand the expert FFN names) plus the fused expert parameters, and a string means something to peft."all-linear", whichtarget_modules: autoresolves to on qwen4_exp, adapts every linear layer but the output head, so a qwen4_exp base withmoe_loralost the Gated DeltaNetin_proj_qkv/in_proj_z/in_proj_a/in_proj_b/out_proj, the QSA indexer'sindex_qk_proj, the hyper-connection mixers and the PLEkey_proj/value_proj: 10 adapted modules on a tiny two-layer model, where 32 now attach. Any other string is a regex peft full-matches against each module name, and it was dropped outright. Now"all-linear"(in any casing peft accepts) is kept as it is, since it already reaches every module the MoE names reach, and only the fused expert parameters are added. A regex becomes one regex,(?:<your regex>)|(?:<the MoE names>), so peft adapts exactly what either half matches; a leading global flag such as(?i)stays with your half, and a regex that does not compile is refused at setup, namingtraining.lora.target_modules. Undermoe_loraa string never adapts a MoE router or shared-expert gate (a module whose output is routing logits, found from the model's structure, DBRX's and JetMoE's wrapped routers included), even one your regex names: they go to peft'sexclude_modules. Only where peft would still adapt a router weight with them excluded does the string become an explicit list of what it means without them:all-linearon the families peft converts from the transformers-4 layout (qwen3_moe, deepseek_v3, ...), where peft adds the router to it as a parameterexclude_modulesdoes not reach, a regex reaching a non-router namedgatethere, and VeRA, whose config has noexclude_modules. To adapt a router, name it in an explicit list. A regex that matches no module is warned about. TheScatterMoE LoRA:setup line says which of these happened. Lists are unchanged, and so is every run withoutmoe_lora. This applies to every resident trainer and, since #2072 hands it the streaming setup's resolved targets, to layer streaming. (#2095)