soup loop: the continual-learning loop around soup serve
soup loop reads what people did with the answers a soup serve gave them, trains a candidate LoRA adapter on it, checks the candidate, loads it into the same running server as a canary, and then promotes it or withdraws it. It is a control file (.soup/loop.yaml), a daemon (soup loop watch) and five stages (harvest, train, verdict, deploy, canary); upstream calls the whole a continual-learning loop. A new loop trains sft by default (dpo and kto are the other two) from thumbs, ratings and edits (the feedback log also keeps comments, which nothing trains on or scores), checks the candidate with soup ship --gate loop-v2, and gives a loaded candidate 5% of keyed traffic.
soup serve (--trace-log, --feedback-log, --adapter-dir)
-> harvest the feedback -> train (sft, dpo or kto)
-> soup ship --gate loop-v2 -> load into the running server
-> canary on 5% of keyed traffic -> promote it or withdraw itIt trains on feedback, measures the candidate and withdraws a canary on a significant rating regression; with the default settings a canary that never collects 30 ratings on each side is promoted on request errors alone (the canary rule). It does not assume the candidate is better, and parts of the cycle were not run by hand before the release: read Limitations before you rely on it. soup loop first shipped in v0.58.0 as a control file and a daemon with stub stages, --pre-wired bound the real stages in v0.71.4, and v0.78.0 rebuilt the cycle (#2897, which folded 17 stacked pull requests into one). What this page said about the earlier cycle is at the end, under what this page said before v0.78.0. The release notes are on the v0.78.0 page.
Before you start
soup-cli[train]for thesoup trainandsoup shipchildren,soup-cli[serve]for the server, andhttpxfor the loop's own requests to the server (the deploy, a rollback after a promotion and the paraphrase step). Soup declareshttpxonly in itsgenerateandsglangextras, sopip install "soup-cli[train,serve]" httpxis the one line. Without it the deploy fails and the iteration's notes sayadapter load failed: no response from the serve endpoint (httpx is not installed).- A task-eval file for
--eval: JSONL, one{"prompt": "...", "expected": "..."}object per line. - A server token, 16 to 128 characters from
A-Z a-z 0-9 _ -(the rule). The loop sends it toPOST /v1/adapters/load, which needs it on every bind, so the loop cannot deploy without one. - Something that sends keyed requests and posts feedback. A request is keyed when it carries a
conversation_idin the body or anX-Conversation-Idheader; feedback is posted toPOST /v1/feedbackwith theresponse_idthe answer came back with (both in Inference Server). - One loop per project. Two
soup loop watchprocesses on one project would both change the version counter, and upstream says the loop takes no lock against that. Do not run twosoupversions against one project either: an older one drops the version counter when it savesloop.yaml.
The nine subcommands
soup loop init <served-model> --eval <task-eval.jsonl> --baseline <ref> [options]
soup loop status
soup loop pause
soup loop resume
soup loop set <base_model|trace_dir|verify> <value>
soup loop watch [--foreground|--detach] [--max-iterations N] [--poll-interval SECONDS] [--pre-wired] [--pack-cans] [--tool-auth-token <token>]
soup loop canary <adapter> [--traffic 5%] [--autoroll-on-regress|--no-autoroll-on-regress] [--allow-dont-ship]
soup loop rollback
soup loop replay [<iteration-id>] [--extract <dir>]| Command | What it does |
|---|---|
init | Creates .soup/loop.yaml. On an existing loop it needs --force, which starts the state over: production, canary, cursors, counters and versions are reset, and the append-only logs keep the earlier loop's lines and gain another initial line. |
status | Prints the counters and what the loop is waiting for: daemon, production, verify, train_method, the sft recipe, new_data_since, a waiting row, last_failure, train_retry, a promotion row and a server row. It writes nothing. |
pause and resume | Flip the status at the next cycle boundary; a running soup train child keeps going. resume also clears a failed-train hold (the train_retry row), paused or not. |
set | Changes ONE setting, base_model, trace_dir or verify, under the state lock, and touches nothing else and no version log. Use it instead of init --force. |
watch | The daemon: one cycle per poll (--poll-interval, 1 to 3600 seconds, default 60). --detach runs it in the background. |
canary | Starts a canary by hand for an adapter you loaded yourself. It refuses an adapter whose newest iteration ended with a DON'T SHIP verdict that stopped the rollout, unless --allow-dont-ship is given (see the canary rule). |
rollback | Returns to the version that was production before the last promotion, and withdraws a running canary. |
replay | With no argument lists the recorded iteration ids; with an id prints that iteration's manifest. --extract <dir> unpacks the iteration's Soup Can (only iterations run with --pack-cans have one; otherwise exit 1 no .can for <id>); <dir> must sit under the current directory and not be a symlink (exit 2). |
The group's own --help line still reads "Data flywheel: traces -> preference pairs -> DPO -> gate -> canary deploy -> rollback" (upstream's docstring; a new loop trains sft).
soup loop init options
| Option | Meaning |
|---|---|
--eval (required) | What the check runs. With the default --verify ship, a task-eval JSONL; with --verify eval-gate, an eval-gate suite YAML. A file the chosen check cannot run is refused (exit 2) at init --pre-wired and watch --pre-wired; a soup eval lock design file is refused with its own message. Without --pre-wired the same mismatch is a warning and init exits 0. |
--baseline (required) | A registry id or a file. Only --verify eval-gate reads it (the eval gate compares against it). With the default check it is stored and nothing reads it. |
--pre-wired | Binds the real stages instead of the no-op stubs for every later soup loop watch (a single watch can take --pre-wired too). Without either, watch runs the stubs, which is the shape the daemon shipped in at v0.58. |
--base-model, --trace-dir, --feedback-log, --thumbs-db | Where the train stage starts from, and where the harvest reads. See what the harvest reads. |
--verify | The check before rollout: ship (default) or eval-gate. |
--train-method | sft (the default for a new loop), dpo or kto. |
--sft-target-modules, --sft-lora-r, --sft-lora-alpha, --sft-lr, --sft-epochs, --sft-batch-size, --sft-grad-accum, --sft-seed, --sft-quantization | The sft recipe. Only for an sft loop; for any other method they are refused (exit 2) because they would change nothing. |
--min-new-edits, --min-new-rated, --min-new-pairs | When a cycle trains (see below). Defaults 8, 30 and 1. |
--canary-traffic, --canary-max-wait, --canary-on-timeout | The canary: its share (default 5%, above 0 and at most 100), how long ratings may stay short (default 24h, at most 30d), and what happens then (errors-only, rollback or wait). |
--paraphraser-endpoint, --paraphraser-model | Which chat model writes the paraphrases of the prompts people corrected. Both or neither. |
--monthly-budget, --max-runs-per-day | The guardrails, below. |
Every refusal exits 2 and names the option: a bad --train-method, an --sft-* value out of range, --canary-traffic 0, 101 or text, --canary-on-timeout never, --canary-max-wait 31d, a --paraphraser-endpoint without a model or with a private or remote http URL, a --trace-dir that is a file, --min-new-edits 0, a bad --verify, and an init over an existing loop without --force.
A first loop, end to end
Step 1. Start the server the loop will read from and deploy to. Run it from the directory that holds .soup/: the server takes the loop state and canary-stats.json from the working directory.
mkdir -p .soup-loops/traces .soup-loops/adapters
export SOUP_TOOL_AUTH_TOKEN="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"
soup serve --model ./base \
--trace-log .soup-loops/traces/serve.jsonl \
--feedback-log .soup-loops/feedback.jsonl \
--adapter-dir .soup-loops/adaptersStep 2. Send keyed requests and record what people do with the answers. The answer carries a response_id; the feedback names it.
curl -s http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"conversation_id": "user-42", "messages": [{"role": "user", "content": "How do I reset my password?"}]}'
curl -s -X POST http://127.0.0.1:8000/v1/feedback \
-H "Authorization: Bearer $SOUP_TOOL_AUTH_TOKEN" -H "Content-Type: application/json" \
-d '{"response_id": "<the response_id of that answer>", "kind": "edit", "edited_text": "Open Settings, choose Security, then Reset password."}'Step 3. Create the loop. The base model is the model the train stage starts from: --base-model, else the registry entry's base for a registry://<id> served model, else the base_model_name_or_path of a served LoRA adapter directory, else the served model itself. When none is known, init --pre-wired and watch --pre-wired refuse with the reason (exit 2) instead of training a stand-in.
soup loop init ./base --eval evals/tasks.jsonl --baseline registry://prod --pre-wiredStep 4. Start the daemon with the server's address and the same token. The endpoint must be loopback or a private address on your LAN, and plain http only for loopback (soup serve has no TLS). Pass the token with --tool-auth-token or the variable; a --detach child gets it through its environment, never its argv.
export SOUP_TOOL_AUTH_TOKEN="<the token from step 1>"
export SOUP_LOOP_SERVE_ENDPOINT=http://127.0.0.1:8000
soup loop watch --detach
soup loop statusFrom here the daemon polls. A poll that finds nothing to train writes no iteration line and no iter-* directory and does not use up --max-runs-per-day; loop.yaml keeps its time and reason, and soup loop status shows it as last_idle_poll. When enough new feedback has arrived the cycle runs; soup loop replay lists the iterations and .soup-loops/progress.jsonl shows each stage as it happens. Upstream's second pre-release pass (a CPU, SmolLM2-135M) ran one full iteration to a recorded end state, DON'T SHIP; nobody ran the deploy and the canary after a SHIP verdict before the release (see Limitations), so watch the first real promotion yourself.
What the harvest reads, and what it trains
One harvest builds three datasets from the same inputs, and --train-method picks the one the loop trains on.
| Input | Where it comes from |
|---|---|
| Conversation records | The trace directory: SOUP_LOOP_TRACE_DIR, else the trace_dir saved in loop.yaml (init --trace-dir, loop set trace_dir), else .soup-loops/traces. init and status print which one applies. Files are read whole: *.jsonl and the serve.jsonl.<n> files soup serve rotated away. A version 1 line has an id and joins the feedback log; a version 0 line (written before v0.78.0) has none, so feedback cannot point at it, and it counts only for the serve-trace pairs (a thumbs_up trace). |
| Feedback | The feedback log: SOUP_LOOP_FEEDBACK_LOG, else feedback_log in loop.yaml (init --feedback-log), else .soup-loops/feedback.jsonl. It joins the conversation records by response_id; feedback about an answer that is not logged is ignored and counted, and a line with an unknown schema_version is skipped. |
| Thumbs database | soup serve --record-thumbs, named by init --thumbs-db or SOUP_LOOP_THUMBS_DB (since v0.77.0). |
For thumbs, ratings and edits the latest line per answer wins, a null clears it, and comments accumulate (they are stored; nothing trains on them or scores them).
| Method | What a row is |
|---|---|
sft | The edited text as the answer to the prompt, and every answer without a real edit whose newest label is good: a thumb up or a rating of 4 or 5 in the feedback log, an up thumb in the thumbs database, a thumbs_up serve trace. An answer that was only rated bad gives no row. |
dpo | An edit is a pair (chosen = the edited text, rejected = the answer), next to the pairs from serve traces and the thumbs database. |
kto | The answer as given, labelled by thumbs (+1 good, -1 bad) and ratings (4 and 5 good, 1 and 2 bad, 3 nothing), the newest deciding, and an edit's text as a good row next to the original as a bad one. |
An edit wins, for every method. For an answer with a real edit (one that differs from the answer after trimming) the latest edit decides whatever thumbs or ratings say before or after it: a later thumbs-up never makes the original good.
When a cycle trains. The loop keeps a data cursor that follows the version in production, so it trains on news. An sft loop with a feedback log (the file exists) trains once --min-new-edits new edits (default 8) or --min-new-rated new rated answers (default 30) have arrived, whichever comes first; otherwise --min-new-pairs (default 1) new rows of the dataset. A skipped cycle says why in its notes: not_enough_new_data: 3 new edits (needs 8) and 12 new rated answers (needs 30) since the last training run. Every run starts a fresh LoRA from the base and trains on all rows. A second cursor remembers the newest feedback a training run read, so a rejected run is not repeated on its own rows every poll.
What it trains with. The sft recipe is rendered into the soup.yaml the train stage writes: all linear modules, LoRA r 64 and alpha 128, learning rate 2e-4, 8 epochs, micro-batch 2 with gradient accumulation 4 and seed 42, quantization: auto. dpo and kto train 1 epoch at learning rate 5e-5 (kto at batch size 2, which soup train requires) and take no recipe flags. data.max_length is the longest row of the dataset in tokens of the base's tokenizer plus 16, rounded up to a multiple of 64, never below 64 and never above 2048. The hardware-fit gate is not bypassed and the loop never passes --allow-oom-attempt. quantization: auto is none when the base fits free VRAM by a rule of parameter count x 2 bytes x 5, and 4-bit otherwise; it is decided in a child process with a 60 second timeout, an unknown parameter count (an offline Hub, for a base named by Hub id), no CUDA device, no torch or a probe that fails give 4-bit, and the reason goes to the iteration notes, not the console (tracked as #3033). The default recipe regressed small evaluation suites in a study on one project; see Limitations.
Paraphrases. Before it trains, the train stage asks a chat model for two paraphrases of the last user message of every correction it trains on that has none yet, and appends them to .soup-loops/paraphrases.jsonl. The verdict later asks the new version the paraphrases instead of the original prompt, to see whether it learned the correction. They are never training data. A paraphrase equal to the prompt apart from case, punctuation and spacing (same_as_prompt), or holding at least half of the words the correction added (leaks_answer), is dropped; with fewer than two left the model is asked once more, and an edit with none left gets no line. The writer is --paraphraser-model at --paraphraser-endpoint (an OpenAI-compatible URL on this machine or the LAN; it is sent no token), else the loop's own server with the tool token and X-Soup-Internal: loop-check, which keeps the calls out of the conversation log. A small served model paraphrases poorly, so name a larger one. The step never stops training: an endpoint that does not answer ends the step and the note names the first failure.
The check before rollout
With the default --verify ship the verdict is soup ship --gate loop-v2 of the new adapter against the production version: base plus the production adapter (--base-adapter), or the bare base before any promotion. The details of the gate are on soup ship. In short: it asks whether the new version learned the corrections people made, and whether it kept the edits that were held out of training.
- The split. A correction is held out when
int(sha256(text.strip().casefold()), 16) % 100 < 30, where the text is the content of the last user message of its conversation. A held-out edit is kept out of training in exactly one iteration, the first that trains, and is that iteration's held-out check; after that it trains and counts in the corrections check. Thumbs and ratings are never held out. - The wait. With one to four trainable corrections the cycle trains nothing and spends no GPU: the notes, a progress line and the
waitingrow ofstatussayWaiting: 4/5 trainable corrections (2 more kept aside for checking), and the edits keep accumulating. Five or more train, if the usual trigger allows it; with none, the usual trigger (30 rated answers for an sft loop with a feedback log) decides. - The verdict. SHIP needs the corrections check to pass (a one-sided sign test over at least 5 edits where the two versions differ, p below 0.05), the held-out check not to fail, and the general suites to hold. The held-out check is not measured below 5 edits and weak below 10, so at the default trigger it is often not measured at all: the verdict then says
held-out edits not checked: N of 5 needed, and a SHIP must not be read as "the held-out edits passed". The thresholds in this bullet are from upstream's documentation of the gate and the arithmetic was not run here. - No corrections. With nothing to check and the suites holding, the verdict is DON'T SHIP with
canary_decides: true, and the loop still deploys the candidate to a canary: the canary's ratings decide (No corrections to check - the canary's ratings decide). A loop without a feedback log has no ratings, so such a canary is judged by request errors alone. Any other DON'T SHIP stops the rollout. - A verdict that could not be reached is
SKIPPED: nothing rolls out, and the reason is in the iteration record.
--verify eval-gate keeps nothing aside and does not wait for corrections; --eval is then an eval-gate suite YAML and --baseline the registry id or file it compares against. An older loop.yaml with no verify keeps the eval gate; soup loop set verify ship (or eval-gate) changes the check without --force.
The canary rule
After SHIP (or a DON'T SHIP with canary_decides) the deploy stage POSTs {"name", "path"} to POST /v1/adapters/load on SOUP_LOOP_SERVE_ENDPOINT (the server needs --adapter-dir and its token; the path is the adapter's absolute path, so the server must see the same files) and starts a canary. The new adapter gets --canary-traffic (default 5%) of keyed traffic: the router hashes the request's conversation_id or X-Conversation-Id, so one conversation stays in one bucket. Unkeyed traffic stays on production, an explicit adapter field in a request still wins, and while a canary runs soup loop watch starts no new iteration. The stable side is the promoted production adapter, or the served base model before any promotion, even when another adapter was activated by hand. A client chooses its own key, so a client can pick one that hashes into the canary bucket.
Two verdicts, combined strictly: MAJOR if either is MAJOR, OK only when both are OK, UNKNOWN otherwise.
- Request errors. After at least 30 canary answers the verdict is
MAJORwhen the canary's success rate trails the stable bucket's by more than five percentage points. - Quality. When a feedback log exists and the canary recorded its start, the loop reads what people said about the rollout's answers: of the answers given after it started, per bucket, the rated ones (a thumb, a rating or an edit) and the share with negative feedback (a thumb down, a rating of 1 or 2, an edit). It needs 30 rated answers on each side, and at most 3 rated answers of one conversation id count per side. The verdict is
MAJORwhen the canary's negative share exceeds stable's by more than five points and a one-sided pooled two-proportion z-test says the gap is not chance (z above 1.645); otherwiseOK.OKat the minimum means no significant regression was found, not that the canary is proven equal, and a gap of five points on a few dozen ratings is often chance. The iteration keeps the numbers incanary_quality.
OK promotes the canary: the server switches unkeyed traffic to it and it becomes the router's stable side. MAJOR withdraws it (with --autoroll-on-regress, the default) and production never changed. A promotion is written in this order: the server switch, then loop.yaml, then versions.jsonl and the iteration's closing line. If the server refuses, nothing is recorded as promoted and the cycle ends there; the next poll asks the server again. A watch stopped between two of those writes finishes the promotion when it starts, or reports a mismatch it cannot finish (the promotion row of status).
Waiting for ratings, and how long. With a feedback log a canary waits for the ratings, but not for ever: --canary-max-wait (default 24h; <int>m, <int>h, <int>d or plain seconds, at most 30d) counts from the rollout start, and then --canary-on-timeout decides (both options belong to soup loop init). errors-only (the default) lets the request-error verdict decide alone, with however many answers there are, so a canary can be promoted with its quality unverified: a canary whose requests did not fail more than the stable side's is promoted (the notes say promoted on errors only - quality unverified: 7/30 canary rated in 24h, or promoted on timeout: 5 canary answers, 40 stable answers in 24h, decided on request errors alone when it had too few answers for a request-error verdict of its own), and one whose requests failed more is withdrawn while --autoroll-on-regress is on, which is its default and always the case for a canary the loop starts itself. A canary that got no answers at all is not promoted on a timeout: it is withdrawn (timeout_no_answers) unless errors-only was given explicitly at init, in which case it promotes with no evidence. rollback withdraws it, and wait has no limit: it keeps waiting. A loop without a feedback log, or a canary that recorded no start, is judged by request errors alone. Upstream plans to change that default from errors-only to rollback in v0.79.0, so that a canary without 30 rated answers on each side at the end of the wait is withdrawn; tracked as #3083.
By hand. soup loop canary <adapter> --traffic 5% starts a rollout for an adapter you loaded yourself (--adapters or POST /v1/adapters/load). It refuses an adapter whose newest iteration ended with a DON'T SHIP verdict that stopped the rollout (outcome skipped in iterations.jsonl); an iteration whose DON'T SHIP still went to a canary (canary_decides), was promoted or was withdrawn is not refused. With no iteration for that name, a verdict file .soup-loops/verdicts/<adapter>.json that says DON'T SHIP refuses it. Exit 2, naming the adapter; --allow-dont-ship canaries it anyway and the override is recorded in loop.yaml (canary_override), in the canary start line of progress.jsonl and, if the canary is promoted, in the promotion's note and its versions.jsonl line. An adapter the loop has no verdict for is not checked. soup loop rollback withdraws a running canary and, after a promotion, returns to the previous version: it points unkeyed traffic back through the server (SOUP_LOOP_SERVE_ENDPOINT, with the token) and makes the previous version the stable side again. With nothing promoted it withdraws a running canary and the served model keeps all traffic; with no canary either it is refused.
What the counters do not see. They are buffered and flushed after 64 outcomes or two seconds, so canary-stats.json and the verdict lag traffic by that window, and a crash can lose it. A canary that kills the serving process never records its own outcome. The stats file is protected by a lock between threads of one process, not between several server processes.
The daemon
soup loop watch runs the cycle every poll and reloads loop.yaml each time, so pause, resume, set and canary take effect without a restart.
--detach. The child runs in its own session (POSIX) or process group without a console (Windows), with stdin on the null device, so closing the terminal or pressing Ctrl+C there does not reach it. Its pid goes to .soup/loop.pid as JSON (pid, started_at, log) and its output is appended to .soup/loop.log, rotated at 10 MB with one old file kept as .soup/loop.log.1. While the file names a live process a second --detach exits 2 naming the pid and the file, and so does a foreground watch; a stale file is replaced with a notice. A recycled pid reads as alive, so delete the file if that pid is not a loop daemon. There is no soup loop stop: run soup loop pause, then end the process once its current cycle is over. Before it starts or detaches, a pre-wired watch checks the thumbs database, the trace directory, the feedback log, --eval with --verify and the base model, and exits 2 with one named reason for each.
Failures wait. A training run that failed is not started again on every poll: the same inputs (dataset, method, base model, recipe) wait 5 minutes after the first failure and 30 after the second, and the loop holds after the third until the inputs change (new feedback makes a new dataset) or soup loop resume clears the hold. A stage that raises (cost, harvest, train or gate) is recorded in last_failure with its name and exception type, the traceback goes to .soup/loop.log, and the same waits apply (failures in alternating stages restart the count). A refused deploy is attempted once per poll, three times in all (the first included), with no back-off. The notes of a waiting cycle start train_backoff:, train_held:, stage_backoff: or stage_held:. Ctrl+C and SystemExit still stop the daemon.
On Windows, every child the loop starts gets CREATE_NO_WINDOW, and a child that ends by a signal or an NTSTATUS code is named in last_failure. Upstream's documentation says the child removes the PID file when it exits normally. While the file names a process that is gone, soup loop status prints daemon: not running (stale pid file), and the next --detach replaces a stale file.
What each stage writes
State is .soup/loop.yaml (written atomically, cwd-contained, symlinks refused, 1 MiB cap, owner-only on POSIX); everything else is under .soup-loops/. The JSONL logs are append-only, created owner-only on POSIX (on Windows the folder's permissions apply), and a link, junction or hard link in the way is refused. Their schemas are defined in upstream's Loop data formats, with JSON Schemas shipped in the package.
| Stage | Writes |
|---|---|
| harvest | pairs/<prefix>-<12 hex>.jsonl, the dataset of one training run (prefix pairs, kto or sft; the same rows are the same file; not written while not enough is new) |
| paraphrase | paraphrases.jsonl |
| train | adapters/<run>/ and adapters/<run>.train.log |
| verdict | verdicts/<run>.json (the soup ship --output file), verdicts/<run>.ship.log, verdicts/<run>.corrections.jsonl, verdicts/<run>.held-out.jsonl, and holdout.jsonl (which edit was kept aside or graduated, in which iteration) |
| deploy and canary | loop.yaml (canary fields), progress.jsonl, and the serving side's .soup/canary-stats.json |
| every iteration | .soup-loops/<iteration-id>/iteration.json (plus iteration.can with --pack-cans), and a line in iterations.jsonl, with another line for the same id whenever its outcome changes later (canary, promoted, rolled back); the latest line wins |
| promotion and rollback | versions.jsonl: initial at the first init --pre-wired or watch cycle, promote by the daemon, rollback by soup loop rollback; a withdrawn canary adds none |
progress.jsonl has one canary line per cycle while a canary waits for ratings, with done the rated canary answers and total the 30 the verdict needs. A log line that cannot be written (disk full, a link in the way) is a warning and a note on the iteration and never stops the loop. Version numbers are integers from 1 in loop.yaml; a promotion takes latest_version + 1, so a number is never reused after a rollback.
The iteration manifest iteration.json keeps iteration_id, started_at, finished_at, pairs_harvested, run_id, gate_verdict (OK, MAJOR or SKIPPED), canary_verdict (OK, MAJOR, UNKNOWN or None), shipped, rolled_back, estimated_cost_usd and notes, and since v0.78.0 eight optional keys: canary_quality, verdict_gate, verdict_corrections, verdict_held_out, verdict_reason, graduated, train_log and verify_log. A manifest from an older release loads without them. The id is iter- plus a UTC timestamp and eight hex digits, and soup loop replay walks the directory in chronological order.
Budget guardrails (since v0.58, with changes through v0.78.0)
parse_budget_string accepts "50usd", "50" and "50 USD" (at most $1M). Each iteration runs through a check in this order: the daily cap (UTC-day rollover), an estimate-sanity check that refuses implausible cost estimates, and the monthly budget (projected total against the cap). A budget-skipped iteration produces no manifest, so there are no half-records for soup loop replay.
- The month rolls over on its own (since v0.77.2, #2362). When the UTC month of an iteration differs from the month of the saved
last_run_date,spent_this_month_usdrestarts at 0 before the budget check; a year change counts, and a loop that has never run keeps its spend.soup loop statusapplies the same resets to what it shows and writes nothing, and exits 2 withloop state invalid:when the stored monthly spend isNaN, infinite or negative (#2390, #2424). - Hand-edited values (since v0.78.0, #2897). A
loop.yamlwith amonthly_budget_usdorspent_this_month_usdthat is not finite or is above 1e15 was read before and is refused now, exit 2, naming the field; a hundreds-of-digits integer incanary_traffic_pct,deploy_traffic_pct,monthly_budget_usdorspent_this_month_usdis refused by the field's name instead of a traceback (#2982). Write a number from 0 to 1e15, or remove the line. A spend above 1e15 was run on both versions (v0.78.0 exits 2 withloop state invalid: ... spent_this_month_usd must be in [0, 1000000000000000]; v0.77.2 printed the status table and exited 0); the hundreds-of-digits integer is from the release notes and was not run. - The idle poll (above) is not an iteration and does not count toward
--max-runs-per-day. A failed train, a DON'T SHIP and a deploy retry each did something and keep their line. - The GPU price table grew in v0.76.0 (#831): L4, A10G, H200, B200, the RTX 40 and 50 series and the RTX PRO 6000 had no rate and counted as $0, so the budget gate never fired for them. The table is a ballpark: laptop parts such as
RTX 4090 Laptop GPUstill price as the desktop card, which overstates a laptop run, and the A10G row is a whole AWS instance.
The server connection and the token
The deploy needs SOUP_LOOP_SERVE_ENDPOINT: a URL whose host is localhost, a loopback address, or a private or link-local IP literal, with plain http accepted only for loopback; any other hostname is refused rather than resolved. Unset, nothing is deployed and the iteration's notes say no SOUP_LOOP_SERVE_ENDPOINT configured. The token is --tool-auth-token on soup loop watch, or SOUP_TOOL_AUTH_TOKEN (which keeps it out of the shell history), and the loop sends it as Authorization: Bearer <token> to POST /v1/adapters/load, to /v1/adapters/activate, on the paraphrase request and on soup loop rollback. The audit log records the option's value as <redacted>. A refused request is named in the iteration's notes, for example adapter load refused (401): the serve endpoint requires its tool token, adapter load refused (404): ... start soup serve with --adapter-dir .soup-loops/adapters or adapter load refused (403): the adapter is outside the server's --adapter-dir, and nothing is promoted. A plain-http (loopback) request ignores HTTP_PROXY and ALL_PROXY, so a proxy never sees the token in clear text; an https endpoint still reads the proxy and certificate environment.
soup loop status asks the server's /health which adapter is active, when loop.yaml names a production adapter, and prints a server row: serving production NAME, NOT serving production NAME (a restarted server answers with the base model), serving OTHER, not reachable, or not checked when the variable is not set in that shell. After a server restart a promoted adapter is not loaded again (soup loop does not replay loop.yaml), so the stable side is the base model until the loop deploys the next version or you load the adapter by hand.
The thumbs database (since v0.77.0, #1440). With the pre-wired stages the harvest also reads the SQLite database soup serve --record-thumbs writes; its pairs are unioned with the trace pairs and tagged source: "soup-serve-thumbs". The path must stay under the working directory for both --thumbs-db and SOUP_LOOP_THUMBS_DB (which wins). With the pre-wired stages soup loop watch checks a configured database before it starts or detaches and exits 2 when it is outside the working directory, a symlink, missing, not a thumbs database, or a thumbs table without the prompt, response, thumb and ts columns (#1966); a database that is only locked by a running soup serve passes. Since v0.77.2 (#2495) the trace-log pairing, like soup data from-traces --signal thumbs_up, pairs a thumbs-up and a thumbs-down answer that differ and skips a prompt whose answers are all the same text; that covers the trace pairs only, not the pairs read from the thumbs database. A harvest of one or two pairs trains (since v0.77.0, #1968): the generated config sets data.val_split: 0, and when training is skipped the notes say why, for example no_preference_pairs: 0 valid pairs harvested, training skipped.
Exit codes
| Command | Exit | When |
|---|---|---|
init | 2 | Any refusal listed under the options, --pre-wired with no base model known, --pre-wired with an --eval file the check cannot run, or an existing loop without --force |
set | 2 | An unknown key (cannot set 'bogus': soup loop set changes base_model, trace_dir, verify), an empty base_model, an empty or non-directory trace_dir, or an invalid verify (invalid verify 'bogus': one of ship, eval_gate; both eval-gate and eval_gate are accepted) |
set, pause, resume, canary, rollback | 1 | loop.yaml is locked: one line, nothing written (upstream's documentation and the code; not run) |
canary | 2 | The adapter's newest iteration ended with a DON'T SHIP verdict that stopped the rollout (see the canary rule) and --allow-dont-ship was not given |
rollback | 2 | nothing to roll back to: no canary has been promoted and no canary is running; production is still the served model |
rollback | 0 | A running canary with nothing promoted: canary withdrawn: <name>; the served model keeps all traffic, no server needed |
rollback | 1 | After a promotion the server refused: rollback failed: ...; loop.yaml is unchanged (code; the post-promotion path was not run) |
watch | 2 | A second --detach, a foreground watch while a live daemon holds .soup/loop.pid, or a failed pre-wired check |
watch | 1 | The daemon stops itself because loop.yaml is gone or invalid |
status | 2 | loop state invalid: (a stored monthly spend that is NaN, infinite, negative or above 1e15) |
replay | 1 | no .can for <id> |
Limitations
These are upstream's, carried from the v0.78.0 release notes and shortened; each names its tracker where upstream does.
- Not exercised by hand before the release. The deploy and the canary after a SHIP verdict (the one iteration ended DON'T SHIP), a canary decided by 30 real ratings, and a paraphrase endpoint other than the served model. The second of upstream's two pre-release passes (a CPU, SmolLM2-135M and 5 task rows) ran one full iteration to a recorded end state,
soup loop canarywith and without--allow-dont-ship, a livesoup shipand the--detachguards. Nothing on this page claims the whole cycle was validated end to end. - The default recipe may hurt. It (all linear modules, r 64 and alpha 128, lr 2e-4, 8 epochs) regressed small evaluation suites in a study on one project; milder defaults and anchors are untested (tracked as #3014 and #3013).
- The check is noisy at small sizes. A 40-row suite's base side, captured nine times on the same merged model between
soup shipcalls, read 0.925 eight times and 0.900 once, so on that suite one item is 0.025 and a 0.05 threshold is two items.eval.custom.score_semanticis word overlap: a short correct answer against a long reference can score 0.0. The numeric scorer behindmini_arithmeticcounts a correct answer written with a thousands separator (32,768) as wrong (tracked as #3012, #3013 and #3065). - Feedback is training data. On a loopback server started without
--tool-auth-token, any local user or process can post to/v1/feedback; startsoup servewith a token on a shared machine. The loop does not check an edit for intent, and the loop-v2 gate checks a candidate against the corrections it was trained on, so a poisoned edit that the model learns passes that check; the canary's ratings andsoup loop rollbackare the other defences.soup loopreads--trace-dirfiles whole: keep--trace-log-cap-mbat its default on a server others can reach. By design; no issue. - The disk grows.
.soup-loops/grows with every training run and nothing is pruned or rotated: each run keeps its adapter, recipe, logs and verdict files, and each append toiterations.jsonlorversions.jsonlreads the file once. Archive old.soup-loops/adapters/*by hand once they can no longer be a rollback target (tracked as #3015). - Running and stopping.
init --forcedoes not check for a running daemon; there is nosoup loop stop; two foreground watches are not guarded against each other; a stop between an adapter load and the end of its cycle, and between arollbackorcanarylog line and theloop.yamlupdate, is not reconciled. Running the same command again is safe (tracked as #3016 and #3017). - Deploy retries. A refused deploy is attempted once per poll, three times in all (the first included), with no back-off, so a
soup serverestart longer than a few minutes ends the retries; deploy the adapter by hand withsoup loop canary <adapter directory>(tracked as #3018). - Processes and files. The loop's own children start without the current directory on
sys.path(-P); a Python process thatsoup trainorsoup shipstarts in turn does not, so run the loop in a directory you control (tracked as #3019 and #3020).soup shiprefuses an--outputthat is one of its inputs but does not compare the training file a--confignames, so do not name your training data as an output. - Offline,
quantization: autois 4-bit. The base's parameter count cannot be read, so an offline loop trains in 4-bit unless--sft-quantization noneis given; the reason is written to the iteration record, not printed (tracked as #3033). - The manual canary check applies to an adapter's own directory under
.soup-loops/adapters, not to a checkpoint inside it, and on a case-insensitive file system to a run name in the letter case the run was recorded with (tracked as #3068). - The check is a live
soup shiprun that loads the models and prints nothing between loading and the result; see its limitations on soup ship. - Windows disconnects. On Windows a client disconnect may not reach the server's generator promptly, so a streamed generation can run on until the reply ends (see Inference Server).
httpx. The deploy, a rollback after a promotion and the paraphrase step go throughhttpx; see Before you start.- Slow patterns. Two patterns in the paraphrase step and in the loop-v2 gate are slow on a pathological reply; the reply comes from the paraphrase service you configured and is read up to 64 KiB.
- Text shown as typed. Some commands still print an exception's text through Rich without escaping it, so a name taken from an untrusted file can render as markup in an error line (tracked as #2489).
What this page said before v0.78.0
The earlier page described the v0.58 daemon with stub stages, the v0.76 canary and a DPO loop. These statements are no longer true, or are true only in a narrower case:
- "production traces → preference pairs → eval-gated DPO → canary deploy → auto-rollback" and "Seven subcommands". (Since closed in v0.78.0: a new loop trains sft by default and
dpoandktoare options; it learns from thumbs, ratings and edits, not only pairs; the check issoup ship --gate loop-v2by default; there are nine subcommands. Aloop.yamlthat has notrain_method, or saysdpo, keeps training dpo, and one with noverifykeeps the eval gate.) - "The verdict therefore compares error rates; it does not score the quality of the output." (Since closed in v0.78.0, #2539: once a feedback log exists the canary is also judged by the negative feedback on its answers, as under the canary rule.)
- "Activation is a full hot-swap at 100% of traffic, so no canary split ran", and
canary_verdictbeingNonewhen the deploy only activated the adapter. (Since closed in v0.78.0, #2518: the deploy loads the adapter withPOST /v1/adapters/loadand starts a canary. Through v0.75.2 the stage recordedOKfrom the activation POST's bare 2xx, so a manifest from v0.75.2 or earlier withcanary_verdict: OKsays only that the activation succeeded.) - The routing "when the canary adapter was loaded with
soup serve --adapters" and "the stable bucket uses the served base model". (Since closed in v0.78.0:POST /v1/adapters/loadloads it too, and the stable side is the promoted production adapter.) - "
--detachis a single-process subprocess; full daemonization (double-fork, session leader, /dev/null fds) is deferred." (Since closed in v0.78.0, #2540: the session or process group, the null stdin, the PID file and the log, as above.) - The trace directory falling back to the served model's directory. (Since closed in v0.78.0, #2507: a model directory holding `.jsonl
files, a dataset next to the weights for example, was harvested as serve logs; the trace directory is now the variable, the savedtrace_diror.soup-loops/traces`.)* - The train stage of a
registry://<id>served model. Upstream's changelog, #2506: with such a served model "the pre-wired train stage trainedhf-internal-testing/tiny-random-gpt2and reported success". (Since closed in v0.78.0: the base is--base-model, the registry entry's base, a served adapter's base or the served model, and an unknown base is refused. On an existing loop,soup loop set base_model <hf-id-or-path>fixes it.) - A
--evalthat was asoup eval lockdesign file made every verdictSKIPPEDwithout a reason (#2512). (Since closed in v0.78.0:--evalis checked atinit --pre-wiredandwatch --pre-wired, and a skipped verdict keeps its reason.) - "Stage callbacks default to no-op stubs" (true only without
--pre-wired, which has bound real stages since v0.71.4) and "the pre-wired deploy stage sends no bearer token unless you give it one" (still true:--tool-auth-tokenorSOUP_TOOL_AUTH_TOKEN, since v0.77.0; through v0.76.1 it could not be given one).
See also
- Inference Server: response ids,
--feedback-log,--adapter-dirandPOST /v1/adapters/load, the v1 trace record and the token scopes - soup ship: the verdict, and
--gate loop-v2 - Eval-gated training: the
--verify eval-gatecheck - Trace-to-preference:
soup data from-traces, which reads the trace directory only and joins no feedback - Trace ecosystem:
soup ingestwrites records the harvest reads - Registry: where a
registry://<id>served model and its base model live - Diagnose and Advise: what to run before a loop iteration
- Adapter lifecycle (v0.67):
soup lockandsoup adapters bisectfor a canary that regresses - Pre-flight & tooling (v0.64):
soup planandsoup applycheck a config;soup loopdoes not call them, so run them yourself before an iteration
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.