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): credit seven merged contributions (#1969)
Alpamys Makazhane422881d4a98
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.mdindex 89417521..e5f47445 100644--- a/CONTRIBUTORS.md+++ b/CONTRIBUTORS.md@@ -233,6 +233,8 @@ Listed by first contribution. PR numbers link the work.- Fixed #1910: a judge task with an empty or whitespace-only prompt file scored 0.0 without judging anything, so it could pass the gate at threshold 0 or mint a baseline. They made `_run_judge_task` raise a `ValueError` naming the file and task, which `run_gate`'s no-score path turns into a closed failure with no baseline written; measured scores keep their behaviour. 30 tests, 20 failing on main; 3 mutants killed ([#1910](https://github.com/MakazhanAlpamys/Soup/issues/1910), [#1928](https://github.com/MakazhanAlpamys/Soup/pull/1928))- Fixed #1819: judge and generation HTTP calls read whole response bodies without a limit. They added `utils/http_response.py`, a streamed reader whose budget counts decoded bytes, with a `Content-Length` pre-check and the stream closed on overflow (judge cap 1 MiB, generation and Magpie 8 MiB); errors name the cap and never a body or key, provider error logs drop bodies, and Magpie drops an oversized sample within its attempt bound. **The part worth copying is the read ratchet over `httpx.post`/`httpx.get`**, which makes the next unbounded read fail a test. 61 new tests; five mutation families (decoded-budget check, `Content-Length` check, judge cap x10, Magpie re-raise, a new unbounded read) each fail named tests ([#1819](https://github.com/MakazhanAlpamys/Soup/issues/1819), [#1929](https://github.com/MakazhanAlpamys/Soup/pull/1929))- Made custom-eval JSONL errors name the `scoring` field and physical line for non-string values, before model loading or result writes ([#1900](https://github.com/MakazhanAlpamys/Soup/issues/1900), [#1926](https://github.com/MakazhanAlpamys/Soup/pull/1926))+ - Added early capability diagnostics for unsupported GGUF converter architectures while preserving the shared llama.cpp pin ([#1911](https://github.com/MakazhanAlpamys/Soup/issues/1911), [#1955](https://github.com/MakazhanAlpamys/Soup/pull/1955)).+ - Accepted leading UTF-8 signatures in JSON, CSV and TXT datasets while preserving embedded U+FEFF content ([#1922](https://github.com/MakazhanAlpamys/Soup/issues/1922), [#1954](https://github.com/MakazhanAlpamys/Soup/pull/1954)).- **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))@@ -304,6 +306,7 @@ Listed by first contribution. PR numbers link the work.- Closed #1760 (reported by abdulwaarith0): a GGUF export printed nothing while it converted and could not skip the pip step for the convert dependencies. `soup export --format gguf` now reports its phases, `--verbose` streams the converter and quantizer output with the failure summary kept (bounded tail, child terminated and reaped on an output error), and `--no-install-deps` names missing `gguf` / `sentencepiece` / `protobuf` before any merge or toolchain work without calling pip. **The part worth copying is how they closed review findings with tests that fail for the right reason**: the dropped verbose forwarding on the direct f16/f32 convert call is pinned by eight cases, the `protobuf` probe by a test that fails when its module name is renamed, when presence ignores it or when the probe is dropped, and the phase-line assertions went through the ANSI-strip helper so they hold under `FORCE_COLOR=1`. The PR says plainly that no real llama.cpp conversion was run ([#1760](https://github.com/MakazhanAlpamys/Soup/issues/1760), [#1777](https://github.com/MakazhanAlpamys/Soup/pull/1777))- **Srinivasan R** ([@Srinivasan8888](https://github.com/Srinivasan8888))+ - Connected recorded thumbs feedback to loop harvesting ([#1440](https://github.com/MakazhanAlpamys/Soup/issues/1440), [#1832](https://github.com/MakazhanAlpamys/Soup/pull/1832)).- Corrected the MCP execution-tool refusal so it gives an actionable `--allow-execute` message instead of claiming shipped tools are unimplemented ([#574](https://github.com/MakazhanAlpamys/Soup/pull/574)).- Added the `training.lisa_train_embeddings` freeze control with conservative preflight validation, parameter-count regression coverage, and user documentation ([#576](https://github.com/MakazhanAlpamys/Soup/pull/576)).- Added the catalogued SmolLM3-3B SFT recipe, exact model-ID regression coverage, and user-facing documentation ([#582](https://github.com/MakazhanAlpamys/Soup/pull/582)).@@ -395,6 +398,7 @@ Listed by first contribution. PR numbers link the work.- The CUDA out-of-memory and `OutOfMemoryError` hints in `utils/errors.py` never named `data.max_length`, the lever left at batch size 1 on a large-vocabulary model, where logits and loss scale with sequence length. They added "lower data.max_length" to both entries and pinned the text with tests that check the message each error path prints as well as the ERROR_MAP entries themselves ([#1694](https://github.com/MakazhanAlpamys/Soup/issues/1694), [#1708](https://github.com/MakazhanAlpamys/Soup/pull/1708))- **Tal** ([@taljeon](https://github.com/taljeon))+ - Prevented duplicate eval-gate task names from overwriting baseline evidence ([#1824](https://github.com/MakazhanAlpamys/Soup/issues/1824), [#1893](https://github.com/MakazhanAlpamys/Soup/pull/1893)).- First contribution, and it closed a gap in a guard that was **one day old**: the `dtype=` scanner from #489 matched only class names starting with `AutoModel`, so the same load-breaking kwarg on a CONCRETE class — `WhisperForConditionalGeneration.from_pretrained` in the ASR training path — was invisible to it. They took the **suffix rule** rather than a name allowlist, which is the harder and correct choice: an allowlist silently stops covering a class added later. Verified with a negative control rather than by inspection — `dtype="auto"` on the real Whisper site fails by name on their branch and **survives on `main`**, so the gap was real. Two things I check on every widening they got right unprompted: the existing `AutoModel*` coverage was not traded away for the new coverage, and the scanner still ignores `FastLanguageModel`, `PeftModel`, `torch.zeros` and wrapper kwargs — a guard that fires on correct code is one people delete. All six deleted lines are renames or a reworded message; the file goes 11 tests to 12 ([#497](https://github.com/MakazhanAlpamys/Soup/pull/497))- Soup's own two shipped preference examples tripped Soup's own linter: `soup data lint` reported MINOR length bias on `dpo_sample.jsonl` and `preference_sample.jsonl`, so anyone following the examples learned the shape of a dataset the tool flags. **The easy fix was padding, and they did not take it.** Every `rejected` completion is rewritten to be similarly detailed and still clearly worse — specific factual or methodological errors, not brevity — which is exactly the anti-padding property #929 made an acceptance criterion; `chosen` is byte-identical in all 13 rows. Sampling one: *"plants absorb sunlight through their roots... the reaction occurs in the cell wall"* — confident, detailed, wrong. The regression test is tighter than I expected: reverting **one row in eight** moves the mean from 66.9 to 60.2, a 9.3% gap below MAJOR but above the MINOR floor, and it still fails. They also chose to drive `run_lint` as a library function rather than the CLI, which is faster and sidesteps the ANSI-assertion trap entirely, with the verdict-to-exit-code mapping already covered elsewhere ([#929](https://github.com/MakazhanAlpamys/Soup/issues/929), [#940](https://github.com/MakazhanAlpamys/Soup/pull/940))- A sweep arm whose loss went to NaN or infinity sorted to the **top** of the summary and could be selected as the best run. A divergence is the single outcome a hyperparameter search must never recommend, and it was being recommended — silently, because the row looked like any other. Ordering is now explicit (finite losses numerically first, non-finite completed arms after, failed rows still visible at the end), a non-finite arm is labelled `diverged` and cannot carry the best-run marker, and it counts as explicitly *worse* than the early-stop threshold so early stop can no longer be triggered or suppressed by a number that is not one. **Two things raise this above the fix itself.** The colour assertions route through the shared `tests/conftest.py:strip_ansi` rather than a private copy — the difference between this and two other PRs I had to flag the same day — and they were shown to discriminate rather than assumed to: under `FORCE_COLOR=1` the fixed head passes 5 while the pre-fix tree fails on `'skipping 3 remaining run(s)' in '┌────...'`. And four non-blocking notes from an earlier round were left alone once the head stopped touching `src/`, rather than swept into an unrelated diff ([#944](https://github.com/MakazhanAlpamys/Soup/issues/944), [#946](https://github.com/MakazhanAlpamys/Soup/pull/946))@@ -521,6 +525,7 @@ Listed by first contribution. PR numbers link the work.- Closed the pretrain half of the LLaMA Pro and full-fine-tune family. `task: pretrain` accepted `lora.r: 0` and `expand_layers`, then failed inside peft at trainer start, with an error that named neither Soup nor the field. The change refuses both at config load, **and the part to read is how they bounded it**: LISA genuinely trains pretrain with `lora.r: 0` (no adapter is attached), so they kept it loading and proved it through the real `PretrainTrainerWrapper.setup()` and one epoch instead of by argument, left `stream_layers` and mlx to their own messages, and reworded #1783's fragment when the change made its pretrain clause false. In review they made the pretrain sentence conditional on transformers text (it was false on unsloth), restored the sft negative assertion and showed that widening the refusal to dpo, classifier and asr is already caught by three existing controls. 18 tests, 8 failing on `main`; 16 mutations, all killed ([#1813](https://github.com/MakazhanAlpamys/Soup/issues/1813), [#1875](https://github.com/MakazhanAlpamys/Soup/pull/1875))- Part 1 of #1764: `soup registry push --run-id` left `data_hash` null; they added `--data PATH` (refused before any database opens), passed it through `register_from_run`, and showed the hash in `soup registry show`, worded as the registered input rather than proof; six mutations all killed ([#1764](https://github.com/MakazhanAlpamys/Soup/issues/1764), [#1907](https://github.com/MakazhanAlpamys/Soup/pull/1907))- Made ambiguous registry `name:tag` lookups refuse with candidate IDs and added `RegistryStore.list(run_id=...)` ([#1763](https://github.com/MakazhanAlpamys/Soup/issues/1763), [#1934](https://github.com/MakazhanAlpamys/Soup/pull/1934))+ - Added opt-in idempotency keys for registry pushes, with retry reuse and explicit conflicts ([#1763](https://github.com/MakazhanAlpamys/Soup/issues/1763), [#1964](https://github.com/MakazhanAlpamys/Soup/pull/1964)).- **GitFromRatatouille** ([@swalla02](https://github.com/swalla02))- First contribution, and it is the third instance of this repo's most persistent bug class found by someone else ([#363](https://github.com/MakazhanAlpamys/Soup/issues/363), [#423](https://github.com/MakazhanAlpamys/Soup/issues/423), [#659](https://github.com/MakazhanAlpamys/Soup/issues/659)): `soup migrate` refused **any** input named `*.jsonl`, a valid LLaMA-Factory YAML config included, because the guard branched on the filename while the content sniff written to gate it had **zero call sites in `src/`**. The diagnosis is worth more than the one-line fix — the test was named after the command and its body called the helper, so it passed on a codebase where `migrate` never imported it. **Then review found a regression their own fix introduced, and the way they closed it is the part to copy**: the sniff read `utf-8`, so a UTF-8 BOM survived as U+FEFF, which `str.strip()` does not remove, and a real BOM'd JSONL silently lost the friendly error it used to get — on a project with three Windows CI cells where PowerShell's `Out-File` writes that BOM by default. Their BOM test **guards its own fixture** (asserting the file really contains a BOM before asserting behaviour) and their bounded-read test measures the property with `tracemalloc` rather than pinning the spelling of the loop. Six mutations, six killed; zero assertions removed. They also **declined to widen the fix** to files whose name gives no hint, correctly citing the `.ipynb` case the original comment warns about, and left that as an open question rather than guessing ([#672](https://github.com/MakazhanAlpamys/Soup/issues/672), [#675](https://github.com/MakazhanAlpamys/Soup/pull/675))@@ -816,6 +821,7 @@ Listed by first contribution. PR numbers link the work.- `--fsdp` was accepted and silently dropped on `task: prm` and `task: moe_lora_routing`, and `--fsdp` and `--deepspeed` on `task: online_dpo`: the wrappers stored `fsdp_config` / `deepspeed_config` and never handed them to their trainer arguments. The fix spreads `**(self.fsdp_config or {})` into the `TrainingArguments` of `prm.py` and `mole_routing.py` and forwards both to `OnlineDPOConfig`, exactly as `dpo.py` does. The four new tests build each real wrapper over a tiny Llama and record the arguments-class kwargs, so no FSDP or DeepSpeed runtime is needed; 3 of 4 fail on `main`, the "neither set" control passes on both, and all 6 mutations of the fix fail a test ([#1204](https://github.com/MakazhanAlpamys/Soup/issues/1204), [#1417](https://github.com/MakazhanAlpamys/Soup/pull/1417))- **Abhinay Kumar** ([@abhinyaay](https://github.com/abhinyaay))+ - Made gate-command errors name missing or corrupt inputs and identify missing training modules ([#1830](https://github.com/MakazhanAlpamys/Soup/issues/1830), [#1833](https://github.com/MakazhanAlpamys/Soup/pull/1833)).- First contribution: `soup audit-log tail --json`, `soup bom emit`, `soup eval leaderboard --format json|csv` and `soup profile --json` printed machine-readable output through Rich's `console.print`, so piped, a record over 80 columns was folded across lines (invalid JSONL / JSON, CSV rows split into fragments) and `[...]` in a value was swallowed, or crashed the command with `MarkupError` on `[/x]`. They moved the four sites to `typer.echo`, named the two sibling sites they left out, and pinned each command at console width 80; the 4 tests fail on main and pass, and reverting each site fails its test (4 of 4) ([#1468](https://github.com/MakazhanAlpamys/Soup/issues/1468), [#1470](https://github.com/MakazhanAlpamys/Soup/pull/1470))- **Urooj Fatima Mukhtar** ([@UroojFatima-052](https://github.com/UroojFatima-052))@@ -889,6 +895,7 @@ Listed by first contribution. PR numbers link the work.- Closed #1596: square-bracket text in a model reply, a prompt file or a dataset key was read as Rich markup, so `arr[i]` lost its `[i]` and a closing-tag shape such as `[/INST]` or `[/b]` ended `soup chat`, `soup diff -o`, `soup eval human -o`, `soup data inspect` and `soup data validate` with exit 1, losing the results or judgments typed so far. They routed every such value through `for_terminal` (not plain `escape()`, so ESC and other control bytes are stripped too) at the chat reply and `/system` echo, the diff prompt line, panels, titles and summary headers, the eval human panels, and the data Columns, error and issue lines, and kept the `[dim]<empty>[/]` placeholder as markup. **The part worth copying is how the written output is pinned**: the tests read the `diff -o` JSONL and the `eval human -o` file back and compare the original strings (with `[/INST]`, `arr[i]`, backslashes and an ESC byte), so escaping or stripping the output fails them, and one ESC-bearing input goes through every site with `chr(27) not in out` asserted per command. In the review run, 83 tests passed with the neighbouring chat, diff, hygiene and fragment tests, and 39 of 45 mutations failed a named test; the six survivors are four equivalents and the untested empty-reply placeholder ([#1596](https://github.com/MakazhanAlpamys/Soup/issues/1596), [#1602](https://github.com/MakazhanAlpamys/Soup/pull/1602))- Closed #1792: seven CLI help strings held literal bracketed text (`[deprecated]`, `[doc-id]`, `[doc-N]`, `soup-cli[sigstore]`, `[data-pro]`) that Rich read as a style tag and dropped, so `--api-key` no longer said it was deprecated and the `--citation-style` help showed `()` instead of `([doc-id])`. They escaped all seven, including the two inside command docstrings, and added a ratchet that walks the live Click tree (2578 help strings, Click and Typer declarations) and fails on any bracketed tag Rich would drop. Review checked it: 19 passed on the merged tree and 8 failed on clean main; un-escaping each of the seven strings was caught by two tests (7 of 7); the rendered text of all 1419 command and option help strings changed in exactly those seven places ([#1792](https://github.com/MakazhanAlpamys/Soup/issues/1792), [#1840](https://github.com/MakazhanAlpamys/Soup/pull/1840))- Added schema descriptions for seven previously undocumented `soup.yaml` fields, including the core training settings ([#1794](https://github.com/MakazhanAlpamys/Soup/issues/1794), [#1831](https://github.com/MakazhanAlpamys/Soup/pull/1831))+ - Refused invalid benchmark, recipes-verify and CUDA-graph requests before heavy imports or model loading ([#1817](https://github.com/MakazhanAlpamys/Soup/issues/1817), [#1841](https://github.com/MakazhanAlpamys/Soup/pull/1841)).- **John Coplin** ([@johncoplin](https://github.com/johncoplin))- First contribution: the friendly-error formatter's `HTTP 401`/`HTTP 403` text patterns let two whitespace groups compete for the same run, so an exception message with `HTTP` followed by a long whitespace run and no status took about 13 s to print at 50,000 spaces. Since #1366, that check runs for every exception in the chain. They claimed the issue, rewrote both patterns so the optional whitespace is consumed only after a `:`/`=` separator, and added a timing test that fails on `main`. **The part worth copying is the equivalence test**: all 15 phrasings from the issue run against the old and the new pattern for both 401 and 403, so the speed-up provably changes nothing about what gets classified. 31 tests (1 fails on main), 7 of 7 mutations killed ([#1367](https://github.com/MakazhanAlpamys/Soup/issues/1367), [#1594](https://github.com/MakazhanAlpamys/Soup/pull/1594))diff --git a/changelog.d/0.76.0/1833.fixed.md b/changelog.d/0.76.0/1833.fixed.mdindex d898b0af..072a9f4e 100644--- a/changelog.d/0.76.0/1833.fixed.md+++ b/changelog.d/0.76.0/1833.fixed.md@@ -1 +1 @@-- Gate-style commands now name the problem in their error text instead of printing a bare value: `soup expect` reports `data file not found: <path>` / `suite file not found: <path>` for a missing input, `soup lock check`/`soup lock show` name a corrupt lock file and say its JSON is invalid, and `soup draft measure`/`soup draft distill` point at the missing `[train]` extra when `transformers` is absent. `soup expect`'s module docstring is also corrected (a suite failure exits 2, not 3). Exit codes are unchanged (#1830 in #1833).+- Gate-style commands now name the problem in their error text instead of printing a bare value: `soup expect` reports `data file not found: <path>` / `suite file not found: <path>` for a missing input, `soup lock check`/`soup lock show` name a corrupt lock file and say its JSON is invalid, and `soup draft measure`/`soup draft distill` point at the missing `[train]` extra when `transformers` is absent. `soup expect`'s module docstring is also corrected (a suite failure exits 2, not 3). Exit codes are unchanged (#1830 by @abhinyaay in #1833).