soup/soup_cli/trainer
Alpamys a5540fa1e2 feat(correctness): v0.36.0 — Correctness First (4 Parts: A/B/C/D)
Four silent-failure modes Soup had → loud failures, plus a
security default-deny.

- Part A: assistant-only loss masking (default true). Replaces TRL's
  multi-turn heuristic with explicit IGNORE_INDEX masking. New
  data.train_on_responses_only / train_on_messages_with_train_field
  + per-message train: bool field. Preferred path uses
  return_assistant_tokens_mask; fallback uses incremental tokenize
  delta with add_special_tokens=False to avoid double-BOS drift.
- Part B: --trust-remote-code opt-in default-deny on soup train /
  chat / serve / data download / eval auto. KNOWN_SAFE_PREFIXES
  allowlist (15 first-party orgs) suppresses warning panel.
  Replaces 9 unconditional trust_remote_code=True call sites in
  the SFT path. Non-SFT trainers + diff/export/merge/infer/generate
  still hardcode trust_remote_code=True — documented v0.36.x patch.
- Part C: chat-template hardening. Tokenizers without chat_template
  raise loudly instead of silent f"{role}: {content}" fallback.
  New data.chat_template (registered name or raw Jinja). Filesystem
  -touching Jinja directives (include/import/from/macro/extends)
  blocked at config-load. Override application warns that soup push
  will persist the new Jinja into tokenizer_config.json.
- Part D: OOM-probe auto batch-size. New
  training.auto_batch_size_strategy: auto|static|probe. Try-halve
  -then-double-to-ceiling loop, max 8 doublings, ceiling = static
  × 4. ~/.soup/batch_cache.json (0600 perms, env-override
  containment-checked against ~/cwd/tempdir). make_cache_key
  rejects bool inputs.

Net +134 tests (4115 → 4249). All 5 review-agent waves clean
before commit; 5 HIGH / 10 MEDIUM / 5 LOW findings fixed in one
review-fix wave.

Smoke: python -m soup_cli.cli version → soup v0.36.0; all 5 new
--trust-remote-code flags surface in --help; ruff clean; pytest
4249 passed / 3 skipped / 0 failed in 2m41s on Windows py3.10.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 11:52:51 +05:00
..
__init__.py Initial project setup: CLI skeleton + config + trainer + data pipeline 2026-02-20 16:14:56 +05:00
dpo.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00
embedding.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00
grpo.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00
ipo.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00
kto.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00
mlx_dpo.py feat(v0.25.0): Beyond the Wrapper — 8 major features 2026-04-13 12:58:11 +05:00
mlx_grpo.py feat(v0.25.0): Beyond the Wrapper — 8 major features 2026-04-13 12:58:11 +05:00
mlx_routing.py feat(v0.25.0): Beyond the Wrapper — 8 major features 2026-04-13 12:58:11 +05:00
mlx_sft.py feat(v0.25.0): Beyond the Wrapper — 8 major features 2026-04-13 12:58:11 +05:00
orpo.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00
ppo.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00
pretrain.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00
reward_model.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00
rewards.py fix(v0.33.0): review-wave findings (CRITICAL + HIGH + MEDIUM + LOW) 2026-04-27 19:57:57 +05:00
sft.py feat(correctness): v0.36.0 — Correctness First (4 Parts: A/B/C/D) 2026-04-30 11:52:51 +05:00
simpo.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00