Skip to content

Adapter Lifecycle Finish (v0.67.0)

Six surfaces that complete what v0.57 soup adapters started. Adapters are now first-class versioned, collaborative, multi-tenant, evolvable, lockfile-tracked, bisect-able artifacts. We are not aware of a hosted vendor offering this set: evolutionary merge is mostly research demo, VeRA-style storage cuts against per-GPU-hour pricing, MoLE routing needs both a training and a serving stack, and adapter PRs need weights, eval and history together.

CMA-ES merge — evolutionary search over LoRA weights

bash
soup adapters merge ./lora_a ./lora_b ./lora_c --strategy cmaes \
  --eval ./tasks.jsonl --budget 1h --output ./merged

Sakana-style evolutionary merge. Pure-Python rank-mu CMA-ES (no cma dependency). Softmaxes N-1 logits onto the simplex, samples a population, keeps the elite half, plateau-detects after 3 generations without improvement (converged=True).

  • 2..16 adapters; population [2, 256]; generations [1, 10K]
  • soup adapters merge needs NumPy and the safetensors package; since v0.77.1 a missing one is named before any file is scanned (numpy and safetensors packages required; pip install "soup-cli[train]" (or pip install safetensors numpy), exit 1), see Adapters
  • Since v0.77.2 --output must not be one of the input adapters: soup adapters merge exits 1 with Output path refused: --output 'x' is the same file as adapter ... ; choose a different --output instead of overwriting that adapter's weights and config in place (#2379 by @ShryukGrandhi; the same holds for soup adapters arithmetic)
  • Budget [60s, 24h] — reuses v0.57 blame.parse_budget
  • Since v0.78.0 (#2927, reported as #2908 and #2935) soup adapters merge scales each input's own term by its weight, where through v0.77.2 linear, dare and svd scaled it by the weight squared (--weights 0.7,0.3 kept 0.49 and 0.09 of the two inputs' own deltas, and equal weights kept a quarter of each of two inputs). The numbers of every merge of two or more inputs with those strategies change, ties is unchanged, and the weights an earlier --strategy cmaes run printed reproduce a different adapter: upstream says to re-run merges whose output you compare or ship. Inputs the merge cannot combine, a LoRA rank that differs on a shared module, no tensor name in common or a shared tensor with two shapes, are refused with exit 2 and nothing is written (#2926), where they used to give an adapter with no weights at exit 0. See Adapters.
  • An eval-fn failure scores a sentinel -1e9 so one broken eval does not crash the run; since v0.77.0 a search in which every evaluation failed exits 2 and writes no merge (#1808, #1905)
  • Live as of v0.71.4 — the full loop merges, materialises, and scores each candidate against the eval suite and writes the best-weighted merge. --canary and --strict-verdict are refused with --strategy cmaes (exit 2); they belong to the other strategies
  • --eval is a .jsonl file of eval tasks (prompt, plus optional expected, scoring and category), the same file soup eval custom --tasks reads. A .yaml suite is not read; since v0.77.0 the "requires --eval" error says so (the loader accepts .jsonl only), where through v0.76.1 it said "YAML/JSONL". A wrong suite fails every evaluation, and since v0.77.0 that stops with cmaes merge failed: every evaluation failed ... No merge is written, exit 2. Through v0.76.1 it finished with exit 0, a Best score of -1000000000.0000 in the final panel and a "converged" merge built from the first random sample: re-run such a merge (see the adapters page). A search where only some candidates failed still finishes, so check the Best score line

VeRA / VB-LoRA vector bank — multi-tenant adapter economics

python
from soup_cli.utils.vector_bank import BankEntry, VectorBank, write_bank, estimate_bank_size

bank = VectorBank(
    name="customer-personalisation",
    base_model="meta-llama/Llama-3-8B",
    projection_seed=0,
    vector_dim=128,
    entries=(
        BankEntry(user_id="user_1", scaling=(0.31, -0.07, 0.0, ...)),  # 128 floats
        BankEntry(user_id="user_2", scaling=(0.0, 0.0, 0.0, ...)),
    ),
)
write_bank(bank, "./bank.json")
# 128-D scaling vector at fp32 ≈ 512 bytes / user
# vs. ~30 MB per rank-16 LoRA on Llama-3-8B

entries is a tuple of BankEntry(user_id, scaling), each scaling a tuple of exactly vector_dim floats; the ... above stands for the rest of them, so the snippet needs real vectors to run. projection_seed and vector_dim are required.

Shared random projection P (vector_dim × vector_dim) + per-user scaling vector v_u. Thousands of per-user adapters at MB-each instead of hundreds-of-MB per LoRA. Atomic JSON I/O + cwd containment + symlink rejection + 16 MiB cap.

estimate_bank_size(num_users=..., vector_dim=...) (keyword-only) for sizing. Live as of v0.71.12 — soup serve --bank <bank.json> [--bank-strength S] reconstructs the projection + per-user vectors and installs a decode-time hook; the active user is chosen per request via the X-User-Id header (unknown/absent id is a zero-delta no-op, so no cross-request leak).

MoLE — per-token gating over task LoRAs

yaml
# soup.yaml
task: moe_lora_routing
training:
  mole_task_adapters:        # the live form: paths to the frozen task LoRAs
    - ./adapters/coder
    - ./adapters/math
  mole_temperature: 1.0      # softmax sharpness
  mole_top_k: 2

Mixture of LoRA Experts. Gating network routes per-token activations to top-K task adapters via softmax over hidden state. Backend-cross-validator rejects mlx. Live as of v0.71.12 — mole_task_adapters: [...] trains a real per-token gating network that blends N frozen task LoRAs (only the router trains); the gate is saved as mole_gate.pt.

Changed in v0.76.0, and one of these means a finished run may be wrong. The gate is the only tensor MoLE trains. On a CUDA device named plainly cuda it was cast to bf16 with no fp32 master copy, so its gradient and AdamW moments were bf16 as well and most AdamW steps rounded away; a gate trained that way on CUDA kept most of its initial weights (#1266). The gate is now fp32 on every device string and is created on the base model's device. mole_gate.pt is saved in fp32, and soup serve --mole loads it and a bf16 file from an earlier run alike. If you trained a router gate on CUDA before v0.76.0, retrain it. Also new: soup train --resume now takes effect for task: moe_lora_routing. Before, the trainer's train() call received no checkpoint, so a resumed run started again from step 0 and overwrote the checkpoints; now each checkpoint-N carries its own mole_gate.pt and a resume restores it with the adapters frozen again (#1220).

soup adapters pr — GitHub-shaped adapter pull requests

bash
soup adapters pr "Better politeness on EU support tickets" \
  --base-sha <64-hex> --adapter ./candidate \
  --eval ./eval_delta.json --samples ./sample_diffs.json \
  --output ./PR.md

PR = {base SHA, dataset diff, adapter weights, eval-delta report} rendered as review-friendly Markdown with eval-delta table + per-sample baseline/candidate diffs:

MetricBaselineCandidateΔ
judge_score7.48.2+0.8
retry_rate12.1%4.6%-7.5%

_md_table_escape neutralises the backtick, |, \n, \r and \t in operator-controlled cells. JSON output also available for v0.68 GitHub Action. Bounds: ≤64 deltas, ≤256 samples, ≤32 KiB per sample.

--push owner/repo#N posts the Markdown as a PR comment through the gh CLI, and it needs GITHUB_TOKEN or GH_TOKEN in the environment (without one the command exits 1 with no GitHub token found before it looks for gh). Since v0.77.1 Soup runs gh by the absolute path it finds in an absolute PATH directory (#2205). With a token but no gh on PATH it exits 1 with a message that says the gh CLI was not found and tells you to install GitHub CLI, or to drop --push and use --output to write the Markdown.

soup lock — shared run lockfile

bash
soup lock write --base-model meta-llama/Llama-3-8B \
  --base-sha <64hex> --dataset-sha <64hex> --env-hash <64hex> \
  --output soup.lock

soup lock show soup.lock
soup lock check --base-model ... --base-sha ... --dataset-sha ... --env-hash ...

soup lock check exits 2 on drift and 3 when the lock file is missing or unreadable, the SHA is not 64 hex characters, or the call is mistyped. That is a move in v0.76.0: through v0.75.2 drift was 3 and a missing lock was 2, so a CI step written for the old codes reads them the wrong way round. soup lock show on a missing file is now 3 as well. soup lock write did not move: it still exits 2 for a missing environment lock or a malformed SHA. (Since v0.78.0, #2903: soup lock show and soup lock check also exit 3, with lock path is a directory: '<path>', when a directory sits where the lock file should be; on Windows v0.77.2 exited 1 with a PermissionError.)

Closure of (base_model_sha, dataset_sha, env_hash):

text
closure_sha = SHA256(base_sha || dataset_sha || env_hash)

--env-hash is optional on soup lock write. Left out, it is derived from soup-env.lock in the current directory (the file soup env lock writes), or from the file named by --env-lock <path>; the command exits 2 if that file is missing. An explicit --env-hash wins and --env-lock is then not read. soup lock check has no such fallback and still requires --env-hash.

Commit soup.lock to git so the whole team coordinates on the same reproducible run. soup_version + created_at are advisory only — legitimate operator upgrades don't trigger drift. Composes with v0.64 soup env lock (provides env_hash) and v0.64 soup plan (provides base/dataset hashes from config).

soup adapters bisect — binary search over training history

bash
soup adapters bisect ./ckpt-0500 ./ckpt-1000 ./ckpt-1500 ./ckpt-2000 \
  --eval-command "soup eval gate --suite evals/gate.yaml --baseline baseline.json --model {ckpt}"

Binary search over ordered checkpoint history. Operator supplies a shell template with {ckpt} placeholder — Soup splits the template into an argument list once (no shell, no shell=True) and puts the checkpoint id into every {ckpt} as it is, so an id with spaces or quotes stays inside its own argument. Probes both endpoints first (short-circuits all-OK / all-broken), then ~log₂(n) midpoint probes. Exit 2 on BROKEN_AT (2 is also the usage-error code, and since v0.77.1 also the code for an --eval-command program that is not on PATH, and since v0.77.2 for any program that cannot be started, so read the first line of the output).

The eval command is the pass/fail test, and it must exit non-zero on a bad checkpoint. Bisect treats exit 0 as PASS and anything else as FAIL, including a command that times out after an hour. (Since changed in v0.77.1: through v0.77.0 a command whose executable was not found counted as FAIL as well; a fixed program name Soup cannot find is now refused up front, see below.) soup eval gate does exit non-zero when the gate fails (2 since v0.76.0, 1 before), which includes a score that drops past its regression threshold against the baseline, and that is why the example uses it. A usage error from the gate command (exit 3) is non-zero too, and bisect reads it as a failed checkpoint, so run the command once by hand before you let it search. soup eval custom --model {ckpt} --tasks ./regression.jsonl does not work as the test: it exits 0 whenever the eval completes, whatever the accuracy, so every checkpoint passes and the verdict is ALL_OK even if the model collapsed.

Which program runs (v0.77.1, #2205, #2213). Soup looks up the first word of the command in the absolute directories of PATH and runs the program by the path it finds there. Empty and relative PATH entries and the current directory are not searched, so a tool that is only in the current directory needs its directory on PATH as an absolute path, or its own path (./tool). A fixed program name that is not on PATH ends the command with exit 2 before the first probe and prints no verdict: --eval-command program 'x' was not found on PATH; install it, put it on PATH, or give its path. When the checkpoint id fills in the program name, a name not on PATH still counted as a failed probe at v0.77.1. (Since closed in v0.77.2: that holds for a program name the checkpoint id fills in too. A name that is not on PATH, a path that is not a regular file or not executable, and any other failure to start the program end the command with exit 2 and no verdict, --eval-command program 'x' could not start: ...; v0.77.1 counted them as a failed probe. A fixed name is refused before the first probe; a name the checkpoint id fills in is resolved for each probe, so the refusal comes at the first probe that cannot start it, which can be after earlier probes ran. Only a command that runs and exits non-zero, or times out after an hour, is a failed checkpoint. Checked on the v0.77.2 binary with --eval-command "{ckpt}" and with a program that does not exist; #2293, #2314 by @Nari-Ab.) On Windows, soup also leaves the current directory out of the program search for itself and the programs it starts.

On Windows (since v0.77.2, #2314) the template is split without POSIX quoting: a backslash path such as C:\tools\gate.exe works unquoted, a program path may omit .exe when the file exists, and surrounding double quotes are stripped from a word. Single quotes are not removed: a word wrapped in single quotes is still one argument, but the quote characters reach the program with it ('a b' arrives as 'a b'), and a quote inside a word (a'b c'd) groups nothing, so it splits at the space. So write an argument or path that has spaces in double quotes, "{ckpt}". Upstream lists this Windows quoting as open (#2488). (Since closed in v0.78.0: upstream's CHANGELOG says the template is now split with the Microsoft C runtime rules on Windows, so options like --opt="a b" and single-quoted placeholders such as '{ckpt}' group correctly instead of ending in a premature BROKEN_AT verdict, #2488 by @Shubham-dev-stack in #2603; this site did not re-run the splitting on v0.78.0, so the description above is of v0.77.2.) Elsewhere the template is still split with POSIX shell rules. Through v0.77.1 the split used POSIX rules everywhere, in which a backslash is an escape, so on Windows a program path had to use forward slashes or quotes: .\tool.exe would reach the program as .tool.exe. The checkpoint ids that bisect prints have control characters and bidi marks removed.

After bisect finds the broken checkpoint, soup adapters blame is the intended follow-up for row-level attribution, but its CLI scores are synthetic at v0.77.2 and v0.78.0 (unchanged since v0.76.0), so do not rely on them.

Numbers

+165 tests in v0.67.0 (10,836 → 11,021), 7 new test files. CMA-ES eval-wiring went live in v0.71.4, VeRA multi-tenant serve in v0.71.17, and the MoLE gating kernel in v0.71.12.

See also

  • Adapter algebra (v0.71.34) — task arithmetic over LoRA deltas, the newest member of this command family.
  • Adapters (v0.57) — diff / merge / blame / branch / checkout, the foundation v0.67 builds on.
  • Is the adapter alive — v0.76 soup adapters check and soup adapters audit, for the adapter a merge or a bisect hands you.
  • Post-train x-rays — v0.66 influence-function blame, the intended follow-up to bisect (its CLI scores are synthetic at v0.77.2).
  • Pre-flight & tooling — v0.64 soup env lock + soup plan are the inputs to soup lock.

Soup is free and Apache-2.0. If it saved you a training run, starring the repo costs nothing and helps most. You can also fund the GPU time behind the work a 4 GB laptop cannot reach.