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
docs(contributors): #1636, #1569, #1307 [skip ci]
Alpamys3954cdcd03a3
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex 34d53494..00b86e38 100644--- a/CONTRIBUTORS.md+++ b/CONTRIBUTORS.md@@ -125,6 +125,7 @@ Listed by first contribution. PR numbers link the work.- `soup data best-of-n` could only sample from a locally-loaded model, so anyone already serving a base through Ollama or vLLM had to load a second copy. They added `--provider` **without** disturbing the local default, reused `make_magpie_generate_fn` rather than hand-rolling a second HTTP client (so `--base-url` inherits the existing SSRF validators — `localhost.evil.com` is refused, which a prefix check would miss), and rejected `anthropic` BY NAME with a message naming the flag rather than the feature, one better than the precedent. Asked for coverage of four argument guards that a six-condition mutation had left untouched at 88 passing, they wrote tests asserting the **message**, not just `exit 2` — so a test cannot pass because the wrong guard fired ([#466](https://github.com/MakazhanAlpamys/Soup/pull/466))- Made FSDP + BNB 4-bit QLoRA dtype-compatible by resolving quantization storage and aligning trainable PEFT parameters, with recipe, documentation, and regression coverage ([#588](https://github.com/MakazhanAlpamys/Soup/pull/588))- A direct `soup export --format awq` let AutoAWQ silently download its own default calibration set — roughly 214k rows — so an export the user believed was local was network-dependent and calibrated on whatever upstream happened to ship. An explicit local JSONL is now required, and missing, empty or malformed input is refused **before** AutoAWQ is imported and before the model is loaded, so the failure costs seconds instead of a model load. The substance is theirs, in three commits. Three remaining review items — a width-fragile test rewrite, a stale "Unlike `--format awq`" line in the GPTQ refusal that this change itself made false, and the fragment move after v0.74.0 was tagged mid-review — were finished by the maintainer after a publicly announced date passed, and the merge commit names exactly which commits were whose ([#338](https://github.com/MakazhanAlpamys/Soup/issues/338), [#592](https://github.com/MakazhanAlpamys/Soup/pull/592))+ - `soup ui` opened and printed a URL with no token, so the first tab was `Unauthorized` on first paint. They made the panel and the browser launch use the `?token=` login URL (also under `--no-browser`), and corrected the review's own premise: after #1191 the server, not `app.js`, consumes the token on a loopback bind, so the docs describe the 303 + HttpOnly cookie. 4 of 4 mutations killed, including `--no-browser` being ignored, which the first version of the test could not catch ([#1194](https://github.com/MakazhanAlpamys/Soup/issues/1194), [#1307](https://github.com/MakazhanAlpamys/Soup/pull/1307))- **Shutaru** ([@Shutaru](https://github.com/Shutaru))- Kept the Transformers SFT import off the MLX dispatch route, so `backend: mlx` cannot reach the PyTorch/TRL stack even if `sft.py` stops being import-light later — and, told the PR did not fix the defect its title claimed, retitled it to match reality rather than defending the framing, leaving [#394](https://github.com/MakazhanAlpamys/Soup/issues/394) open for the unexplained hang. The `mlx-smoke` job it adds asserts mlx is *present*, not merely that torch is absent: the earlier shape went green having executed nothing ([#431](https://github.com/MakazhanAlpamys/Soup/pull/431))- Found and fixed a silent data-corruption bug in assistant-only loss masking: `BatchEncoding` is not a `dict`, so the guard missed and the mask was built from the mapping's **key strings** — no exception, normal loss curve. Split it out of #426 on request, then decided the case the issue asked to be decided rather than inherited: an all-zero mask with assistant messages present is rejected rather than honoured (measured: 0 trained tokens before, 2 after) ([#439](https://github.com/MakazhanAlpamys/Soup/pull/439))@@ -208,6 +209,7 @@ Listed by first contribution. PR numbers link the work.- `soup train --cloud lambda` held one idle SSH session for up to 25 hours with no keepalive, and read `ssh`'s exit 255 (connection lost) as a failed run, so a Wi-Fi drop or a NAT timeout terminated the instance and lost the job. They replaced it with short keepalive polls every 30 s that report cloud-init's own state, a 15-minute outage window with capped backoff that a good poll resets, and a `scp` retry window that starts at the first failure. **The value is in what review made testable**: the first version read a missing exit file as "still running" (a 25-hour paid keep-alive), and the fix for that lived in a remote shell string no test executed. The final tests run that exact command under `sh` with a fake `cloud-init`, and pin the clock reset with two ten-minute outages around one good poll. 8 of 9 mutations are caught; the survivor changes only the poll interval. The new tests fail 17 of 21 on `main` ([#1439](https://github.com/MakazhanAlpamys/Soup/issues/1439), [#1506](https://github.com/MakazhanAlpamys/Soup/pull/1506))- `training.warmup_ratio` was turned into absolute warmup steps from the raw row count in all 15 trainer wrappers, so GRPO's warmup shrank by `num_generations` (to 0 on small sets) and packed SFT and pretrain warmed up for longer than the whole run, never reaching their peak learning rate. They routed every wrapper through one helper that hands the ratio to transformers, which applies it to the real optimizer steps. **What made it mergeable was what they removed**: a second commit had patched `TrainingArguments.get_warmup_steps` process-wide to hide a rounding difference, and on review they deleted the patch. They then adopted tests that run all 15 wrappers instead of skipping 12, fixed the three seed tests the honest rounding exposed, and wrote the one-step change into the changelog. On the merged tree the issue's own reproduction reaches the configured peak with packing (3 of 6 warmup steps, where `main` used 20 of 6), GRPO resolves 20/40, 20/40 and 2/16 (`main`: 5, 2, 0), and 329 tests pass; every wiring mutation tried across two rounds is caught ([#1431](https://github.com/MakazhanAlpamys/Soup/issues/1431), [#1507](https://github.com/MakazhanAlpamys/Soup/pull/1507))- `soup diagnose` measured catastrophic forgetting on the first 12 rows of `--dataset`, the adapter's own training data, so an adapter that had lost everything else still scored `OK 1.000`. They added `--holdout` and a built-in general-knowledge prompt set, kept `--dataset` for the probes that need training rows, and validate the holdout path before any model loads. **The rounds were about the cases that measured nothing**: an unusable holdout and a probe that raised became `NOT_RUN` instead of a neutral OK, and when review showed that #1489's `--dataset` fallback loop overwrote a measured forgetting score, they fixed that too. 2809 tests pass on the merged tree, the issue's own mutation fails 5 tests, every other mutation across three rounds is caught, and the new tests fail 12 of 52 on `main` ([#1436](https://github.com/MakazhanAlpamys/Soup/issues/1436), [#1508](https://github.com/MakazhanAlpamys/Soup/pull/1508))+ - Wired `dpo_ref_regen_epochs` under LoRA, the half that their own #1294 had to refuse. trl keeps the reference as a frozen `ref` adapter and leaves `trainer.ref_model` as `None`, so the callback never copied anything. Now every Nth epoch it copies `.default.` into `.ref.` under `no_grad` with the `materialize_meta_adapter_copy` name mapping. It warns when there is no ref adapter or no source, and full fine-tuning is still refused by name. The tests run real CPU `train()` over all four DPO-family task/loss combinations, and a 999-sentinel test is the only one that catches a reversed copy. When review found two lines no test could see (the copied-count guard and the re-freeze), they pinned each with its own test in one push. 80 tests pass, 17 of them fail on `main`, and 6 of 6 mutations are killed ([#1345](https://github.com/MakazhanAlpamys/Soup/issues/1345), [#1636](https://github.com/MakazhanAlpamys/Soup/pull/1636))- **AmixDigital** ([@Amix29](https://github.com/Amix29))- Gave `soup monitor` a real Apple Silicon path, where it had reported nothing but an NVIDIA-shaped blank since v0.44.1. The security work is the part worth naming: fixed absolute executable paths so `PATH` cannot influence what runs, `sudo -n` that never prompts and never reads a password, stderr pattern-matched for permission markers but never printed, and a parser that returns `[]` against a billion-laughs entity bomb, an XXE `file:///` reference, 5,000-deep nesting and embedded NUL bytes. **Three guards had no test holding them up and they closed all three in twenty minutes** — most importantly the call site that decides which implementation every Linux and Windows user gets, where `if True or detect_apple_silicon()` had left 126 tests passing. Their oversize-payload test had also been asserting on `b"x" * (CAP + 1)`, which is not a valid plist and returns `[]` whether the cap exists or not; they rebuilt it around a valid oversized document. The test file shrank by 18 lines and **every deletion was an upgrade** — membership assertions became adjacency assertions. Asked to confirm the live plist schema, they said plainly that the Mac is not theirs and they cannot authenticate `sudo`, rather than guessing — while confirming the two things they could check against the real binary ([#481](https://github.com/MakazhanAlpamys/Soup/pull/481))@@ -348,6 +350,7 @@ Listed by first contribution. PR numbers link the work.- Removed the Web UI plugin registry that nothing rendered: `soup_cli.ui.plugins` had been importable since v0.44.0, but `create_app` never read it and a registered tab never appeared. The module, its docs section and its 11 dead tests went, exactly as the ruling listed, with `soup plugins` and `ui_env` untouched. They added a guard that keeps it gone; in review they reproduced the stale ignored `__pycache__` failure themselves before applying the suggested replacement, and they extended the route pin to every decorated Web UI path plus the static mount. 709 passed / 2 skipped across 19 files; 9 of 9 mutations caught ([#1465](https://github.com/MakazhanAlpamys/Soup/issues/1465), [#1608](https://github.com/MakazhanAlpamys/Soup/pull/1608))- Made `soup migrate --from unsloth` read real Unsloth notebooks: IPython magics were parsed as Python, so every official notebook was refused as one `SyntaxError`. Their per-cell transform treats a `!` / `%` line as a magic only at statement level. That keeps `%` / `!=` continuation lines as Python, and a magic that opens a suite becomes a `pass`, so the block stays valid. It keeps the bodies of `%%capture`-style cells, treats a backslash-continued install as one magic, and makes a real syntax error name its cell and line. All 82 official GRPO notebooks migrate (0 on `main`). On the final head 129 migrate tests pass, 217 pass on the merged tree, and 8 of 8 mutations are caught ([#1579](https://github.com/MakazhanAlpamys/Soup/issues/1579), [#1583](https://github.com/MakazhanAlpamys/Soup/pull/1583))- On transformers 5 the routed experts of an MoE are fused 3-D parameters, so `moe_lora` adapted attention only on Mixtral, MiniMax, Qwen2-MoE and Qwen3.5-MoE, and `moe_expert_quant` reported `applied to 0 expert Linear block(s)` as success. They found the fused parameters by shape, carried them on the resolved targets into `build_lora_config` so every MoE-wired trainer adapts the experts without a call-site change, widened the expert scan to return the fused block, and made the quant refuse it by name. Measured per family before and after; on the merged tree 4155 passed, 26 skipped across 72 related files, and removing the parameter merge fails 15 tests ([#1421](https://github.com/MakazhanAlpamys/Soup/issues/1421), [#1590](https://github.com/MakazhanAlpamys/Soup/pull/1590))+ - Made the provenance and compliance artifacts record only what was measured. The `--invocation` of `soup attest emit` now reaches the SLSA statement, and Annex XI / XII write `not measured` instead of zeros. The CycloneDX 1.6 ML-BOM gets an RFC 4122 serial number and canonical SPDX ids, expressions or names. The SPDX 2.3 document gets the right dependency direction and a defined `LicenseRef-` for every license it uses. The receipt fills `driver_version` on a CUDA host. Each artifact is tested against its own specification: a vendored CycloneDX 1.6 schema, a real ed25519-signed statement and the real Annex XI writer. It took five rounds, adding verbatim stdout, a small SPDX expression parser, per-operand `LicenseRef-` entries and a mixed-case operator row, each with its own mutation. On the final head: 278 passed, 0 failed across 8 files, before and after a trial merge with main; 48 of 59 new tests fail on main; in the last two review rounds 23 of 26 mutations caught, one harmless, and both survivors closed by a row added for each ([#1446](https://github.com/MakazhanAlpamys/Soup/issues/1446), [#1569](https://github.com/MakazhanAlpamys/Soup/pull/1569))- **Sohaib Kamash** ([@Nick-800](https://github.com/Nick-800))- Added seven validated Qwen2.5-Coder, Qwen2.5-Math, and DeepSeek-R1-Distill-Qwen SFT recipes; synchronized all catalog-count sites and repaired the Mistral Small model identifier. Literal repository IDs and per-recipe learning rates are now load-bearing assertions ([#536](https://github.com/MakazhanAlpamys/Soup/pull/536)).