Commit Graph

89 Commits

Author SHA1 Message Date
Alpamys 02a2af4b83 fix: v0.24.1 — Windows Unicode fix, AWQ/GPTQ output path traversal
- Replace non-ASCII symbols (checkmarks, arrows, bullets, em-dashes)
  with ASCII equivalents in Rich console output to prevent
  UnicodeEncodeError on Windows without PYTHONIOENCODING=utf-8
- Add _validate_output_path() for AWQ/GPTQ export — output path
  traversal is now checked before import check (previously unreachable
  when autoawq/auto-gptq not installed)
- 4 new tests for output path validation (2065 total, 0 failures)
- Update SECURITY.md with v0.22.0–v0.24.1 hardening history
2026-04-03 23:41:44 +05:00
Alpamys 1b6b428aaa feat: v0.24.0 — Dataset Hub, Freeze Training, Loss Watchdog, Dataset Registry
Part A: HuggingFace Dataset browser
- soup data search: search HF Hub for datasets (sort by downloads/likes)
- soup data preview: preview remote dataset metadata, splits, features
- soup data download: stream HF dataset to local JSONL (with format conversion)
- Security: trust_remote_code=False, path traversal protection, samples cap at 1M

Part B: Freeze training (like LLaMA-Factory finetuning_type: freeze)
- freeze_layers / freeze_ratio config fields
- soup_cli/utils/freeze.py: detect layers, freeze bottom N
- Wired into SFT trainer before LoRA application
- Supports LLaMA (layers.N) and GPT-2 (h.N) naming

Part C: Loss watchdog (like Axolotl loss_watchdog_threshold)
- loss_watchdog, loss_watchdog_threshold, loss_watchdog_patience config
- Implemented in SoupTrainerCallback with patience counter
- Rich warning panel (stops Live display first), fires only once
- Wired into all 11 trainers via callback kwargs

Part D: Dataset info registry
- soup data register/unregister/registry commands
- ~/.soup/datasets.json local name→path+format mapping
- Name validation, path traversal protection, Rich markup escaping

82 new tests (2061 total), 74 test files.
2026-04-03 16:35:23 +05:00
Alpamys ada4a078b6 fix: v0.23.1 — CI fix, security warnings, expanded test coverage
- Fix macOS CI: CLI help tests use inspect.signature (Rich truncation)
- Security: trust_remote_code warning panels for AWQ/GPTQ export
- Tests: packing trainer mock, curriculum fallback branch, empty list edge case
- 1979 tests across 70 test files
2026-04-03 14:20:21 +05:00
Alpamys 50ccf15113 fix: v0.23.0 security — trust_remote_code warning panels for AWQ/GPTQ export 2026-04-03 14:01:16 +05:00
Alpamys f272ee2f4f feat: v0.23.0 — AWQ/GPTQ Export, Sample Packing, Data Split, Curriculum Learning
- AWQ export (`soup export --format awq`) via autoawq, with --bits, --group-size, --calibration-data
- GPTQ export (`soup export --format gptq`) via auto-gptq, with calibration data support
- Sample packing (`packing: true`) for SFT/Pretrain trainers via TRL's native packing
- `soup data split` — train/val/test splitting with random and stratified strategies
- Curriculum learning (`curriculum: true`) — sort dataset by difficulty for staged training
- New utility: soup_cli/utils/curriculum.py (sort_by_length, create_buckets)
- Security: calibration data path traversal protection, bits validation (4/8 only)
- 1970 tests across 70 test files
2026-04-03 13:55:01 +05:00
Alpamys 559203c2e3 fix: v0.22.1 — Python 3.9 compat (str | None → Optional[str]), version bump
The v0.22.0 release broke CI on Python 3.9 because serve.py used
PEP 604 union syntax (str | None) at module level, which requires 3.10+.
Fixed in previous commit; this bumps version to v0.22.1 for a clean PyPI release.
2026-04-03 13:09:16 +05:00
Alpamys f3c2dda9f2 fix: Python 3.9 compat — replace str | None with Optional[str] in serve.py
The `str | None` union syntax at module level requires Python 3.10+.
serve.py cannot use `from __future__ import annotations` because it
defines Pydantic models inside functions (FastAPI needs runtime types).
2026-04-03 13:02:20 +05:00
Alpamys dee9317dde feat: v0.22.0 — Training Profiler, Multi-Adapter Serving, Data Sampling, Adapter Management
New commands:
- `soup profile` — estimate memory, speed, GPU requirements before training
  (--config, --gpu, --json flags)
- `soup adapters list/info/compare` — LoRA adapter management
- `soup data sample` — intelligent dataset sampling (random/diverse/hard strategies)
- `soup serve --adapters` — multi-adapter serving with adapter selection

New files:
- soup_cli/utils/profiler.py — memory/speed estimation engine
- soup_cli/commands/profile.py — profile CLI command
- soup_cli/commands/adapters.py — adapter management CLI

Security:
- Multi-adapter: adapter path traversal protection (resolve + relative_to)
- Multi-adapter: adapter name validation (alphanumeric + hyphens only)
- Multi-adapter: unknown adapter → 404, no adapter name leakage in errors
- Multi-adapter: /v1/adapters returns names only (no filesystem paths)
- Multi-adapter: --adapters rejected for non-transformers backends
- Data sample: output path confinement (resolve + relative_to(cwd))

101 new tests (1890 total), 66 test files, 65.5% coverage, ruff clean.
2026-04-03 12:54:24 +05:00
Alpamys 0a4095eb0b fix: v0.21.1 — Windows UnicodeEncodeError, load_config str, recipe count
- fix: replace Unicode ⚠ (U+26A0) with ASCII [yellow]![/] in migrate
  warnings to prevent UnicodeEncodeError on Windows cp1251/cp866
- fix: load_config() now accepts str in addition to Path
- fix: recipe count in docs corrected from 30 to 29
- chore: bump version to v0.21.1
2026-04-02 14:31:17 +05:00
Alpamys 1b1d679141 feat: v0.21.0 — migrate, recipes, NEFTune, rsLoRA
- `soup migrate` — import configs from LLaMA-Factory, Axolotl, Unsloth
  notebooks (AST-only .ipynb parsing, path traversal protection)
- `soup recipes` — 30 ready-made configs for popular models
  (list/show/use/search with path traversal protection)
- NEFTune (`neftune_alpha`) — noisy embeddings for SFT/DPO/KTO/ORPO/SimPO/IPO
- rsLoRA (`use_rslora`) — rank-stabilized LoRA scaling in all 11 trainers
- Fix: `soup doctor` torchvision circular import crash
- Fix: `load_eval_tasks()` now accepts str in addition to Path
- Security: Rich markup injection prevention in migration warnings
- Security: 10 MB file size limit on migration input files
- 1789 tests, 62 test files, 64% coverage
2026-04-02 14:08:36 +05:00
Alpamys 7f0945c410 chore: bump version to v0.20.2 2026-04-01 18:40:48 +05:00
Alpamys 7aa390b760 fix: restore /static/ prefix for logo path in Web UI 2026-04-01 18:35:59 +05:00
Alpamys d6a7e3f816 chore: bump version to v0.20.1
Bugfix release: ANSI-safe CI test assertions (macOS fix), path
confinement hardening, circular import fix, rate limiting implementation,
trust_remote_code warning, new terracotta logo + Web UI color scheme.
2026-04-01 18:29:48 +05:00
Alpamys 3247dfb1b1 fix: use relative logo path in Web UI, add SVG logo to repo 2026-04-01 18:23:57 +05:00
Alpamys 4164c0ad80 fix: replace SVG logo with PNG (GitHub doesn't render SVG in README) 2026-04-01 18:22:06 +05:00
Alpamys 4ee6968d7e chore: rebrand to new terracotta logo, update Web UI color scheme
Replace purple/cyan cyberpunk theme with warm terracotta palette matching
new SVG logo. Update README to use soup_logo_svg.svg. Update chart colors
in app.js to match new palette (#C0512D primary, #E8975A warm accent).
2026-04-01 18:18:37 +05:00
Alpamys 6157bbb4b5 fix: implement rate limiting, add trust_remote_code warning, fix dedup logging
- Implement sleep-based rate limiting using --requests-per-minute flag
  (was declared but never enforced).
- Add Rich warning panel before loading local models with
  trust_remote_code=True, matching SGLang/audio precedent.
- Replace silent ValueError pass in dedup pipeline with debug logging.
2026-04-01 18:07:47 +05:00
Alpamys 68d958d14c fix: address python review — extract parse_json_array, narrow exceptions
- Extract _parse_json_array into soup_cli/data/providers/_utils.py to
  avoid circular imports between generate.py and provider modules.
- Narrow bare except Exception in detect_ollama to httpx.HTTPError/OSError
  with debug logging instead of silent swallow.
2026-04-01 18:04:24 +05:00
Alpamys 5ecfb0b29c fix: strengthen path confinement in generate command (security review)
Replace simple '..' check with resolve() + relative_to(cwd) for output
path. Add same confinement guard to --seed, --dedup-with, and --context
file paths. Add _path_within_cwd helper. 4 new security tests.
2026-04-01 17:54:02 +05:00
Alpamys ea8f785b50 feat: add synth data gen pro with multi-provider, templates, quality pipeline (v0.20.0)
New providers: Ollama (localhost-only), Anthropic Claude (env-only API key),
vLLM (SSRF-protected). Domain templates: code, conversation, qa, preference,
reasoning. Quality pipeline: --validate, --filter, --dedup, --quality-pipeline.
84 new tests, 1669 total. Security: SSRF protection on all providers, output
path traversal prevention, rate limiting.
2026-04-01 17:44:23 +05:00
Alpamys c46265fd18 feat: add eval platform with custom evals, LLM judge, human eval, leaderboard (v0.19.0)
Full-featured evaluation system with 7 subcommands:
- soup eval benchmark: standard benchmarks via lm-evaluation-harness
- soup eval custom: custom JSONL eval tasks with 4 scoring modes
- soup eval judge: LLM-as-a-judge (OpenAI/Ollama/server backends)
- soup eval auto: automatic post-training evaluation from config
- soup eval compare: side-by-side eval comparison with regression detection
- soup eval leaderboard: local model leaderboard with JSON/CSV export
- soup eval human: terminal A/B comparison with Elo ratings

New modules: soup_cli/eval/ (custom.py, judge.py, human.py, leaderboard.py)
Config: EvalConfig added to schema.py (auto_eval, benchmarks, custom_tasks, judge)
Callback: SoupTrainerCallback.on_train_end triggers auto-eval when configured

Security: SSRF protection on judge API, ReDoS guard on regex scoring,
API key isolation per provider, 10k task/prompt caps, read-only SQL queries

1585 tests, 58 test files, ruff clean
2026-04-01 14:47:08 +05:00
Alpamys e072c9d844 chore: bump version to v0.18.2 2026-04-01 14:02:33 +05:00
Alpamys ad819e32af chore: bump version to v0.18.1
Post-review fixes since v0.18.0 tag:
- Validate model name before ollama rm
- Fix reversed mock decorator argument order in tests
- Auto-detect chat template in export --deploy path
- Add 7 edge-case tests (OSError, timeout, boundary)
2026-04-01 13:58:46 +05:00
Alpamys 4df66414ce fix: auto-detect chat template in export --deploy ollama path
Use _auto_detect_template() from soup.yaml instead of hardcoding chatml
in the --deploy ollama flow. Falls back to chatml if detection fails.
2026-04-01 13:53:48 +05:00
Alpamys ba7a6b1ee1 fix: validate model name before ollama rm (security review finding)
Add validate_model_name() check in deploy --remove path to prevent
passing unsanitized names to ollama rm subprocess. Adds test coverage.
2026-04-01 13:51:15 +05:00
Alpamys f98519ef87 feat: add Ollama integration — deploy GGUF models in one command (v0.18.0)
New commands:
- `soup deploy ollama` — deploy GGUF to local Ollama with auto-template detection
- `soup deploy ollama --list` / `--remove` — manage Soup-deployed models
- `soup export --deploy ollama` — export + auto-deploy in one step

New files:
- soup_cli/utils/ollama.py — detect, deploy, list, remove, Modelfile generation
- soup_cli/commands/deploy.py — Typer command group with Rich panels
- tests/test_deploy_ollama.py — 78 tests covering all paths

Security hardening:
- GGUF path traversal protection + .gguf extension validation
- Model name validation (no path separators, null bytes)
- Modelfile parameter key allowlist prevents directive injection
- Parameter value newline/null sanitization
- Subprocess calls use list args (no shell injection)
- Warning panel before overwriting existing Ollama models

1449 tests, 57 test files, all passing.
2026-04-01 13:47:40 +05:00
Alpamys 986f8cb26c feat: add GitHub repo link to CLI output, bump version to v0.17.3
Show GitHub URL in `soup version`, `soup version --full`, `soup doctor`,
and `soup --help` so users can find and star the repo.
Extract URL to GITHUB_URL constant in utils/constants.py.
2026-03-26 15:48:04 +05:00
Alpamys ab611ce9a5 chore: bump version to v0.17.2 2026-03-26 15:16:04 +05:00
Alpamys 42b56f1570 fix: rename APIs to match test plan, fix RoPE factor detection
- Rename is_liger_available -> check_liger_available
- Rename detect_flash_attention -> check_flash_attn_available
- Rename is_ring_attention_available -> check_ring_attention_available
- Rename is_sglang_available -> check_sglang_available
- Rename compute_coherence_scores -> compute_coherence_score
- Rename FSDP keys: fsdp_full_shard -> full_shard, etc.
- Fix get_rope_scaling_config to accept factor-style args (e.g., 4.0)
- Update all callers, tests, and README
- 1371 tests pass, ruff clean, 58.81% coverage
2026-03-26 15:14:24 +05:00
Alpamys e30a637f48 chore: bump version to v0.17.1
- Fix outdated __version__ reference in CLAUDE.md (was showing 0.14.2)
- Version bump in pyproject.toml, __init__.py, CLAUDE.md, plan.md
- All 1369 tests pass, ruff clean, 58.80% coverage
2026-03-26 14:53:55 +05:00
Alpamys 20c2f4e515 fix: use AutoModel for audio, is_relative_to path check, early librosa import
- Use AutoModel instead of AutoModelForCausalLM for audio-language models
  (Qwen2-Audio, Whisper don't work with causal LM auto class)
- Use Path.is_relative_to() for path traversal check (symlink-safe, Python 3.9+)
- Fail fast with helpful error if librosa not installed before dataset processing
2026-03-26 13:59:46 +05:00
Alpamys bc743e2814 fix: pad token perf in perplexity scoring, SGLang SSRF validation
- Use -100 ignore_index for pad tokens in perplexity computation (avoids
  redundant softmax on padding positions)
- Block URL-based model paths in SGLang create_sglang_runtime (SSRF protection)
2026-03-26 13:51:57 +05:00
Alpamys 0b7759898c fix: address review findings — immutable rows, response guard, GPU cleanup
- Stop mutating dataset rows in-place in _validate_audio_files (use shallow copy)
- Guard _generate_server response parsing against unexpected JSON shape
- Add empty dataset guard in _prepare_audio_dataset
- Free GPU memory after perplexity scoring in compute_perplexity_scores
2026-03-26 13:49:40 +05:00
Alpamys 3d66b41d00 v0.17.0: data quality filters, audio modality, SGLang backend, server provider
New features:
- soup data filter: quality filters with perplexity and coherence scoring
- modality: audio — Qwen2-Audio, Whisper fine-tuning with audio data format
- --backend sglang for soup serve (SGLang high-throughput inference)
- --provider server for soup data generate (local OpenAI-compatible servers)
- Audio template: soup init --template audio

Security hardening:
- Server provider SSRF validation (scheme whitelist, localhost-only HTTP)
- Audio file path traversal protection (resolved paths confined to audio_dir)
- trust_remote_code warning panels for audio models and SGLang runtime

1348 tests, 56 test files, 58.8% coverage, ruff clean.
2026-03-26 13:46:17 +05:00
Alpamys ff88a2c525 fix: resolve CI failures on macOS — speculative decoding flag collision + missing fastapi
- Rename --spec-tokens to --num-speculative-tokens to avoid prefix
  collision with --speculative-decoding in Typer help rendering
- Add pytest.skip for _create_app tests when fastapi is not installed
2026-03-26 12:46:29 +05:00
Alpamys cbc0a0e558 v0.16.0: embedding models, ONNX/TensorRT export, speculative decoding
New features:
- task: embedding — fine-tune sentence embedding models (BGE, E5, GTE)
  with contrastive, triplet, or cosine loss and configurable pooling
- soup export --format onnx — ONNX export via optimum
- soup export --format tensorrt — TensorRT-LLM export for GPU inference
- soup serve --speculative-decoding — draft model for 2-3x faster generation
  (transformers assisted generation + vLLM native speculative decoding)
- soup init --template embedding — new template for embedding fine-tuning

Security:
- ONNX export: removed unconditional trust_remote_code, added warning
- Speculative decoding: SSRF protection (URL blocked), warning panel
- vLLM speculative: URL validation rejects http:// schemes
- TensorRT export: separated try/except per subprocess call
- Embedding config: Literal constraints, margin gt=0 validation

1270 tests, 52 test files, 58% coverage
2026-03-26 12:41:39 +05:00
Alpamys fd2513aa8b v0.15.0: performance + long-context fine-tuning
Features:
- Liger Kernel integration (fused RMSNorm, SwiGLU, CrossEntropy, RoPE)
- FlashAttention v2/v3 auto-detection via attn_implementation
- FSDP2 support alongside DeepSpeed (--fsdp flag: full_shard, shard_grad, full_offload)
- Ring FlashAttention for sequence parallelism across GPUs
- 128k+ context fine-tuning with RoPE scaling (linear, dynamic, yarn, longrope)
- Gradient checkpointing for memory-efficient long-sequence training
- New 'longcontext' template: soup init --template longcontext

Security:
- rope_scaling_type validated via Literal constraint (no free-form strings)
- max_length bounded ge=64, le=1048576 (prevents OOM/corruption)
- FSDP config key allowlist prevents injection of unexpected TrainingArguments
- Liger exception handling narrowed (no silent CUDA error swallowing)

New files: utils/liger.py, utils/flash_attn.py, utils/fsdp.py,
  utils/ring_attention.py, utils/long_context.py, tests/test_performance.py
Modified: all 10 trainers (fsdp_config support), schema.py, train.py, pyproject.toml

91 new tests (1182 total), 58.5% coverage, ruff clean
2026-03-26 11:26:48 +05:00
Alpamys dc2ad877db v0.14.3: fix plotext histogram on Windows (cp1251/cp1252 encoding)
- Check stdout encoding instead of type to detect non-UTF-8 consoles
- Redirect stdout to UTF-8 TextIOWrapper before plotext renders
- Add unit test that simulates cp1251 stdout with plotext
- 1022 tests total
2026-03-25 23:23:38 +05:00
Alpamys 2ed542318c v0.14.2: fix validate auto-detect, Windows histogram, UI auth docs
- soup data validate: default --format changed from 'alpaca' to 'auto',
  uses detect_format() to auto-detect dataset format
- soup data stats: force UTF-8 stdout on Windows for plotext histograms
- soup ui: add --show-token flag, document auth token in --help
- 7 new tests (BUG-013/014/015), 1021 tests total
2026-03-25 23:10:07 +05:00
Alpamys 11e075dd94 v0.14.1: review fixes + expanded test coverage
Post-release fixes from code review agents:
- Guard _output_dir in PretrainTrainerWrapper.train()
- 12 new tests: MoE integration, DeepSeek naming, model types, Unicode
- 1014 total tests, 58.31% coverage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:38:41 +05:00
Alpamys 4d34924d8f fix: guard _output_dir in PretrainTrainerWrapper.train()
Prevent silent failure if setup() partially completes by checking
both self.trainer and self._output_dir before proceeding.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:29:29 +05:00
Alpamys 15a6daf342 feat: v0.14.0 — pre-training + MoE support
Add continued pre-training task and Mixture of Experts model support:

- `task: pretrain` for continued pre-training on raw text data
- `plaintext` data format ({"text": "..."} JSONL or .txt files)
- MoE model detection (Mixtral, Qwen3 MoE, DeepSeek V3, DBRX, OLMoE)
- ScatterMoE LoRA (`moe_lora: true`) targets expert FFN + attention layers
- `moe_aux_loss_coeff` for router load-balancing loss
- Templates: `soup init --template pretrain` and `--template moe`
- 85 new tests across test_pretrain.py and test_moe.py (1002 total)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 22:26:01 +05:00
Alpamys 9451b980d4 fix: rename shadowed builtins and add type annotations in infer.py
- Rename `input` param to `input_file` (avoid shadowing builtin)
- Rename `output` param to `output_file` for consistency
- Rename loop variable `line = line.strip()` to `raw_line`/`line`
- Add return type annotation to `_load_model() -> tuple`
2026-03-25 18:59:33 +05:00
Alpamys 1ac4f2573f v0.13.2: add missing test coverage for infer + tensorboard
- Test _load_model exit paths: adapter without base model, corrupt JSON
- Test _generate branches: greedy (temp=0), sampling (temp>0), no
  chat_template fallback, token count from tensor shape, role formatting
- Test max_tokens bounds: 0 and 99999 rejected by CLI
- Test tensorboard happy path: flag accepted when tensorboard installed
- Fix import-failure test: avoid builtins.__import__ recursion
- 917 tests, 44 test files, 57.92% coverage
2026-03-25 18:57:15 +05:00
Alpamys 34de05cfbf v0.13.1: fix CI test failure + review fixes
- Fix test_tensorboard_in_train_help: strip ANSI escape codes before
  asserting --tensorboard in help output (Rich splits flag across
  escape sequences on Python 3.11)
- Fix TensorBoard import check: use `import tensorboard` directly
- Stream JSONL output during inference (crash-safe for large files)
- Return accurate token count from _generate via tensor shape
- Replace shallow tests with real trainer integration tests
- Cap max_tokens at 16384 + trust_remote_code warning
2026-03-25 18:50:47 +05:00
Alpamys 6806cdd944 fix: address code review findings for v0.13.0
- Fix TensorBoard import check: use `import tensorboard` directly
  (not torch.utils.tensorboard shim) for accurate availability check
- Stream JSONL output during inference instead of buffering in memory
  (crash-safe, handles large prompt files)
- Return accurate token count from _generate via tensor shape instead
  of re-encoding decoded text
- Replace shallow tests with real trainer integration tests that
  verify report_to='tensorboard' is accepted by all trainer wrappers
2026-03-25 18:48:43 +05:00
Alpamys db19f64649 fix: cap max_tokens at 16384 and add trust_remote_code warning in infer
- Add min=1, max=16384 bounds to --max-tokens in soup infer (matches
  serve.py cap, prevents resource exhaustion)
- Add visible warning before loading model with trust_remote_code=True
2026-03-25 18:45:34 +05:00
Alpamys edaa208d73 v0.13.0: batch inference + TensorBoard logging + supported models
- Add `soup infer` command for batch inference on JSONL prompts
  (--model, --input, --output, --max-tokens, --temperature, --device)
- Add `--tensorboard` flag to `soup train` (report_to="tensorboard")
- Validate --wandb and --tensorboard mutual exclusivity
- Add supported models table to README (Llama 4, Gemma 3, Qwen 2.5/3,
  Phi-4, DeepSeek R1/V3, Mistral, CodeLlama)
- 906 tests (29 new), 44 test files, 56.32% coverage
2026-03-25 18:43:43 +05:00
Alpamys 0be8a03a8a v0.12.0: ORPO/SimPO/IPO trainers + DoRA/LoRA+/GaLore
v0.11.0 — Alignment methods:
- ORPO (task: orpo) — wraps trl.ORPOTrainer, no reference model needed
- SimPO (task: simpo) — wraps trl.CPOTrainer with loss_type='simpo'
- IPO (task: ipo) — wraps trl.DPOTrainer with loss_type='ipo'
- Templates: soup init --template orpo/simpo/ipo
- Init wizard, train routing, sweep shortcuts for all three

v0.12.0 — Advanced PEFT:
- DoRA (use_dora: true) — weight-decomposed LoRA in all 9 trainers
- LoRA+ (loraplus_lr_ratio) — different lr for A and B matrices
- GaLore (use_galore: true) — memory-efficient full-param training
- GaLore validation: incompatible with quantization and unsloth

Security:
- experiment_name path traversal validation (no / \ : null bytes)
- GaLore optim_args type enforcement before string interpolation

Tests: 877 passed (was 746), 42 test files, 56.98% coverage
2026-03-25 18:12:36 +05:00
Alpamys 7bee22052b v0.10.10: Security hardening — Web UI auth, CORS, SSRF, path traversal protection
Security fixes across all HTTP surfaces:
- Web UI: Bearer token auth on mutating endpoints, CORS restricted to served origin,
  path traversal protection on /api/data/inspect, config validated before training,
  removed user-controlled config_path from API
- Serve/vLLM: max_tokens capped at 16384, generic error messages (no stack traces)
- Generate: SSRF protection (--api-base blocks non-HTTPS for remote URLs),
  --api-key deprecated in favor of OPENAI_API_KEY env var
- Export: llama.cpp pinned to tag b5270 (supply-chain safety)
- Push: --token deprecated in favor of HF_TOKEN env var
- Rewards: warning before executing custom .py reward files
- Tests: all 40 UI tests updated with auth headers, 666 tests pass

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 12:14:10 +05:00