Experiment Tracking
Every soup train run is automatically tracked in a local SQLite database (~/.soup/experiments.db).
List Runs
soup runsShows all training runs with task, model, status, and final loss. The run database at ~/.soup/experiments.db is machine-wide, so this lists every run on the box; add --cwd-only to narrow it to runs whose output_dir sits under the current directory.
NULL means not measured (v0.78.0). The database gains nullable columns in place the first time a v0.78.0 soup opens it, and loss, lr and speed may be NULL where v0.77.2 stored 0.0 for a value nobody measured (#2589, #2810, #2891; MLX GRPO's validation-reward row records no speed rather than 0.0, #2830). A script that reads ~/.soup/experiments.db directly and treats 0.0 as "unmeasured" has to treat NULL the same way. A v0.77.2 database opened by v0.78.0 is migrated in place, and a database written by v0.78.0 stays readable by v0.77.2: soup runs and soup runs show printed such a run normally on v0.77.2 (run with a hand-made database; the NULL values themselves need a real run and were not run). A PPO run records its reward and no loss. The reward columns, the recorded code commit and the live training panel are on Observability.
Run Details
soup runs show run_20260223_143052_a1b2Detailed info including config, metrics, and an ASCII loss curve (--no-plot hides the curve). A failed run also shows an Error: line with the reason (below). When the curve shows a spike, soup rewind names the dataset rows that were in that step's batch. Since v0.77.0 it also prints the base the run loaded, as Revision: and Identity: (next section).
Which base and which data a run used (v0.77.0)
On the transformers backend soup train binds the base it loads to one Hub commit (#1972, #2094, #2127). Just before the first load of the base it asks the Hub for the base's current commit, in one metadata request with a 5-second timeout, and loads the model, tokenizer and config at that commit. This covers resident, layer-streamed and multi-GPU transformers runs; a multi-GPU launch resolves the commit once on rank 0 and shares it with every worker. The setup prints which case applied:
Base revision: <commit> (bound Hub commit): the run loaded that commit.Base revision: cache-path metadata; local bytes are unverified:baseis a Hugging Face cache snapshot directory (.../snapshots/<commit>). The commit in its name is recorded, but nothing checks the files against it.Base revision: unknown (existing loading behavior preserved): a local directory,HF_HUB_OFFLINEorTRANSFORMERS_OFFLINE, a lookup that failed, or a load that is not bound. The run loads the base as before.
Unsloth loads, the non-Hugging-Face hubs, and local or cached-path bases are not bound (#1902, still open). Since v0.78.0 two more paths are bound. Each single-process Hugging Face Transformers arm of soup sweep records its own base revision, with the training-data hash left unknown (#2671, by @vaputa). A single-process soup train on backend: mlx with a Hugging Face base loads the RoPE config, the model and the tokenizer at one commit and records it in the run row and soup_run.json (#2884, by @vaputa); an MLX run launched through a distributed launcher, or whose MLX loader is not the Hugging Face provider, records no revision and the source unsupported_backend, and prints Base revision: unknown (<reason>; existing loading behavior preserved); offline mode, a local directory and a cache path behave as on the transformers backend (offline, local, cache_path). MLX sweeps and the MLX inference, chat, serve, merge and export paths stay outside the binding. The MLX case is covered upstream by its tests and the hosted macOS MLX job only, and was read from the code here, not run. (Since v0.77.2 soup merge loads the base at the Hub commit the adapter's training provenance recorded, #2485; see Model export.) A run whose environment declares a WORLD_SIZE of 2 or more without a launcher's process group behind it stops with distributed base identity needs the launcher's process group. The first pinned layer-streamed run on a Hub base after the upgrade re-shards into a new cache slot named for the commit; the old slot stays on disk.
soup train also records the SHA-256 of the training file when it starts, before the file is loaded or transformed (#2024). It does that only for a single local text file (.jsonl, .json, .csv, .parquet or .txt) of at most 256 MiB that it can read within 5 seconds and that does not change while it is read. A Hub dataset, a URL, a list of files, data.interleave, data.streaming, data.replay, a forget or retain set, pre-tokenized data, a non-text modality, task: unlearn and task: tts are recorded as unknown. Nothing is printed and nothing is refused. The digest describes the source file's bytes at that moment, not the rows the run trained on after formatting.
soup runs show prints the source of the base revision as Identity: (hub_commit, cache_path, local, offline, resolution_failed, unsupported_backend or unknown; unsupported_backend is still what an Unsloth run, a non-Hugging-Face hub and an MLX run on a distributed launcher or another provider record); rows written before v0.77.0 read unknown, and nothing fills them in from the Hub's state today. The run id, the base id, the commit and its source, and the training-file digest are also written beside the final artifact as soup_run.json in the output directory (by the saving process only), so keep that file when you copy an adapter. soup registry push copies them into the registry entry, and since v0.77.0 a registry name:tag that matches several entries is refused instead of resolving to the newest (see the registry page). soup export reads soup_run.json back and loads the base an adapter was trained on at its recorded commit (Base revision: <commit> (recorded run)), and so does the live evaluation behind soup ship; since v0.77.2 so does soup merge on both of its paths (#2485), where v0.77.1 did not read it and loaded the base's current revision. soup push uploads soup_run.json with the rest of the output directory.
These records detect drift; they are not an attestation. Of soup ship --require-provenance, the check built on such hashes, upstream writes: "This is not a model run, attestation, signature or forgery protection. The unkeyed hashes detect drift; use the existing signing/attestation tools for a trust boundary."
A run that is not running no longer says it is
Until v0.73.3 a run whose watcher process died was reported running forever, and the listing hardcoded that word for any row it could not otherwise classify. That trained you to ignore the one status field that guards against starting a second concurrent run.
Both soup runs and soup runs show now reconcile on read: a running row whose recorded process is gone is rewritten to terminated with an unknown exit code. Unknown, deliberately — a lost outcome is never recorded as a success — and the richer completed and failed statuses are left exactly as they are. Only runs recorded with a process id can be checked this way, so a run without one is left alone rather than guessed at.
Since v0.76.0 soup train records its own process id, which is what makes that check reach a run you killed yourself. Through v0.75.2 only runs launched by the MCP server recorded one, so a soup train run killed with SIGKILL or Ctrl+C had nothing to check and stayed running; now the next soup runs marks it terminated (#764). Rows written by earlier versions still have no process id and are still left alone.
A failure anywhere after the run is registered (tokenizer or model load, quantization, the LoRA attach, dataset mapping, the rest of the command) now marks the row failed and stores the exception type and message as the run's error_message, which soup runs show prints as Error:. The message is redacted for secrets and capped at 2,000 characters. Separately, a training log that arrives before the run's first measured loss now stores no loss instead of a fabricated 0.0, and the live panel shows Loss: - until one is measured (#1225).
On Windows this depended on a second fix, and it is a good example of a bug that cannot be reasoned around: the API that reports a process's exit code returns 259 for a process that is still alive, but 259 is also a perfectly legal exit code, so a child that genuinely exited with 259 was indistinguishable from one still running. Liveness is now decided by waiting on the process handle with a zero timeout, which is signalled the instant the process exits whatever code it exits with.
Compare Runs
soup runs compare run_1 run_2Side-by-side comparison of two runs. Since v0.78.0 (#2675, #2706, by @nazek52) it shows more of what the two runs recorded:
- the summary adds the stored training-data SHA-256 (or
unknown) andCode commitandCode state, the startup observation described under What a run records about the code; - a config table lists every path whose value differs between the runs, nested ones such as
training.lora.dropoutincluded, with itsKindand the left and right values; a key one run does not have is labelled not stored, and a run whose full config is unavailable is named and its config table skipped; - an evaluation table shows the latest stored score of each benchmark for both runs and the right-minus-left difference when both have a score.
It reads local records only: no registry push, no new evaluation, no hashing of today's dataset, and it does not establish that two evaluations used the same scorer or data. Run on v0.78.0 with two hand-made runs that differed in training.lr and training.lora.dropout, the config table listed exactly those two paths; the evaluation table was not exercised (it printed No stored evaluation scores.). The run id may be a prefix: one that matches several runs exits 1 with Run id prefix '<id>' matches N runs; give more characters (#2470).
Delete Runs
soup runs delete run_1Reclaim disk without losing the run
Deleting a run is the blunt option. Checkpoints are what actually fill the disk, and most of that weight is optimizer state you will never load again.
soup runs clean run_1 --dry-run # estimate the saving first, delete nothing
soup runs clean run_1 # surgical: drop optimizer states, keep the weights
soup runs clean run_1 --no-keep-weights # the one way to delete whole checkpoints
soup runs clean --all # every historical runWarning:If you typed
--keep-weightson Click 8.1, it did the opposite and deleted whole checkpoints. The option was a bare flag with aTruedefault, and Click 8.1 treats that as a toggle, so passing it explicitly parsed asFalse. Anyone who read the flag name, typed it to be safe, and had Click 8.1 installed lost their non-best checkpoints. v0.75.1 makes it the paired--keep-weights/--no-keep-weights, so the default and the explicit flag now mean the same thing on every supported Click version, and--no-keep-weightsis the one way to delete. Upstream added a repo-wide check that fails any True-default flag without a negative form, so this shape cannot come back.
--keep-weights defaults to on, which is the whole design: it deletes optimizer.pt from the lesser checkpoints and leaves the model weights, so you can still evaluate or export from any of them. --dry-run estimates the saving without touching anything, and --force skips the confirmation for CI.
This matters more than it sounds at scale: a LoRA run training a fraction of a percent of the model can drag a checkpoint hundreds of times the size of the adapter it produced.
Which checkpoint is left whole. clean leaves untouched the checkpoint with the lowest loss recorded at its own step, compared only among the checkpoints. When no checkpoint has a recorded loss (a run shorter than logging_steps records none), it keeps the latest one and says so: no checkpoint has a recorded loss; keeping the latest, checkpoint-N, whole. It only touches runs whose output directory is under the current directory.
Runs that share an output directory (since v0.78.0, #2812, by @abdulwaarith0). output: ./output run twice in one project records two runs on one directory. clean now groups runs by their resolved output directory and prunes each directory once. It keeps whole the best checkpoint of every run recorded there, including runs you did not ask it to clean, and each file is listed, counted and deleted once. A directory with one run behaves as before. This is upstream's commit message; it was not run here.
Warning:Re-run this if you need that checkpoint. On v0.77.2, the version checked,
soup runs cleanon a directory shared by two runs removed the checkpoints it promises to keep: run A's pass could remove run B's best checkpoint and the other way round,runs clean Bpruned run A's best, and--all --forceended in "Failed to delete" warnings with exit 0 and a double-counted reclaim total (#2724). Check what you still have. Nothing restores a deleted checkpoint.
History:Before v0.76.0 the rule required the checkpoint to match the run's overall lowest loss exactly. Whenever that loss was logged between two checkpoints, or the run was shorter than
logging_steps, no checkpoint matched, sosoup runs cleantreated every checkpoint of the run as expendable: it stripped the optimizer state from all of them, and with--no-keep-weightsit deleted all of them (#1225). If you ran it on such a run, check what you still have.
Model Evaluation
Soup includes a comprehensive evaluation platform (v0.19.0+):
pip install "soup-cli[eval]"
# Run benchmarks (mmlu, gsm8k, hellaswag, etc.)
soup eval benchmark --model ./output --benchmarks mmlu,gsm8k
# Custom eval tasks from JSONL
soup eval custom --model ./output --tasks ./eval_tasks.jsonl
# LLM-as-a-judge over saved outputs: --target is a JSONL file of
# {"prompt": ..., "response": ...} rows (soup infer writes this shape)
soup eval judge --target ./results.jsonl --model gpt-4o --provider openai
# Run the benchmarks and custom tasks listed in the eval block of soup.yaml
soup eval auto --config soup.yaml
# Compare eval results between runs
soup eval compare run_1 run_2
# Local leaderboard across models
soup eval leaderboard
# Human A/B evaluation with Elo ratings
soup eval human --model-a ./model_v1 --model-b ./model_v2 --input ./prompts.jsonlOn soup eval judge, --model names the judge model, and --target is the file of pairs to score, not the model under test. Every row needs prompt and response, or the command exits 1 naming the line. Without --provider and --model the judge is OpenAI's gpt-4o-mini (key from OPENAI_API_KEY), so your prompts and responses leave the machine; for a local judge pass --provider ollama --model <name> or --provider server --api-base <url>.
soup eval auto takes its work from an eval block in the config, and --benchmarks and --tasks override the two lists:
eval:
auto_eval: true # also run both lists after soup train (v0.76.0)
benchmarks: [mmlu, gsm8k] # lm-evaluation-harness task names
custom_tasks: ./eval_tasks.jsonlsoup eval auto needs the output directory to exist, so run it after soup train, and it exits 1 when neither list is set and, since v0.77.0, when no leg evaluated anything (Auto-eval failed: nothing was evaluated. Every leg was skipped (see above); fix the cause and run again., #1905). Through v0.76.1 a run whose only leg was skipped still ended Auto-eval complete. with exit 0. One leg that ran is enough for exit 0.
eval.auto_eval: true runs these two lists from soup train itself, since v0.76.0. Once the model is saved, the chief process prints Running auto-eval..., runs eval.benchmarks and then eval.custom_tasks against the saved output, and records the scores under the run. A benchmark or custom-task failure prints a yellow notice and does not fail an otherwise successful run. Through v0.75.2 no trainer handed the eval block to the training command, so auto_eval: true did nothing and a finished run never started an evaluation by itself (#1487); if you relied on it, run soup eval auto against that output now.
soup train --trust-remote-code is passed on to those evaluations. There is no soup.yaml key for it, and without the flag both stay off. soup eval auto --trust-remote-code now reaches its benchmark and custom-eval steps as well (through v0.75.2 it was accepted and nothing read it), and soup eval benchmark and soup eval custom take their own --trust-remote-code, off by default. The block's judge key is accepted by the schema, but nothing in v0.78.0 reads it: judge evaluation is not part of auto-evaluation, so run soup eval judge yourself.
What the evaluation commands do with what they find
soup eval benchmark saves only the requested names that came back with a numeric metric (a real 0.0 counts; a boolean does not). A name missing from the results, or without a numeric result, is skipped and named (Skipped <name>: not found or no numeric result), and the banner reports the saved count: Results saved to experiment tracker: N of M. When nothing was saved it prints Nothing measured; nothing saved to experiment tracker. and exits 1. Through v0.75.2 such a name was saved as 0.0.
--run-id is checked before the model loads (since v0.78.0, #2742, #2743). soup eval custom and soup eval benchmark look the run up first and save under the run's full id, so a --run-id that names no run exits 1 with Run not found: <id>, and a prefix that names several exits 1 with Run id prefix '<id>' matches N runs; give more characters, instead of loading the model and saving a row under that id. A unique prefix proceeds. Run on v0.78.0 with a hand-made run database; on v0.77.2 both bad ids loaded the tasks and started loading the model first. Rows stored earlier keep the id they were stored with.
soup eval compare, soup eval leaderboard (per model and benchmark) and soup registry diff use the newest eval row for each benchmark, so re-running a benchmark replaces its score. Through v0.75.2 each of them let the oldest row win. A comparison that read a re-measured benchmark could show an improvement where there was a regression; re-run it, nothing stored changed.
Since v0.77.2 soup eval compare and every format of soup eval leaderboard refuse a stored score that is NaN or infinite: the diagnostic names the run (or the model) and the benchmark, the exit is 1 and nothing is printed first, and the commands do not fall back to an older finite score (#2466, #2477, by @taljeon). The :name: codes in that diagnostic can still expand into emoji (tracked as #2489).
soup eval judge skips a row whose judge call keeps failing (a 429 after its retries, a timeout, a reply with no choices) with a warning, counts it, and still scores and saves the rest; it exits 1 only when every row fails. Once three requests in a row have spent their retries unanswered, it stops: one message names the judge URL and how many items were not judged, the scores from before the outage are shown but not saved, and the exit is 1 (#1522). The judge is asked for one JSON object, {"scores": {"<criterion>": <number>}, "reasoning": "..."}, and Soup reads the first object in the reply that has a scores key. Criterion names match case-insensitively and {"score": N} reads as N. A reply with no object, no finite number for a rubric criterion, or one criterion under two spellings is an error that names the criterion, not a score at the scale minimum, and a reply over 65,536 characters is refused unread. The judge is asked for at most 1,024 tokens, so a reply that long is a runaway. A rubric file is checked before any request (since v0.78.0, #2698, #2700). Criterion names must be unique (compared lower-cased and trimmed) and each weight must be a finite number: soup eval judge --rubric exits 1 with Criterion 1 (' clarity ') duplicates criterion 0 for a duplicate and with Cannot use rubric 'rub_nan.yaml': Criterion 0 ('a') weight nan is not a finite number. Use a number such as 1.0. for a .nan weight (.inf and -.inf go through the same check in the code; the duplicate and the .nan cases were run on v0.78.0). Through v0.77.2 such a file was accepted, and the three non-finite weights produced 0.0, nan and 0.0 as the weighted score, so a judge-scored eval whose rubric had a non-finite weight scored a wrong number: re-run it. A rubric with duplicate criterion names must now be renamed or trimmed (upstream's migration note). training.grpo_judge_rubric shares the loader, and JudgeResults.compute() raises ValueError for non-finite or oversized inputs (#2701, #2838); the GRPO path was not run. This paragraph is read from the code and upstream's documentation, not run against a live judge.
Custom task scorers
Each row of the soup eval custom --tasks file carries a prompt and optionally expected, scoring and category. scoring takes one of exact, contains, answer, regex, semantic, tool_call_match, tool_call_name_match or tool_call_args_subset. The three string scorers read an output like this:
scoring | What it compares | expected: "4" against The answer is 4. | against 14 |
|---|---|---|---|
answer | The final answer each side states, read with the parser GRPO's accuracy reward uses (#### 4, \boxed{4}, The answer is 4.); numbers compare by value | match | no match |
contains | expected as a whole token bounded by non-alphanumeric characters, case-insensitive | match | no match |
exact | The whole stripped output, case-insensitive | no match | no match |
answer refuses at load an expected that states no single answer (a multi-line worked solution with no ####, an empty \boxed{}, a hedge between values) and names the line. It reads the answer a model states: against a gold Paris, Answer: Paris and Paris match but The capital of France is Paris. does not, so prefer it for math and short-answer tasks and use contains for free text. contains cannot read negation (It is not 4, so 5. still contains 4), and its bound is an ASCII alphanumeric run, so 4 still matches inside 3.4. The eval gate's scorer: override accepts answer too.
tool_call_match, tool_call_name_match and tool_call_args_subset compare a JSON tool call. Since v0.77.0 the argument comparisons never treat a boolean and a number as equal, at any depth (#1755, #1756): against a gold {"enabled": true}, an output {"enabled": 1} scores 0.0 on tool_call_match and 0.5 on tool_call_args_subset (the tool name's half), where v0.76 gave both full credit. Numbers still match across forms (1 matches 1.0). A score recorded with the old rule can be higher than the same outputs score now, so re-measure it. The bundled mini_tool_call suite scores on its own and is not affected by this change.
Since v0.78.0 a tool_call_args_subset row counts as correct only at full credit (#2939). The function name is worth 0.5 and the expected arguments the other 0.5, and the per-row score keeps that partial credit; but the Accuracy that soup eval custom, a soup ship metric leg and soup eval retention report now counts a row only when the function name and every expected argument match. Through v0.77.2 a score of 0.5 or more counted, so a call with every argument wrong, no arguments, the wrong function with the right arguments, malformed arguments, or extra arguments where none were expected could count as correct. The eval gate, quant-check, deploy measuring and the CMA-ES merge score average the per-row score and do not move. Upstream's instruction: "Record base and tuned scores again with this version before comparing"; stored results are not rewritten, and a soup ship that ended 0 can end 2 on an unchanged model.
A scoring value outside the list above is refused when the tasks file is read, naming the line (Line 1: invalid scoring 'bogus', must be one of: ...), before any model loads, and soup eval custom exits 1. Since v0.77.0 that includes a value that is not a string, such as a list, which used to end in TypeError: unhashable type (#1926).
contains changed in v0.76.0. It used to be a raw substring test and paid 14 for an expected 4. A result recorded with it (a soup eval gate --baseline file, a registry:// row, a soup eval custom --run-id result) can be higher than the same outputs score now. A baseline recorded before v0.76.0 does print the generic scorer-revision (or unknown-provenance) warning, but that warning does not say that contains changed, so re-measure those baselines or compare only runs made on the same version. The scorer functions were run for the table above.
Aider Polyglot (soup eval aider, v0.74.0)
pip install "soup-cli[aider]"
git clone https://github.com/Aider-AI/aider.git
cd aider
./benchmark/docker_build.sh
cd ..
git clone https://github.com/Aider-AI/polyglot-benchmark.git
soup eval aider --model openai/gpt-4.1 --output ./aider-results \
--exercises-dir ./polyglot-benchmark --run-id run_20260301_143052_a1b2This scores a model through Aider's own benchmark harness, in Aider's Docker image. --model is an Aider / LiteLLM model identifier such as openai/gpt-4.1, not a path to a local checkpoint. The [aider] extra alone does not make the command runnable, because the aider-chat wheel does not ship the harness: you build the aider-benchmark image from an Aider checkout and clone the exercises once, as above. Docker has to be running, and Soup checks the Docker CLI, the daemon and the image before it starts. Since v0.77.1 it runs docker by the absolute path it finds in an absolute PATH directory (#2205), so a docker that is only in the current directory or in a relative PATH entry is not found. The exercises are mounted read-only (a directory outside the current one is allowed, with a warning), and provider credentials reach the container by environment-variable name, never as a value on the command line: OPENAI_API_KEY, OPENAI_API_BASE, ANTHROPIC_API_KEY, GEMINI_API_KEY, OPENROUTER_API_KEY and the three AZURE_API_* variables, whichever are set.
--output is a directory, not a report file, and it must sit under the current directory. It receives Aider's per-exercise results and a soup_result.json with the model, the score, the error counts and aggregate details. --run-id must name an existing run; the aider_polyglot score is stored under it, which is what lets soup eval compare run_before run_after compare two of them. --threads (1 to 64, default 1), --num-tests (default -1, every exercise) and --timeout (60 to 86400 seconds, default 86400) bound the run. --allow-host-services lets the container reach services on the host, for a trusted local OpenAI-compatible endpoint; it also lets the model-written code the benchmark executes reach those services, so leave it off for a remote provider. The benchmark runs model-generated code, and Soup offers no host-execution fallback. Since v0.77.2 a timeout or Ctrl+C stops and removes the benchmark container with docker rm -f soup-aider-<12 hex> (a name Soup gives each run); before, only the docker client process was killed and the container kept running and calling the model API. When the removal fails, a one-line warning prints the command to run by hand (#2280, by @ShivanshShukla; read from the commit, not run: it needs Docker).
Hyperparameter Sweep
Search for the best hyperparameters:
# Grid search
soup sweep --config soup.yaml --param lr=1e-5,2e-5,5e-5 --param lora_r=8,16,32
# Random search with max runs
soup sweep --config soup.yaml --param lr=1e-5,2e-5,5e-5 --strategy random --max-runs 5
# Preview without running
soup sweep --config soup.yaml --param lr=1e-5,2e-5 --dry-run
# Early stopping: skip remaining runs if loss exceeds 1.5x best
soup sweep --config soup.yaml --param lr=1e-5,2e-5,5e-5 --early-stop 1.5
# A standalone sweep file instead of repeated --param
soup sweep --config soup.yaml --sweep-config sweep.yaml --dry-runA parameter that is not a field of the config exits 1 (sweep parameter does not match any config field), and --dry-run runs that check, so a typo fails before any training. Since v0.77.0 a parameter that sets one of the staged fields, which Soup accepts but never reads (see Settings refused at load), away from its default in any arm is refused the same way, under --dry-run too: sweep parameter sets a field that is accepted but read by nothing: training.forgetting_eval_steps; refused as of v0.77. Remove it from --param., exit 1. A deprecated value such as data.remove_unused_columns=true is not pre-checked (--dry-run exits 0). none as a --param value (since v0.78.0, #2799, by @abdumutalipabay0). For a field that refuses null, such as training.quantization, none is now the word none; for an optional field such as training.neftune_alpha it is still null. Through v0.77.2 it was always read as null, so in --param quantization=4bit,none the none arm was written as quantization: null, which soup doctor --config refuses (exit 2, training -> quantization: Input should be '4bit', '8bit', 'none', ...), and that arm failed while the sweep still exited 0 on the other. On v0.78.0 --dry-run prints the grid as 4bit, none; on v0.77.2 it printed None for the second row. --dry-run only prints the grid and does not validate each arm.
Two more changes in v0.77.0. A sweep in which no arm completed exits 1 with No sweep run completed: N of N run(s) failed.; through v0.76.1 it printed a table of failed rows and exited 0, and one completed arm is still exit 0 (#1905). A random sweep draws from each list's distinct values, so lr=1e-5,2e-5,1e-5 plans each distinct arm once and always finishes, --dry-run included (#2007); through v0.76.1 such a list could make the sweep hang.
A standalone sweep file
--config stays the base soup.yaml. --sweep-config points at a separate file that holds the whole search, in place of repeating --param:
# sweep.yaml
strategy: random # grid | random
n_runs: 6 # 0 or absent: use --max-runs (a random sweep with neither plans at most 10 runs; a grid plans every combination)
seed: 7
params:
lr: [1e-5, 2e-5, 5e-5]
lora_r: [8, 16, 32]params maps each name to a non-empty list of scalars (at most 32 names, 64 values per name, a 256 KiB file, under the current directory). Giving both --param and --sweep-config is an error (Use either --param or --sweep-config, not both., exit 1), and so is giving neither. The file's strategy and seed win over --strategy, and a non-zero n_runs wins over --max-runs. Two consequences were run: a file that leaves strategy out is a grid sweep even when you pass --strategy random, because the file's default wins; and n_runs only caps the count, so the 3 by 3 grid above with strategy: grid and n_runs: 20 plans 9 runs.
What a sweep arm is, and what it records
Every arm builds the trainer that soup train would build for the config's task and backend (v0.76.0). Through v0.75.2 soup sweep had its own shorter dispatch that knew SFT and twelve other tasks, so ten task values (distill, tts, classifier, reranker, cross_encoder, prm, unlearn, moe_lora_routing, online_dpo, asr) reached the SFT trainer, and backend: mlx was never read. Each of those arms trained plain next-token cross-entropy while the tracker recorded the configured task, and the sweep ranked the numbers as if they were the configured objective. If you swept any of them, discard that sweep (#1213).
Since v0.78.0 an arm that asks for 4bit or 8bit on a CPU, where bitsandbytes cannot run, trains with quantization: none and says Switching to quantization: none. once for that arm, as soup train does (#2665; through v0.77.2 the unsupported value reached the trainer). Each single-process Hugging Face Transformers arm is bound to its own base revision (#2671, see above), and an SFT arm with stream_layers: true whose setup fails after the model loaded releases the layer-streaming runtime, so the next arm does not inherit it (#2378, by @ShivanshShukla). These are from upstream's changelog and were not run (a sweep needs trainers).
A diverged arm (a NaN or infinite final loss) stays in the results table, is labelled diverged, sorts after the finite losses, can never be marked the best run, and counts as worse than any finite early-stop threshold. An arm whose trainer cannot be built or set up is now marked failed in the tracker with the reason, where it used to stay running (#1464).
Model Comparison
Compare outputs of two models side-by-side:
soup diff --model-a ./model_v1 --model-b ./model_v2 --prompt "Explain gravity"
soup diff --model-a ./base --model-b ./finetuned --prompts test_prompts.jsonl
soup diff --model-a ./a --model-b ./b --prompts prompts.txt --output results.jsonlBoth models must be existing local paths (exit 1 otherwise). For an adapter directory, soup diff reads the base model from its adapter_config.json; --base-a and --base-b name the base for model A and model B explicitly, and are required when that file records none (the command exits 1 with Cannot detect base model). A full (non-adapter) model is loaded from its own directory; the base is not used to load it. Since v0.78.0 (#2547, #2744) a --prompts file that is missing (Prompts file not found: <path>), a directory (Prompts path is not a file: <path>), unreadable or not UTF-8 (Cannot read prompts file <path>: ...) or empty or blank-only (No prompts found in file: <path>) exits 1 with that message, also when --prompt is given too; through v0.77.2 such a file was reported only as No prompts provided. Use --prompts or --prompt., and an empty --prompts file beside --prompt x was skipped silently. Run on v0.78.0 with empty model directories. Custom modeling code is denied by default: a local model whose config.json has an auto_map is refused unless you pass --trust-remote-code.
Batch Inference
Run a model on a list of prompts:
soup infer --model ./output --input prompts.jsonl --output results.jsonl
soup infer --model ./output --input prompts.txt --output results.jsonl \
--max-tokens 512 --temperature 0.3Output is JSONL with prompt, response, and tokens_generated fields.
Two opt-in options arrived in v0.76.0, both described on the soup bench page. --batch-size N (default 1) generates N prompts together, left-padded, and writes the results in input order; in fp16 and bf16 a batched run may not produce the same tokens as batch size 1. --cuda-graphs is experimental CUDA graph decoding for a resident, unquantized Qwen2 or Llama model and needs PyTorch 2.14 or newer.
Since v0.77.1 soup infer also takes --backend transformers|mlx (the default stays transformers; any other value exits 2). --backend mlx loads native MLX text LoRA adapters and MLX base models and generates without Torch or PEFT (#2121 by @Amix29, part 1 of #1986). It needs Apple Silicon and the [mlx] extra:
soup infer --backend mlx --model ./output --input prompts.jsonl --output results.jsonlIt refuses, one named option at a time with exit 1, --task other than text, --batch-size above 1, --cuda-graphs, any --device (MLX selects its native device; omit --device) and a --hub other than hf. Since v0.78.0 soup chat takes --backend transformers|mlx as well (#2123), and soup merge --backend mlx fuses a native MLX adapter into a dense checkpoint (#2124); both are on the MLX page. Which adapters it accepts and what its loader checks are under Native MLX generation on the MLX page. The option refusals above were run on the v0.77.1 CLI without MLX; the load and generation path was read in the code and not run, and no speed or memory figure exists for it.
soup infer, soup chat and soup diff take --device (cpu, cuda, cuda:<index> or mps; mlx is also accepted and loads like cpu; with --backend mlx (above, and on soup chat since v0.78.0) any --device is refused), and when you leave it out Soup auto-detects one, so what follows applies either way. Since v0.76.0 the device decides how the model loads: cpu pins it to the CPU in float32, an explicit cuda:<index> or mps pins it to that device in float16, and plain cuda lets accelerate place it in float16. Any other value is refused (Unsupported --device ...). Through v0.75.2 these commands loaded with device_map="auto" in float16 whatever you passed, so --device cpu could still put the model on a visible GPU. The cost to know about: on a CPU-only host the model now loads in float32, which doubles its RAM use (a 7B model needs about 28 GB instead of 14 GB).
Training Profiler (v0.23.0+)
Estimate memory, speed, and GPU requirements before training:
soup profile --config soup.yaml # model, task and quantization come from the config
soup profile --model Qwen/Qwen2.5-7B --method qlora --seq 2048 --batch 4 --gpu rtx3090 # no soup.yaml (v0.77.2)Shows estimated GPU memory, training speed, and hardware recommendations. Add --json to print the same figures as one JSON object for scripting: the memory terms in GB (model_memory_gb, lora_memory_gb, gradients_memory_gb, optimizer_memory_gb, activation_memory_gb, logits_memory_gb, dequant_memory_gb, overhead_gb, total_memory_gb), peft, tokens_per_sec, samples_per_sec, recommended_batch_size, compatible_gpus, gpu_memory_gb and gpu_memory_source. With --json, stdout is only that JSON document; since v0.77.2 every refusal (a missing config, an unknown --gpu, Cannot estimate this run) goes to stderr with exit 1, so soup profile --json | jq no longer reads prose (#2398, by @Nari-Ab; soup cost --json got the same change in #2345). Since v0.77.2 the document also carries lora_r and optimizer_step_memory_gb, how far the optimizer step's peak exceeds the forward and backward pass (also optimizer_step in memory_terms_bytes), so the terms listed above do not add up to total_memory_gb on their own. Since v0.77.1 it also carries the exact bytes (memory_terms_bytes, total_memory_bytes), lora_targets, gradient_checkpointing_tier (off, full, medium or selective; gradient_checkpointing stays the config's own value), vocab_size, shape_source, params_source, notes and fit (fits, tight or does not fit).
gpu_memory_source is flag, detected, mlx working set (Apple Silicon, since v0.77.2) or assumed. With no GPU detected and no --gpu, the memory verdict is made against an assumed 24 GB and says so: the panel reads No GPU detected: would fit in an assumed 24 GB (need ~3 GB). Pass --gpu for a real verdict., the speed panel reads Typical A100 throughput, not specific to your GPU., and the JSON ends "gpu_memory_gb": 24.0, "gpu_memory_source": "assumed". Pass --gpu with a name such as RTX5070LAPTOP to get a verdict for a real card ("gpu_memory_source": "flag"); an unknown name lists the accepted ones and exits 1. (soup profile --help still gives only rtx3090, rtx4090, a100, h100 as examples.) Since v0.77.1 the RTX 30-series laptop parts have entries of their own, so --gpu "rtx3060 laptop" resolves to 6 GB where it used to be an unknown name, and a size written as a word, such as A100 40GB, reaches the matching entry (#2144 by @abdulwaarith0).
Full fine-tuning is budgeted as full fine-tuning since v0.77.0 (#1423, #2041). A run with lora.r: 0, Spectrum, LISA, PRM, or a classifier without LoRA is sized with the whole parameter count, its gradients and its optimizer state, and the JSON gains peft (full, lora or qlora) and gradients_memory_gb. Through v0.76.1 such a run was sized as LoRA, with 0 trainable parameters and 0 GB of optimizer memory, so its estimate was far too small; re-run soup profile on a full fine-tune you sized with an older release. The same applies to the MCP profile tool.
One estimate for the pre-flight, soup profile, the MCP profile tool and soup plan (v0.77.1, #2146 by @abdulwaarith0). They used to price the same run with two formulas, and neither charged the logits and loss over the vocabulary. They now share one estimate that reads the model's config.json and safetensors headers (never the weights) and sums weights, adapters, gradients, optimizer state, activations, the logits and loss, the 4-bit dequantization copy and overhead, so soup profile's numbers changed again: re-run it on a config you sized with an older release. A run the estimate cannot price, such as an absurd batch_size (the message names batch_size, max_length and a model size over 1,000B parameters as the limits), exits 1 with Cannot estimate this run: and the reason, where v0.77.0 printed a figure and exited 0. soup profile prices a batch_size: auto config at 4, while the soup train pre-flight does not price auto at all, so set a number there to get its check. Reading a Hub model's shape can reach the Hub (and writes its config.json into the Hugging Face cache) unless HF_HUB_OFFLINE or TRANSFORMERS_OFFLINE is set; with no readable config.json the shape is guessed from the name, the logits term is not counted and the panel says so. Where the pre-flight refuses a run and where it only warns, and the range upstream fitted the estimate on (dense models of 3B and below on one 6 GB card), are on Pre-flight and tooling. (The estimate changed again in v0.78.0: upstream's release notes list the cuBLAS workspaces, the longest row of a padded SFT run, the 8-bit checkpointing charge and the distillation teacher, and describe the range it was fitted on as small dense models; the changes are on the same Pre-flight page. soup profile --config and the MCP profile tool do not take the seq_len and shape the release notes name (soup profile --model has --seq, see below). Only the Python function profile_from_config takes them, and it now returns a truthy FitUnavailable object instead of None for a run it cannot price.)
Without a soup.yaml: soup profile --model (v0.77.2)
soup profile --model Qwen/Qwen2.5-7B --method qlora --seq 2048 --batch 4 --gpu rtx3090
soup profile --model ./my-model --method full --optimizer adamw_torch --gradient-checkpointing full --jsonsoup profile --model answers "will it fit?" for a model you have not written a config for (#2285, by @abdulwaarith0). --model takes a Hugging Face id or a local model directory. Soup reads that model's own config.json from the directory, the Hugging Face cache or the Hub and prices the run with the same estimate a soup.yaml describing that run gets. The run is set by these options:
| Option | Accepts | Default |
|---|---|---|
--seq | 64 to 1,048,576 | 2048 |
--batch | 1 to 1024 | 4 |
--method | lora, qlora, full | qlora |
--lora-r | 1 to 4096 | 64 |
--optimizer | adafactor, adalomo, adamw_bnb_8bit, adamw_torch, adamw_torch_fused, lion_8bit, lomo, paged_adamw_8bit, schedule_free_adamw, sgd | adamw_torch |
--gradient-checkpointing | off, full, medium, selective, auto | off |
--gpu and --json work as they do with --config. A value outside a list exits 1 and prints the valid options (Unknown --method: foo), a number outside a range is Click's exit 2, and the companion options are refused without --model (--seq only applies with --model; with a config the run comes from soup.yaml., exit 1) as --model is with --config (--model and --config cannot be used together., exit 1).
It does not guess. When no config.json can be read, the command stops with exit 1 and says why (Cannot read <model>: there is no readable config.json in that directory. Nothing was estimated: --model needs the model's own config.json, not a size guessed from its name.). With HF_HUB_OFFLINE or TRANSFORMERS_OFFLINE set, a Hub id whose config.json is not in the cache is refused the same way. That differs from --config, where a model whose config.json cannot be read is sized from its name.
On Apple Silicon, soup profile and the MCP profile tool compare the estimate with Metal's recommended working-set size instead of the whole unified memory, and gpu_memory_source reads mlx working set. That comes from the release notes; it was not run here and it has not been measured against an MLX run.
Nothing soup profile prints is a measured peak: it is the estimate described under Pre-flight and tooling, with the range it was fitted on.
Adapter Management (v0.22.0+)
# Scan directory for LoRA adapters
soup adapters list ./experiments
# Show adapter metadata (base model, rank, size)
soup adapters info ./output
# Compare two adapters side-by-side
soup adapters compare ./adapter_v1 ./adapter_v2
# Is an adapter trained at all? (v0.76.0)
soup adapters check ./outputsoup adapters check ends in one verdict line, alive or inactive: <reason>, and soup adapters audit compares the settings a finished run recorded with the soup.yaml that started it: both are on their own page.
Logging Integrations
TensorBoard
soup train --config soup.yaml --tensorboard
tensorboard --logdir ./output/runs/Weights & Biases
pip install "soup-cli[wandb]"
soup train --config soup.yaml --wandbThe wandb package comes from its own extra: neither [train] nor [all] installs it.
--tensorboardand--wandbcannot be used together.
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.