Anti-trend Insurance (v0.68.0)

Five-bet hedge against paradigm shifts. If prompt engineering keeps winning, soup compile keeps you covered. If prompt costs wall out, soup distill-prompt migrates the system prompt into weights. soup compile-tools does the same trick for tool descriptions. soup apple-adapter targets Apple FoundationModels on iOS 26+. And soup local-rl builds a personal-LLM feedback flywheel from thumbs-up/down on your own machine.

soup compile — DSPy + GEPA + TextGrad prompt-program compiler

bash
soup compile ./program.py --eval ./suite.yaml \
  --optimizer mipro --max-iters 500 --output ./compiled.json

Closed optimiser allowlist of 5: mipro, gepa, textgrad, copro, bootstrap_fewshot. Hard bound MAX_COMPILE_ITERS=1000.

  • validate_program_path requires .py, cwd containment, os.lstat + S_ISLNK rejection via shared paths.enforce_under_cwd_and_no_symlink
  • CompileResult enforces finite-score (no NaN / ±Inf), iterations ≥ 0
  • Module is commands/compile_cmd.py because compile is a Python builtin
  • Live as of v0.71.13 (behind the [compile] extra) — run_compile dispatches DSPy / GEPA / TextGrad; soup compile-tools optimises tool schemas too; --plan-only still renders the plan and exits 0

soup distill-prompt — long prompts → small fine-tunes

bash
soup distill-prompt --traces ./traces.jsonl \
  --teacher meta-llama/Llama-3-70B --student mistralai/Mistral-7B-v0.3 \
  --strategy sft --output ./dataset.jsonl

Closed strategy set {sft, preference, kl}. Teacher / student IDs capped at 512 chars; null-byte + empty rejected. Composes with v0.71 cross-tokenizer ULD. Live as of v0.71.13 (behind the [compile] extra) — prepare_distill_dataset calls the teacher once per trace via the v0.20 providers and emits sft/kl messages or preference chosen/rejected pairs.

soup compile-tools — textual gradients over tool descriptions

bash
soup compile-tools ./spec.json --eval ./eval.jsonl --optimizer textgrad

Spec extension allowlist {.json, .yaml, .yml} (case-insensitive on Windows). TextGrad / GEPA optimise tool descriptions so model picks them more accurately. Composes with v0.46 Agent Forge — Agent Forge parses the spec, ToolCompile optimises descriptions.

soup apple-adapter — HF ↔ MLX ↔ Apple FoundationModels

bash
soup apple-adapter ./adapter \
  --direction hf-to-apple --output ./apple-bundle --sign

Closed direction allowlist of 4: hf-to-mlx, mlx-to-hf, hf-to-apple, mlx-to-apple. Explicit S_ISDIR + symlink rejection on source. sign must be real bool (bool-as-int defence). Reuses v0.60 Part B signing infrastructure and extends the v0.25 MLX backend. Live as of v0.71.21convert_apple_adapter does the PEFT ↔ mlx-lm round trip for hf-to-mlx / mlx-to-hf (real bf16 adapter smoke); the *-to-apple directions stay upstream-gated (exit 3) until Apple's on-device adapter spec settles.

soup local-rl — personal-LLM feedback flywheel (LIVE)

bash
soup local-rl init --db ~/.soup/local.db
soup local-rl record --db ~/.soup/local.db \
  --prompt "summarise my last commit" --response "..." --thumb up
soup local-rl status --db ~/.soup/local.db
soup local-rl harvest --db ~/.soup/local.db --output ./pairs.jsonl

soup train --task dpo --data ./pairs.jsonl --base-model llama3:8b
  • POSIX 0o600 SQLite, interactions + thumbs tables (idempotent CREATE TABLE IF NOT EXISTS)
  • Parameterised inserts, 16 KiB prompt + 16 KiB response caps, null-byte rejection
  • harvest walks thumbs by ts ASC, emits one DpoPair{prompt, chosen, rejected} per prompt with both an up and down (last-writes-win dedup), atomic JSONL write via tempfile.mkstemp + os.replace
  • soup local-rl train is live as of v0.71.13--once harvests the latest thumbs DPO pairs and runs a real nightly DPO/KTO/ORPO train via a soup train subprocess (a state table skips re-runs with no new feedback or fewer than --min-pairs); without --once it renders an injection-safe systemd .service/.timer + launchd .plist scheduler scaffold

Numbers

+204 tests in v0.68.0 (11,021 → 11,225) across 6 new test files. 2 POSIX-only symlink tests skip on Windows.

See also