Skip to content

Eval-Gated Training

v0.26.0 adds declarative eval suites that run at epoch boundaries. If a task score falls below its threshold — or regresses against a baseline — training halts before you waste another epoch.

The gate file

Every entry in tasks: is one of three types: custom, judge, or benchmark. Each task has a name (used as the baseline key) and a numeric threshold.

yaml
# evals/gate.yaml
suite: chat-quality
tasks:
  - type: custom
    name: tool_calls
    tasks: evals/tool_calls.jsonl
    scorer: exact            # exact | contains | answer | regex | semantic
    threshold: 0.70

  - type: judge
    name: chat_judge
    prompts: evals/judge_prompts.jsonl
    judge_model: ollama://llama3.1     # or https://... or http://localhost
    threshold: 0.70   # judge scores normalise to [0,1] off the rubric scale, not raw 1-5

  - type: benchmark
    name: mmlu
    benchmark: mini_mmlu
    threshold: 0.60

Enable it

Either inline in soup.yaml:

yaml
training:
  eval_gate:
    enabled: true
    suite: ./evals/gate.yaml
    every_n_epochs: 1              # 1-100
    regression_threshold: 0.05     # 0.0-1.0
    baseline: ./baseline.json      # registry://<id> | a path to a scores JSON
    on_regression: stop            # stop | warn | continue

Those six are the whole block. Since v0.78.0 a boolean in a numeric field of training is refused at load (training -> lr: lr must be a number, not a bool, #2462), but that check does not reach this block: every_n_epochs: true and regression_threshold: true still load (run with soup doctor --config, exit 0), so write the number. baseline takes a registry id (registry://<id>) or a path to a scores JSON (the file soup eval gate --write-baseline writes). The schema's field description used to list the word previous as well. Since v0.78.0 baseline: previous is refused when the config loads (#2640), in any letter case and even with enabled: false: soup train exits 1 and soup doctor --config exits 2 with training.eval_gate.baseline: 'previous' is not implemented; use a path to a baseline results file. (Since closed in v0.78.0: through v0.77.2 nothing read the word. It was looked up as a file named previous, which does not exist, so soup train logged eval gate: could not resolve baseline at warning level, the baseline stayed empty and the gate checked only each task's own threshold, so no regression against a baseline could fire.) Only the config key is refused by name: soup eval gate --baseline previous still looks for a file called previous and exits 3 when there is none. Since v0.78.0 a baseline you do name that cannot be resolved (a missing or unreadable path, a registry:// id with no results, a file with a non-finite score) stops training with eval gate: could not resolve training.eval_gate.baseline '<value>': <reason> instead of running with an empty baseline. That check runs when training begins, after the model has loaded, so --dry-run does not make it. Use a path or a registry id. on_regression decides whether a regression halts the run (stop, logged at WARNING), is only logged (warn), or is ignored with nothing written (continue).

…or on the command line:

bash
soup train --config soup.yaml --gate ./evals/gate.yaml

--gate loads the suite before training starts and exits 1 if the file is missing, outside the working directory or invalid (a suite that is not valid YAML prints Invalid --gate suite: eval-gate suite 'x.yaml' is not valid YAML: ..., exit 1, while soup eval gate exits 3 on the same file). Since v0.77.0 "invalid" includes a suite with no tasks and a suite that repeats a task name (Invalid --gate suite: ..., exit 1, also under --dry-run). Since v0.78.0 a training.eval_gate.suite path written in soup.yaml gets the same check up front (#2231, #2264). soup train, --dry-run included, exits 1 with Invalid training.eval_gate.suite: <message> for a suite that is missing (eval-gate suite not found: <path>), outside the working directory or invalid, before any data is read. The v0.77.0 refusals and the two added in v0.78.0 (a boolean threshold, a repeated key in a task mapping; see the tables below) land there too. A disabled gate's suite is never read, and soup doctor --config does not run this check: a config that names a missing suite passes it with exit 0, so use soup train --config soup.yaml --dry-run to check the suite. (Since closed in v0.78.0: through v0.77.2 a suite written in soup.yaml got no check up front. If it could not be loaded when training began, the callback logged eval gate: could not load suite as a warning and the run trained with no gate at all, so on_regression: stop could never stop it; a suite with no tasks or a repeated task name was logged the same way, and a baseline with a non-finite score was logged as eval gate: could not resolve baseline with the gate running against the thresholds alone.) The callback itself still logs and carries on for a suite that loaded at the up-front check and then fails later, read from the call site and not run. A suite that is not valid YAML or whose top level is not a mapping stops the training setup instead of running ungated (since v0.77.1, #1895). Once a gate is running, a gate that fails to execute mid-run does stop training under on_regression: stop.

Paths that cannot run a gate (v0.78.0)

An enabled training.eval_gate (or --gate) on backend: mlx and on task: prm, unlearn or moe_lora_routing is refused when the config loads (#2564): those paths attach no live training callback, so through v0.77.2 the run trained with no gate and exited 0. The message is training.eval_gate is not supported for backend='mlx' because MLX does not attach a live training callback (for a task it reads training.eval_gate is not supported for task='prm' because 'prm' does not attach a live training callback). soup train exits 1 and soup doctor --config exits 2; soup train --gate <suite> on those paths exits 1 with the same sentence without the Config validation error: prefix. A disabled or omitted gate still loads. To train there, set enabled: false or remove the block and --gate, then check the result with soup eval gate or soup ship afterwards. The MLX message was run on the v0.78.0 binary; the three task messages are from the code at the tag, and in our probes the config hit a different cross-field refusal first. The list of refusals is on Settings Soup refuses at load.

Post-hoc verdict

Run the gate standalone against any model:

bash
soup eval gate --suite ./evals/gate.yaml --model ./output --baseline ./baseline.json
# ✓ mmlu:        0.648 (baseline 0.643, +0.005) PASS
# ✗ chat_judge:  0.62  (baseline 0.78, -0.16)   REGRESSION
# → verdict: FAIL

The command exits 0 when every task passes, 2 when a task fails or regresses, 3 when the suite, the baseline or a flag is unusable (a --suite that is missing or fails the schema, a --baseline that is missing or not valid JSON, a --regression-threshold outside 0.0 to 1.0, --write-baseline without --model, and since v0.77.0 a suite with no tasks, a suite that repeats a task name, and a baseline score that is not a finite number, and since v0.78.0 the four cases in the table below), and 1 when --model cannot be loaded. Since v0.76.1 a suite larger than 1 MiB, nested more than 100 levels deep or expanding past its alias allowance is unusable too and exits 3 (see Size and nesting limits), with one line such as Cannot load suite: eval-gate suite 'suite.yaml' nests collections more than 100 levels deep; refusing; a YAML syntax error was the one load failure that stayed 1 through v0.77.0, with a bare Error: ParserError line, and a suite whose top level is a list or a scalar ended in Error: TypeError. Since v0.77.1 both exit 3 (#1895, reported by @taljeon, fixed by @Nari-Ab), with a line that names the file: Cannot load suite: eval-gate suite 'suite.yaml' is not valid YAML: ... or Cannot load suite: eval-gate suite 'suite.yaml' must be a mapping with 'suite' and 'tasks', got a list. An empty file still gets the generic Field required schema message, also exit 3. The same suite given to soup train --gate exits 1 either way, with Invalid --gate suite: .... Before v0.76.0 every one of those was 1, so a CI step that tests for exit 1 as "the gate failed" now passes a failing gate: test for 2, and see Exit codes. The suite needs a top-level suite: name, as in the example above; without it the load is refused (exit 3). --baseline / -b takes registry://<id> or a score JSON, and --regression-threshold (0.0 to 1.0, default 0.05) sets the allowed drop. Without --model it runs a smoke test with a stub generator that answers every prompt with an empty string, so scores are meaningless.

A task fails if its score is below its threshold or if it drops more than the configured regression threshold (default 0.05) below the supplied baseline.

A task that could not be scored fails the gate closed, and the log no longer calls it a regression (v0.76.0). A task whose evaluation raises, such as an unreadable task file or a judge that stays unreachable, gets no score and counts as failed, and the training log reads N task(s) could not be scored: <name>: <error> instead of N task(s) regressed. A judge error prints the judge URL without any user-info, query string or fragment, so a base URL that carries a key does not reach the log.

A suite with nothing to measure is refused (v0.77.0)

Through v0.76.1 several suites passed a gate without measuring anything. Since v0.77.0 each of these stops before any task runs, with exit 3:

Suite or baselinev0.77.0
tasks: [], no tasks: key, or a misspelled key such as task: that leaves the list emptyCannot load suite: eval-gate suite 's' field 'tasks' must contain at least one task (#1798, #1821)
Two tasks with the same name (the second score used to overwrite the first under the same baseline key)Cannot load suite: eval-gate suite 's' repeats task name 'a' (#1824, #1893)
A baseline score that is not a finite number: NaN, Infinity, or a JSON overflow such as 1e999Cannot resolve baseline: baseline file: score for 'a' must be finite (#1773, #1779); an integer too large for a float reads ... is out of range (must be finite) (#1865, #1903). A baseline is also checked when it is written

A judge task whose prompts file is empty is different: since v0.77.0 the task gets no score, its row reads ERROR with No judge prompts found in <file> for task '<name>', and the gate fails with exit 2 even at threshold: 0.0 (#1928). On v0.76.1 that task scored 0.0 without judging anything. Since v0.77.2 a judge prompts row that is not a JSON object, or whose prompt is not a string, gets the task an ERROR row too, and the gate exits 2: the verdict reads FAIL (judge task 'jt' file 'evals/p.jsonl' line 2: row must be an object, got list) or ... line 1: field 'prompt' must be a string, got int, with the physical line counted (#2494, by @taljeon). A missing prompt and an empty string are still accepted. Since v0.78.0 (#2881, which closes #2535) every row of the file is read and validated before the first generation, so a bad row anywhere makes zero generations. (Since closed in v0.78.0: through v0.77.2 the file was checked row by row while the rows were generated, so a bad row at line 500 was found after 499 generations.) An empty custom tasks file fails the same way, as it already did at v0.76.1: the row reads ERROR with No eval tasks found in <file> and the gate exits 2.

On v0.76.1 an empty suite and a misspelled tasks key printed GATE PASSED with exit 0 without running a task, a repeated task name let the second score overwrite the first under the same baseline key, and a NaN baseline let a regression pass silently, so a CI gate that has only ever passed may have measured nothing: read its suite.

More suite refusals (v0.78.0)

Four more suites or baseline writes stop with exit 3 from soup eval gate, before the model is built. A training.eval_gate.suite or --gate suite with the first three exits 1 instead (the same loader, through the up-front check above); the --write-baseline case does not apply to training.

Suite or flagWhat happened through v0.77.2v0.78.0
A top-level key that is not a string (1: x)Error: TypeError: keywords must be strings, exit 1 (#1915, #2021)Cannot load suite: eval-gate suite 's.yaml' has a non-string key 1; top-level keys must be strings, exit 3
A boolean threshold (true, and the YAML spellings yes, on, false, no, off)loaded as 1 or 0 and ran the gate (#2696, #2697)Cannot load suite: eval-gate suite 's.yaml': tasks[0].threshold: threshold must be a number, not a boolean; write threshold: 0 or threshold: 1 if you meant it
A key repeated inside one task mapping (threshold twice)accepted, the last value won (#2714, #2873)Cannot load suite: eval-gate suite 's.yaml' has duplicate key 'threshold' in a task mapping on line 8
--write-baseline naming the suite or a custom task's filethe run finished, and writing the baseline replaced that input file (#1961, #2694)--write-baseline 's.yaml' aliases --suite 's.yaml'; choose a different --write-baseline (for a task file: aliases task 'a' --tasks 't.jsonl'), nothing written

A schema error in a suite now names the file and the field instead of printing a raw validation dump: Cannot load suite: eval-gate suite 's.yaml': tasks[0].threshold: Input should be a valid number, unable to parse string as a number (#2295, #2869). Upstream's entry for --write-baseline also covers the judge-prompts file; we did not run that case. None of this is a Re-run row, but a gate whose repeated key you did not intend ran with the last value, and one with a boolean threshold was compared against 0 or 1: read those suites.

Baselines

  • registry://<id> — pulls eval results for the referenced registry entry, using the newest eval row for each benchmark, so re-measuring a benchmark replaces its old score (before v0.76.0 the oldest row won; a gate that read a registry:// baseline measured more than once compared against the stale score)
  • ./baseline.json — a JSON map of {task_name: score}
  • omitted — tasks are judged only against their threshold

Baseline provenance (v0.74.0)

bash
soup eval gate --suite ./suite.yaml --model ./output --write-baseline ./baseline.json

A written baseline now carries a provenance block, the Soup version and a scorer revision, alongside its scores. Reading one back warns once when the stamp is missing, which is what an older file looks like, or when the scorer revision has moved underneath it, and stays silent when it matches. That replaces the v0.73.2 warning, which recognised a stale baseline by a hardcoded list of suite names and therefore could only ever know about the one scoring change somebody remembered to add. A locked fingerprint fails the test suite if a bundled scorer's output moves without its revision being bumped, so the stamp cannot quietly stop meaning anything. The revision is 7 at v0.77.0, and it is still 7 at v0.78.0. It was 1 through v0.75.2 and 5 at v0.76.x (the tool-call, refusal-classifier, arithmetic and common-sense changes each bumped it); revision 6 "prevents generation failures from earning credit" (#1958), and revision 7 is mini_mmlu's new 40 rows (#2113). A baseline stamped with any other revision warns once, naming the affected benchmarks when it comes from a registry entry, so a baseline written by v0.76 is not compared silently on the new scale: write it again. What changed is on the ship page, for v0.76.0 and for v0.77.0.

The stamp tracks the bundled suites' scorers, and its warning does not say that your own custom tasks are affected. Two scorer changes in v0.76.0 move scores of your own custom tasks. A baseline recorded before v0.76.0 does print the generic scorer-revision (or unknown-provenance) warning, but the message names no scorer, so it does not tell you that contains changed. contains now requires the expected string to appear as a whole token (an ASCII alphanumeric run), so 14 no longer contains 4; a gate baseline, a registry:// row or a soup eval custom --run-id result recorded with the old substring test can be higher than the same outputs score now, so re-measure them. (4 still matches inside 3.4, and contains cannot read negation.) And answer is a new scorer: it compares the final answer the model states. In a gate suite a task whose expected states no single answer does not stop the load: that task fails with the reason in its row, the gate fails closed and soup eval gate exits 2. soup eval custom and soup eval quant-check refuse such a row when the tasks file is read. Regex-scored tasks reject structurally unsafe patterns before matching.

v0.77.0 moves one more of your own scores. tool_call_match and tool_call_args_subset no longer credit a JSON number as a boolean (#1755, #1756): a model that answered {"enabled": 1} where the task expected {"enabled": true} used to score 1.0. A custom task whose rows use either scoring can therefore score lower on v0.77.0 than its baseline did on the same outputs, and the stamp does not warn about it, so re-measure such a baseline.

A judge-scored task was normalized against the wrong scale until v0.74.0. The gate divided the aggregate judge score by 10 while the default rubric runs 1 to 5, so a perfect 5.0 read as 0.50, typical thresholds of 0.70 and 0.80 were impossible to satisfy, and a healthy run could be stopped by on_regression: stop for no reason. Normalization now derives the minimum and maximum from the rubric in use, clamps out-of-bounds values and handles a degenerate scale. If a judge-gated run of yours stopped early, that is worth re-checking.

Judge URL allowlist

judge_model must use one of: ollama://, https://, or http:// to localhost, 127.0.0.1 or ::1 (the last since v0.76.0). Any other scheme is rejected at load time — an SSRF guard on the eval path.

Since v0.75.2 an https:// URL that names a private, link-local, shared-space (100.64.0.0/10) or otherwise non-public IP address is rejected at load too, with judge_model URL: private/link-local/reserved IP hosts are not allowed (SSRF protection). The check reads the host as an IP literal in any spelling (decimal, hex and abbreviated forms are caught, and so are non-ASCII digits); loopback still works, and plain http:// stays limited to loopback (localhost and 127.0.0.1, plus ::1 since v0.76.0). To use a judge on your own network, name it by hostname over HTTPS with a certificate valid for that name. Hostnames are not resolved, so a name that points at a private address is still accepted: the guard narrows which addresses a URL can name directly, it does not make internal services unreachable by name. There is no opt-in for the IP-literal case. See what v0.75.2 refuses.

Since v0.76.0 the refusal ends ; address the server by its hostname, and a host written only as digits that is not a valid IPv4 address (10.0.0.256, 4294967296) is refused as well, with an all-numeric host that is not a valid IPv4 address is not allowed (SSRF protection). The refusal happens when the suite loads, so soup eval gate stops with exit 3, soup train --gate stops with exit 1 (Invalid --gate suite), and a training.eval_gate suite is skipped with a warning. Through v0.76.1 the judge's HTTP response was read whole before it was parsed, with no size cap (#1819). Since v0.77.0 #1929 bounds judge replies to 1 MiB, counted after decoding and checked before the reply is parsed, and the reply text is then limited to 65,536 characters before it is read as scores; an oversized reply leaves the task unscored, so the gate fails closed. The endpoint is still whatever the suite names, so do not run a suite you do not trust.

Which host you name decides whether your OpenAI key travels. An https:// judge URL uses OPENAI_API_KEY only when its host is api.openai.com; every other host is called as an OpenAI-compatible server without that key.

History:

That was not true before v0.75.1, and the allowlist above is why it went unnoticed. Any https://<host>/<model> was classified as the OpenAI provider whatever the host was, so OPENAI_API_KEY was sent to it as a Bearer token (0.33.0 to 0.75.0) — from this gate, from eval.ship.judge_model, from training.online_dpo_judge and from the soup data judge options. A shared or committed config could name a host that simply collects the key. Rotate it if you ever pointed a judge anywhere else while it was set. The flip side is a behaviour change: a self-hosted judge that was relying on the key being forwarded must now be given one explicitly.

Re-run this (v0.77.0)

These gate verdicts and baselines, produced before v0.77.0, did not measure what they said. The full list for the release is on the v0.77.0 page.

If you ranWhat was wrongWhat to do
soup eval gate (or --gate) on a suite with no tasks, a misspelled tasks key or a repeated task name, or against a NaN or -1e999 baseline (#1798, #1821, #1824, #1893, #1773, #1779)The gate passed a suite with no tasks; duplicate task names overwrote baseline evidence; a NaN or negative-infinite baseline let the gate passFix the suite or the baseline and run the gate again
A gate with a judge task whose prompts file was empty (#1928)The task scored 0.0 without judging anythingGive the task its prompts and run the gate again
A custom gate task whose rows use tool_call_match or tool_call_args_subset (#1755, #1756)A JSON number was credited as a boolean; scores recorded before this change can be higher than the same outputs score nowRe-measure the baseline, then the gate

Not a gate change in v0.78.0 (#2939). A row scored tool_call_args_subset now counts as correct, in the Accuracy that soup eval custom, a soup ship metric leg and soup eval retention report, only at full credit. The per-row score keeps its partial credit (0.5 for the function name, 0.5 for the arguments), and the eval gate averages that score, so a gate verdict does not move. Upstream's instruction for the numbers that did move is to record base and tuned scores again with v0.78.0 before comparing; see soup ship and Tool-Calling Fine-Tuning.

See also

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.