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): All Asmaul Husnain (#1243), Ercan Er (#1086), Tal (#1085), anying (#1261)
Alpamysa3cafff70907
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex dc4ed1c2..bd6e0f8b 100644--- a/CONTRIBUTORS.md+++ b/CONTRIBUTORS.md@@ -319,6 +319,7 @@ Listed by first contribution. PR numbers link the work.- `soup eval checklist` and `soup eval behavior` emitted a neutral OK and exited 0 when given no `--evidence` - a green tick that means "not evaluated" and looks identical to a pass. Both now exit 3, and the message names what to supply. **What makes it a good fix is that it still discriminates**: measured through the real CLI, no evidence -> 3, passing evidence -> 0, failing evidence -> 2, and a JSON list, malformed JSON or a missing file each exit 3 naming the real problem. The two tests that pinned the old behaviour were renamed and TIGHTENED rather than deleted, each gaining both an exit-code and a message assertion ([#1123](https://github.com/MakazhanAlpamys/Soup/issues/1123), [#1129](https://github.com/MakazhanAlpamys/Soup/pull/1129))- The last three unguarded regex sinks, and the `diagnose/format.py` one is the sharpest: its guard WAS the denial of service, because it matched the untrusted pattern against `"a" * 128` before deciding anything. Measured on main with a ten-character input, `matches_regex('short text', '(a+)+b')` never returns; twelve pattern/sink combinations hang past a ten-second timeout there and refuse in under 0.06 s here, each naming its own field. They also proved the check DISCRIMINATES - `(?:q|k)+_proj`, `force.*attraction` and `\d+` all still match - and flipped the source-grep that asserted the probe's presence into one asserting its absence, so it cannot come back quietly ([#1137](https://github.com/MakazhanAlpamys/Soup/issues/1137), [#1142](https://github.com/MakazhanAlpamys/Soup/pull/1142))- Pinned the async-disk tier's page-lock recovery behaviourally: a real `AsyncDiskSource` built from a minimal on-disk shard, only its pinned staging allocation failing, driven through the real drain into the real VRAM probe — so replacing the drain with `pass` fails on `peak.oom is False`, the exact misreport of #1003. It complements a recorder-based test that proves the call and its order; this one proves the stale error is actually gone ([#1095](https://github.com/MakazhanAlpamys/Soup/issues/1095), [#1098](https://github.com/MakazhanAlpamys/Soup/pull/1098))+ - Published the STEP 14 control-versus-repair gate (`benchmarks/harness/variant2_gate.py`) that the H100 record could only describe. Review then found its wiring counter had been blind since #1010: `StreamedDecoderLayer.named_modules()` hides the wrapper carrying `n_dequant_forward`, so `wiring_distinct` could never be true. They now walk registered children, refuse to measure a repaired arm with nothing rewired, and pin both the whole-run verdict and `_run_arm` on CPU, with 14 of 17 mutations killed ([#379](https://github.com/MakazhanAlpamys/Soup/issues/379), [#1085](https://github.com/MakazhanAlpamys/Soup/pull/1085))- **k4its1t** ([@k4its1t](https://github.com/k4its1t))- First contribution, picking up where #497 stopped one day earlier. The dtype scanner's predicate already matched anything starting with `AutoModel`, so every `AutoModelFor*` load was covered and the surviving hole was **concrete, non-Auto** classes: `Qwen2VLForImageTextToText.from_pretrained(..., dtype=)` or `BertForMaskedLM.from_config(..., dtype=)` were invisible and would have shipped a kwarg that TypeErrors below the declared transformers floor. Four suffixes, a focused regression test each, both load methods. **Their own mutation claim was the coarse one -- removing all four suffixes makes four tests fail -- and removing them one at a time is stronger than they claimed**: each single removal produces 1 failed, 15 passed, so every named test is the sole guard for its own suffix rather than the four reddening together. The two things I check on any widening they got right: the four existing false-positive controls survive untouched (a guard that fires on correct code is one people delete), and all six deleted lines are a rename plus reworded docstrings, not a test. The rename `_is_transformers_model_load` -> `_is_dtype_guarded_model_load` describes the contract being enforced instead of implying every matched class comes straight from transformers. **Scope was not oversold, which is why it is worth writing down**: none of the four suffixes appears in `src/` today and the scanner reports zero live hits, so this is prospective -- Whisper loads as `WhisperForConditionalGeneration` and #497 already covered it. Timely prospective work, though: concrete vision classes are exactly what #488, #501 and #502 are moving through right now ([#500](https://github.com/MakazhanAlpamys/Soup/pull/500))@@ -435,6 +436,7 @@ Listed by first contribution. PR numbers link the work.- Closed the hole in their **own** previous contribution. The #852 sync stamp proves *when* a translation was synced; it does not prove it still says the same thing, so a command changed inside a fence or a figure changed in prose stayed green behind a freshly recomputed stamp. Each `## ` section is now compared on code-block **contents** (with `#` comments dropped, since comments are the one part a translation may legitimately localise), link targets and prose numbers. **Two design choices are better than the obvious version**: anchors are *resolved* rather than matched, because a translated heading necessarily has a different slug and a matching check would have been permanently red; and the comment-dropping came with its own control test. They probed **false positives** rather than assuming none — nine plausible correct Turkish renderings, seven pass — which matters in a repo that has deleted a guard for firing on correct code. Told their changelog figure count was wrong, they rebased past a release that changed the figure set under them and recounted from scratch rather than patching the number: 10 figures, 18 occurrences, 11 lines, independently confirmed, with nothing but separators altered ([#870](https://github.com/MakazhanAlpamys/Soup/pull/870), follow-up to [#852](https://github.com/MakazhanAlpamys/Soup/pull/852))- The README translation gate forced a Turkish re-translation of `What's New` every release, for text that is replaced every release. That section is now exempt. **The design point worth copying:** the exempt list feeds the stamp hash, so widening it changes every stamp and cannot happen quietly. All four conditions of the issue survived mutation in review ([#1013](https://github.com/MakazhanAlpamys/Soup/issues/1013), [#1020](https://github.com/MakazhanAlpamys/Soup/pull/1020))- Arabic and Japanese READMEs, both behind the same structural ratchet that gates the Turkish one they shipped in v0.75.0 — so a `README.md` edit now has to re-translate and re-stamp three files. Coverage is structural rather than listed (`translations()` globs `README.*.md`), which I proved by appending a line to `README.md` and watching the stamp test name both new files. All four files agree exactly: 21 headings with an identical level sequence position by position, 12 fenced blocks with an identical language sequence, 20 table rows, and the same 34 URLs and 34 relative paths, every path existing on disk. The translations are real rather than nominal — 89.2% of the Arabic prose letters are Arabic, 83.4% of the Japanese are kana/kanji, and the only long Latin-script line is the preprint citation, which correctly stays in English — with 13 `<span dir="ltr">` wrappers so the DOI and version strings still read left-to-right inside RTL prose. Four mutations, four killed, and the guard names the section and the differing command rather than counting lines ([#1100](https://github.com/MakazhanAlpamys/Soup/pull/1100))+ - Built the CodSpeed trip-wire for `config/schema.py`'s import cost, the dominant leaf of `soup version`'s cold start that they measured in #780. It is one pytest-codspeed benchmark in its own non-required workflow, off until a repository variable enables it and never run on fork PRs, with no stored secret. **They corrected their own proposal in public**: the CodSpeed App's real permissions were far wider than the "read access" they had first described, so they listed them from the App's registration and left the install decision to the maintainer. The benchmark says in its own docstring what it does not measure, and the isolation test that guards its `sys.modules` restore kills all 4 mutations tried ([#1065](https://github.com/MakazhanAlpamys/Soup/issues/1065), [#1086](https://github.com/MakazhanAlpamys/Soup/pull/1086))- **KJO92** ([@Konuktor](https://github.com/Konuktor))- Stopped every in-process inference path from prompting a tuned model with a sequence it never trained on. `soup chat`, `soup serve`, `soup infer` / `soup bench`, `soup diff`, the `--mole` decoder, `soup data generate` and the `live_eval` generators behind `soup ship` / `diagnose` / `advise` all rendered the chat template to text and then let the tokenizer add its own special tokens, so a Llama-3 / Gemma / Mistral template produced a **doubled BOS** while Soup's default SFT path trains with one, and Soup's own `data.chat_template` presets (which render none) were prompted with one. **The design choice worth copying is the rule they chose over the obvious one**: not "drop a duplicate BOS" but "text a template rendered gets no tokenizer special tokens" — a startswith-BOS check would have fixed the vendor case and silently missed the presets, which need 1 -> 0, not 2 -> 1. `fallback_on_error` is keyword-only with **no default**, so none of the seven call sites could quietly inherit a different error contract, and four hand-rolled copies of the legacy fallback prompt were deleted rather than fixed a fifth time. 62 offline tests over a real fast tokenizer with a genuine BOS/EOS post-processor (30 of them red on `main`), a train/infer prefix property, and an AST ratchet with controls proving it can fail. They reported running 24 mutations; I re-ran three myself and all three were killed — the encoder reverted to pre-fix behaviour failed 23 tests. A first contribution ([#781](https://github.com/MakazhanAlpamys/Soup/issues/781), [#782](https://github.com/MakazhanAlpamys/Soup/pull/782))@@ -525,6 +527,7 @@ Listed by first contribution. PR numbers link the work.- **All Asmaul Husnain** ([@MugdhoAI](https://github.com/MugdhoAI))- First contribution. `soup draft measure` rendered the target and draft model names straight into a Rich panel, so markup in a name restyled the terminal and a raw C0 byte could spoof it. **What decided this was the version of the fix they reached for**: both names go through the shared `utils/terminal.py:for_terminal` rather than a tenth private copy of the control-strip table — nine such copies is precisely how the config loader's own escaping went missing for a whole release, and a first-time contributor choosing the shared helper unprompted is the habit this repo wants. Verified here on the tree merged against current `main`: 271 passed across the new test and every other test importing `soup_cli.utils.draft`, the startup-light guard still green despite the new module-scope import, and `test_issue896_no_duplicate_terminal_sanitizer.py` 7 passed, confirming no tenth copy. The identity and escape-only mutations both fail tests, including the raw-ESC case that their earlier head asserted incorrectly and this one gets right ([#1052](https://github.com/MakazhanAlpamys/Soup/issues/1052), [#1053](https://github.com/MakazhanAlpamys/Soup/pull/1053))+ - Second merge. `distill_mode: sequence` could not run at all on transformers 5: `apply_chat_template()` returns a `BatchEncoding` there, and reading `.shape` off it killed the first teacher prompt with a bare `AttributeError`. They read the encoding as a mapping and passed its attention mask to `generate`, kept tensor and list tokenizers working, and tested it with a real `PreTrainedTokenizerFast` and a tiny random-init Llama instead of a fake. In one follow-up push they added the fragment, the CPU `setup()` test with a val split, a content assertion and a stricter fake teacher. Verified on the tree merged with current `main`: 108 passed in `tests/test_v07112.py` and 2065 across nine related files; 8 of 12 mutations of the fix fail a test ([#1238](https://github.com/MakazhanAlpamys/Soup/issues/1238), [#1243](https://github.com/MakazhanAlpamys/Soup/pull/1243))- **Rayan-and-beyond** ([@Rayan-and-beyond](https://github.com/Rayan-and-beyond))- MCP's `tool_data_doctor` accepted any `format` argument while its sibling `tool_data_validate` had been validating the same field since #882 — so one of two adjacent tools refused a typo and the other acted on it. Brought into line: omitted still means auto-detect, blank and unknown are refused, and the error names both the rejected value and the accepted set ([#952](https://github.com/MakazhanAlpamys/Soup/pull/952))@@ -561,6 +564,7 @@ Listed by first contribution. PR numbers link the work.- **anying** ([@anyingiit](https://github.com/anyingiit))- First contribution: `--baseline registry://` kept each benchmark's oldest eval score while its provenance warning came from the newest row, so re-measuring a baseline silenced the warning and left the stale score in the gate: a candidate at 0.38 passed against 0.30 instead of regressing against the re-measured 0.45. The score and the provenance now come from the same newest row. Provenance is checked per benchmark, which caught a scorer-revision mismatch `main` missed entirely. Ties on `created_at` resolve by insertion order, and `soup eval gate` escapes the warning now that it carries benchmark names. All 8 mutations tried across two review rounds fail a test ([#1224](https://github.com/MakazhanAlpamys/Soup/issues/1224), [#1260](https://github.com/MakazhanAlpamys/Soup/pull/1260))+ - `soup data forge --judge-provider` turned every failed judge call into an empty-answer row that no `--uncertainty-threshold` could prune, then exited 0 under a green "synth complete" panel. Failed, malformed and empty replies are now counted and never become rows. A run with no usable row exits 1 and writes nothing, and a partial outage keeps the good rows under a yellow panel that names the provider, the endpoint and the first error with its cause. The failure modes were tested against a real local HTTP server for ollama and vllm. 25 of the 28 new tests fail on `main`, and every mutation of the core fix fails a test ([#1221](https://github.com/MakazhanAlpamys/Soup/issues/1221), [#1261](https://github.com/MakazhanAlpamys/Soup/pull/1261))---