soup/soup_cli/utils
Alpamys 600686cd70 feat(advise): soup advise — pre-flight decision (v0.54.0)
`soup advise <data.jsonl> --goal "..."` returns one of PROMPT_ENG /
RAG / SFT / DPO / GRPO with a confidence, reason, and reverse-when
criterion BEFORE the user spends 8 hours on a GPU. Layer above
autopilot — autopilot picks hyperparams AFTER the training decision;
advise picks the training decision itself.

Three Parts:
- Part A: Verdict engine — TASK_CATEGORIES + CHOICES allowlists,
  frozen Verdict / DatasetProfile / ROIEstimate dataclasses, pure-
  Python classify_task + compute_dataset_profile + build_verdict
  rubric (DPO / GRPO floor 500 / PROMPT_ENG floor 50 / RAG / SFT).
- Part B: Probe runner — synth_probe_baselines + synth_probe_lora_delta
  heuristic stubs with forward-compat model/device/lr/timeout_seconds
  kwargs (v0.54.1 lifts to live model loading per stub-then-live
  cadence used by v0.27.0 MII / v0.37.0 multipack / v0.50.0 GRPO Plus).
- Part C: Cross-project learning — ~/.soup/advise_history.jsonl with
  cross-process file locking (fcntl on POSIX, sidecar <path>.lock +
  msvcrt on Windows). `soup advise compare` reads history; env
  override SOUP_ADVISE_HISTORY_PATH containment-checked to $HOME /
  $CWD / tempdir (mirrors v0.36.0 SOUP_BATCH_CACHE_PATH policy).

CLI: Typer subcommand group `run` / `explain` / `compare` plus argv
preprocessor in cli.py that maps `soup advise data.jsonl` →
`soup advise run data.jsonl`. Scoped to argv[1] == "advise" only
(code-review HIGH fix — defends against rewrites when an unrelated
arg contains the literal string "advise").

Schema: AdviseConfig (goal / probe / record) field on SoupConfig
honors the plan's cross-cutting bullet.

Security: cwd-containment + os.lstat + S_ISLNK symlink reject on
every path input; atomic writes via tempfile.mkstemp + os.replace
on scratch + history; per-line 64 KB cap + 16 MiB file cap on
history reads; bool / finite / NUL / oversize guards on every public
input; Rich markup escape on user-controlled output.

Reviewed by python / code / security / tdd / architect agents — every
finding fixed before commit (0 CRITICAL + 5 HIGH + 7 MEDIUM + 4 LOW).

Test count: 8400 → 8571 (+136 in tests/test_v0540.py, +35 net
adjustments to v0.53.x version-pin assertions to forward-compat >=).

Note: Windows CRLF / LF warnings during stage are .gitattributes-
governed and benign. CI runs on ubuntu-latest / windows-latest /
macos-latest × Python 3.9 / 3.11 / 3.12.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 21:48:19 +05:00
..
__init__.py Initial project setup: CLI skeleton + config + trainer + data pipeline 2026-02-20 16:14:56 +05:00
activation_offload.py feat(training): Training Speed & Memory — CCE, FP8, grad-ckpt tiers, kernel picker, cross-doc attn, activation offload (v0.28.0) 2026-04-22 22:51:15 +05:00
advanced_precision.py feat(v0.53.0): Quant Menu II — UD GGUFs + KV cache + NVFP4 + LF parity + save formats 2026-05-12 14:31:26 +05:00
advise.py feat(advise): soup advise — pre-flight decision (v0.54.0) 2026-05-14 21:48:19 +05:00
advise_history.py feat(advise): soup advise — pre-flight decision (v0.54.0) 2026-05-14 21:48:19 +05:00
agent_forge.py feat(agent): Agent Forge — OpenAPI/MCP/GraphQL spec → tool-calling SFT dataset (v0.46.0 Part B) 2026-05-11 17:12:13 +05:00
agent_rollout.py feat(grpo): v0.50.0 — GRPO Plus (unsloth + axolotl RL parity) 2026-05-12 00:30:43 +05:00
anthropic_messages.py feat(v0.45.0): Plugin System & Ecosystem Wins — 5 Parts, +169 tests 2026-05-10 21:21:04 +05:00
auto_quant.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00
backend_detect.py feat(v0.53.9): Live Dashboard + UX + Bench + Standalone CLIs 2026-05-14 04:28:19 +05:00
batch_probe.py feat(v0.40.3): Stub-to-live wave 1 (#33, #64; #65 still deferred) 2026-05-08 16:02:45 +05:00
bitnet.py feat(v0.52.0): Modality II — TTS + Distillation + BitNet + EBFT-GDPO + MoE quant + reasoning_effort 2026-05-12 13:38:01 +05:00
block_expansion.py feat(longctx): v0.53.4 — Long Context + Architecture 2026-05-13 14:52:10 +05:00
checkpoint_trigger.py fix(v0.44.0): write_trigger lstat unresolved path so symlink at trigger is detected 2026-05-10 19:28:02 +05:00
classifier.py feat(modality): v0.53.2 — lift Modality II stubs (distill + classifier + EBFT/GDPO + reasoning_effort) 2026-05-13 12:56:50 +05:00
constants.py feat: add GitHub repo link to CLI output, bump version to v0.17.3 2026-03-26 15:48:04 +05:00
convergence.py feat(training): v0.32.0 — Training Stability & Auto-Tuning 2026-04-26 15:24:31 +05:00
crash.py feat(observability): v0.34.0 — Observability & Dev UX (7 Parts) 2026-04-28 13:14:49 +05:00
cross_doc_attn.py feat(training): Training Speed & Memory — CCE, FP8, grad-ckpt tiers, kernel picker, cross-doc attn, activation offload (v0.28.0) 2026-04-22 22:51:15 +05:00
curriculum.py feat: v0.23.0 — AWQ/GPTQ Export, Sample Packing, Data Split, Curriculum Learning 2026-04-03 13:55:01 +05:00
curriculum_dynamic.py feat(adaptive): v0.53.5 — Adaptive Training (BETA → stable) 2026-05-13 15:55:28 +05:00
cut_ce.py feat(training): Training Speed & Memory — CCE, FP8, grad-ckpt tiers, kernel picker, cross-doc attn, activation offload (v0.28.0) 2026-04-22 22:51:15 +05:00
data_forge.py feat(v0.53.7): Data Forge + Pipeline live (wave 1) — 11 items 2026-05-13 19:28:11 +05:00
data_mix.py feat(v0.53.10): Quick wins + packaging + UX wiring 2026-05-14 13:58:20 +05:00
data_pipeline.py fix(test): v0.53.7 CI hardening — importorskip(fastapi) + Arrow target setup 2026-05-13 19:45:21 +05:00
data_score.py feat(v0.53.10): Quick wins + packaging + UX wiring 2026-05-14 13:58:20 +05:00
deepspeed.py feat(v0.27.0): Multi-GPU Mastery — topology, ZeRO++, FSDP2+compile, MII, PP, recipes 2026-04-21 14:54:34 +05:00
delinearize_llama4.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
demo_bundles.py feat(v0.53.8): Remote data + Hubs + Trackers (wave 2) — 6 features 2026-05-13 23:55:23 +05:00
deploy_autopilot.py feat(deploy): On-Device Deploy Autopilot — 10-profile catalog + recipe/script writer (v0.46.0 Part A) 2026-05-11 17:11:36 +05:00
deploy_measure.py feat(v0.53.1): Quant Menu II + Export pipeline live 2026-05-13 00:16:03 +05:00
distill.py feat(modality): v0.53.2 — lift Modality II stubs (distill + classifier + EBFT/GDPO + reasoning_effort) 2026-05-13 12:56:50 +05:00
dpo_variants.py feat(preference): v0.40.0 — Preference Variety (4 Parts: BCO + dispatcher + DPO variants + multi-objective) 2026-05-01 22:26:30 +05:00
ebft_gdpo.py feat(modality): v0.53.2 — lift Modality II stubs (distill + classifier + EBFT/GDPO + reasoning_effort) 2026-05-13 12:56:50 +05:00
encoding.py fix(v0.40.1): QA Hardening — UTF-8 bootstrap, schema strictness, multi-objective preference runtime, CLI UX 2026-05-08 12:03:16 +05:00
errors.py feat(longctx): v0.53.4 — Long Context + Architecture 2026-05-13 14:52:10 +05:00
fetch_examples.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
flash_attn.py feat(longctx): v0.53.4 — Long Context + Architecture 2026-05-13 14:52:10 +05:00
fp8.py feat(fp8): add rowwise and rowwise_with_gw_hp scaling recipes for FP8 training (#62) 2026-04-28 20:16:43 +05:00
freeze.py feat: v0.24.0 — Dataset Hub, Freeze Training, Loss Watchdog, Dataset Registry 2026-04-03 16:35:23 +05:00
fsdp.py feat(v0.27.0): Multi-GPU Mastery — topology, ZeRO++, FSDP2+compile, MII, PP, recipes 2026-04-21 14:54:34 +05:00
fsdp_consolidate.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
galore.py v0.12.0: ORPO/SimPO/IPO trainers + DoRA/LoRA+/GaLore 2026-03-25 18:12:36 +05:00
gguf_quant.py feat(v0.53.1): Quant Menu II + Export pipeline live 2026-05-13 00:16:03 +05:00
gpu.py v0.10.1: Fix 6 bugs from manual testing report 2026-03-24 12:31:37 +05:00
gpu_monitor.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
graceful_save.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
grad_accum.py feat(training): v0.32.0 — Training Stability & Auto-Tuning 2026-04-26 15:24:31 +05:00
gradient_ckpt.py feat(speed,memory): v0.28.0 features go multi-trainer (v0.33.0 Part C) 2026-04-27 18:55:50 +05:00
grpo_long_context.py feat(grpo): v0.50.0 — GRPO Plus (unsloth + axolotl RL parity) 2026-05-12 00:30:43 +05:00
grpo_variants.py feat(v0.53.11): GRPO Plus finish + preference live 2026-05-14 15:40:34 +05:00
hf.py feat(hf): v0.29.0 — HuggingFace Hub Deep Integration 2026-04-23 16:17:28 +05:00
hf_space.py feat(v0.53.8): Remote data + Hubs + Trackers (wave 2) — 6 features 2026-05-13 23:55:23 +05:00
hubs.py feat(v0.53.10): Quick wins + packaging + UX wiring 2026-05-14 13:58:20 +05:00
integrations.py feat(v0.45.0): Plugin System & Ecosystem Wins — 5 Parts, +169 tests 2026-05-10 21:21:04 +05:00
jinja_analyzer.py feat(multipack): v0.37.0 — Multipack (5 Parts A/B/C/D/E) 2026-04-30 13:48:16 +05:00
kernel_picker.py feat(trainers): v0.35.0 — Trainer Coverage (closes #60, #61, #45) 2026-04-28 15:01:42 +05:00
kv_cache.py feat(v0.53.0): Quant Menu II — UD GGUFs + KV cache + NVFP4 + LF parity + save formats 2026-05-12 14:31:26 +05:00
launcher.py feat(v0.27.0): Multi-GPU Mastery — topology, ZeRO++, FSDP2+compile, MII, PP, recipes 2026-04-21 14:54:34 +05:00
liger.py fix: rename APIs to match test plan, fix RoPE factor detection 2026-03-26 15:14:24 +05:00
llama_proxy.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
llama_server_timings.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
loftq_init.py feat(trainer): Optimizer & PEFT Zoo (v0.41.0) 2026-05-10 15:35:35 +05:00
log_level.py feat(v0.40.2): Quick polish + v0.40.1 carry-overs (#36, #50, #51 + 7 papercuts) 2026-05-08 13:20:21 +05:00
long_context.py feat(longctx): v0.53.4 — Long Context + Architecture 2026-05-13 14:52:10 +05:00
longlora.py feat(v0.53.11): GRPO Plus finish + preference live 2026-05-14 15:40:34 +05:00
lr_finder.py fix(v0.33.0): review-wave findings (CRITICAL + HIGH + MEDIUM + LOW) 2026-04-27 19:57:57 +05:00
lr_groups.py feat(trainer): Optimizer & PEFT Zoo (v0.41.0) 2026-05-10 15:35:35 +05:00
metrics.py feat(inference): v0.30.0 — Inference Excellence 2026-04-24 23:39:04 +05:00
mii.py fix(v0.33.0): review-wave findings (CRITICAL + HIGH + MEDIUM + LOW) 2026-04-27 19:57:57 +05:00
mix_proxy.py feat(adaptive): v0.53.5 — Adaptive Training (BETA → stable) 2026-05-13 15:55:28 +05:00
mixed_precision.py feat(training): v0.32.0 — Training Stability & Auto-Tuning 2026-04-26 15:24:31 +05:00
mlx.py feat(v0.25.0): Beyond the Wrapper — 8 major features 2026-04-13 12:58:11 +05:00
moe.py feat: v0.14.0 — pre-training + MoE support 2026-03-25 22:26:01 +05:00
moe_quant.py feat(v0.52.0): Modality II — TTS + Distillation + BitNet + EBFT-GDPO + MoE quant + reasoning_effort 2026-05-12 13:38:01 +05:00
multipack.py feat(multipack): v0.37.0 — Multipack (5 Parts A/B/C/D/E) 2026-04-30 13:48:16 +05:00
multipack_sampler.py feat(catalog): v0.51.0 — Model Catalog Expansion + Alternative Hubs 2026-05-12 12:05:04 +05:00
multipack_trainer.py feat(trainer): multipack live HF Trainer DataLoader override (v0.40.4 Part B) 2026-05-09 13:20:47 +05:00
neat_packing.py feat(multipack): v0.37.0 — Multipack (5 Parts A/B/C/D/E) 2026-04-30 13:48:16 +05:00
ngram_spec.py feat(v0.45.0): Plugin System & Ecosystem Wins — 5 Parts, +169 tests 2026-05-10 21:21:04 +05:00
nlg_metrics.py feat(eval): Tracker & Eval Pro — 18 features (v0.43.0) 2026-05-10 18:04:40 +05:00
ollama.py feat: add Ollama integration — deploy GGUF models in one command (v0.18.0) 2026-04-01 13:47:40 +05:00
onboarding.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
optimizer_zoo.py feat(trainer): Optimizer & PEFT Zoo (v0.41.0) 2026-05-10 15:35:35 +05:00
paths.py feat(v0.53.1): Quant Menu II + Export pipeline live 2026-05-13 00:16:03 +05:00
peft_builder.py feat(lora): v0.39.0 — LoRA Quality (PiSSA + ReLoRA + per-pattern rank + surgical patches + templates registry) 2026-05-01 16:18:07 +05:00
peft_patches.py feat(lora): v0.39.0 — LoRA Quality (PiSSA + ReLoRA + per-pattern rank + surgical patches + templates registry) 2026-05-01 16:18:07 +05:00
peft_wiring.py feat(v0.53.11): GRPO Plus finish + preference live 2026-05-14 15:40:34 +05:00
pipeline.py feat(v0.27.0): Multi-GPU Mastery — topology, ZeRO++, FSDP2+compile, MII, PP, recipes 2026-04-21 14:54:34 +05:00
preference_combine.py feat(v0.53.11): GRPO Plus finish + preference live 2026-05-14 15:40:34 +05:00
prm.py feat(v0.53.11): GRPO Plus finish + preference live 2026-05-14 15:40:34 +05:00
profiler.py fix: v0.24.1 — Windows Unicode fix, AWQ/GPTQ output path traversal 2026-04-03 23:41:44 +05:00
profiling.py feat(observability): v0.34.0 — Observability & Dev UX (7 Parts) 2026-04-28 13:14:49 +05:00
profiling_v0_43.py feat(eval): Tracker & Eval Pro — 18 features (v0.43.0) 2026-05-10 18:04:40 +05:00
qat.py Add Quantization-Aware Training support (Phase 7) — v0.6.0 2026-03-23 20:35:35 +05:00
qr_url.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
quality.py fix: rename APIs to match test plan, fix RoPE factor detection 2026-03-26 15:14:24 +05:00
quant_menu.py feat(quant): v0.38.0 — Quant Menu (8 Parts: A-H) 2026-05-01 13:31:49 +05:00
reasoning_effort.py feat(modality): v0.53.2 — lift Modality II stubs (distill + classifier + EBFT/GDPO + reasoning_effort) 2026-05-13 12:56:50 +05:00
reasoning_parser.py feat(v0.53.9): Live Dashboard + UX + Bench + Standalone CLIs 2026-05-14 04:28:19 +05:00
recipe_dag.py feat(v0.45.0): Plugin System & Ecosystem Wins — 5 Parts, +169 tests 2026-05-10 21:21:04 +05:00
recipe_run.py fix(test): v0.53.7 CI hardening — importorskip(fastapi) + Arrow target setup 2026-05-13 19:45:21 +05:00
registry.py feat: v0.24.0 — Dataset Hub, Freeze Training, Loss Watchdog, Dataset Registry 2026-04-03 16:35:23 +05:00
relora.py feat(lora): v0.39.0 — LoRA Quality (PiSSA + ReLoRA + per-pattern rank + surgical patches + templates registry) 2026-05-01 16:18:07 +05:00
replay.py feat(observability): v0.34.0 — Observability & Dev UX (7 Parts) 2026-04-28 13:14:49 +05:00
ring_attention.py fix: rename APIs to match test plan, fix RoPE factor detection 2026-03-26 15:14:24 +05:00
run_cost.py feat(observability): v0.34.0 — Observability & Dev UX (7 Parts) 2026-04-28 13:14:49 +05:00
save_formats.py feat(v0.53.1): Quant Menu II + Export pipeline live 2026-05-13 00:16:03 +05:00
server_tools.py feat(v0.45.0): Plugin System & Ecosystem Wins — 5 Parts, +169 tests 2026-05-10 21:21:04 +05:00
sglang.py fix: rename APIs to match test plan, fix RoPE factor detection 2026-03-26 15:14:24 +05:00
shortcuts.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
spec_pairing.py feat(inference): v0.30.0 — Inference Excellence 2026-04-24 23:39:04 +05:00
spike_recovery.py feat(training): v0.32.0 — Training Stability & Auto-Tuning 2026-04-26 15:24:31 +05:00
sse_train_stream.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
structured_output.py feat(serve): structured-output + auto-quant live (v0.33.0 Part D) 2026-04-27 18:43:07 +05:00
sweep_config.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
tail_latency.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
tool_outputs.py feat(v0.53.9): Live Dashboard + UX + Bench + Standalone CLIs 2026-05-14 04:28:19 +05:00
topology.py feat(v0.27.0): Multi-GPU Mastery — topology, ZeRO++, FSDP2+compile, MII, PP, recipes 2026-04-21 14:54:34 +05:00
tracing.py feat(inference): v0.30.0 — Inference Excellence 2026-04-24 23:39:04 +05:00
trackers.py feat(v0.53.10): Quick wins + packaging + UX wiring 2026-05-14 13:58:20 +05:00
train_event_buffer.py feat(v0.53.9): Live Dashboard + UX + Bench + Standalone CLIs 2026-05-14 04:28:19 +05:00
trainer_plugins.py feat(v0.53.7): Data Forge + Pipeline live (wave 1) — 11 items 2026-05-13 19:28:11 +05:00
trust_remote.py feat(correctness): v0.36.0 — Correctness First (4 Parts: A/B/C/D) 2026-04-30 11:52:51 +05:00
tts.py feat(v0.52.0): Modality II — TTS + Distillation + BitNet + EBFT-GDPO + MoE quant + reasoning_effort 2026-05-12 13:38:01 +05:00
ui_env.py feat(v0.44.0): Live Dashboard & UX - 21 features, +192 tests 2026-05-10 19:20:18 +05:00
unsloth.py Add Unsloth backend for 2-5x faster training (Phase 5) — v0.4.3 2026-03-23 16:55:44 +05:00
v028_features.py feat(preference): v0.40.0 — Preference Variety (4 Parts: BCO + dispatcher + DPO variants + multi-objective) 2026-05-01 22:26:30 +05:00
vllm.py feat(v0.53.7): Data Forge + Pipeline live (wave 1) — 11 items 2026-05-13 19:28:11 +05:00
vscode_setup.py feat(eval): Tracker & Eval Pro — 18 features (v0.43.0) 2026-05-10 18:04:40 +05:00
warmup.py feat(training): v0.32.0 — Training Stability & Auto-Tuning 2026-04-26 15:24:31 +05:00
why.py feat(observability): v0.34.0 — Observability & Dev UX (7 Parts) 2026-04-28 13:14:49 +05:00