unsloth/scripts
Daniel Han 44770ce2d9 Studio diffusion (Phase 9) review fixes: prequant safety + validation
- SECURITY: a request-supplied local pre-quant path is now unpickled only when it
  resolves inside an operator-configured ALLOWLIST of directories
  (UNSLOTH_ALLOW_LOCAL_PREQUANT_PATH = dir[:dir...]). The previous boolean opt-in,
  once enabled for one trusted checkpoint, allowed torch.load(weights_only=False) on
  any path a load request named (arbitrary code execution). realpath() blocks symlink
  escapes; a bare on/off toggle is no longer a wildcard.
- Validate the checkpoint's min_features against the runtime Linear filter, so a
  checkpoint that quantised a different layer set is rejected instead of silently
  loading a model that mismatches the dense path while reporting the same scheme.
- Tolerant base_model_id compare (exact or same final path/repo segment), so a local
  path or fork of the canonical base is accepted instead of falling back to dense.
- _has_meta_tensors uses any(chain(...)) (no intermediate lists).
- prequant verify/probe scripts use repo-relative paths (+ env overrides), not the
  author's absolute /mnt paths.
- tests: allowlist-dir opt-in, outside-allowlist refusal, min_features mismatch, fork tail.
2026-06-29 05:27:19 +00:00
..
data CI: scope GITHUB_TOKEN permissions, add MLX CI, unblock ~60 skipped tests (#5312) 2026-05-11 03:19:13 -07:00
build_prequant_checkpoint.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-26 11:24:35 +00:00
check_frontend_dep_removal.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
check_new_install_scripts.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
compare_engines.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-26 11:24:35 +00:00
compile_probe.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-26 03:20:02 +00:00
diffusion_bench.py Studio diffusion (Phase 8): detect consumer vs data-center GPU for fp8 accumulate, with user override 2026-06-26 08:01:15 +00:00
diffusion_quality.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-25 13:56:37 +00:00
enforce_kwargs_spacing.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
fp8_overflow_check.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-26 07:38:27 +00:00
install_gemma4_mlx.sh Update Install Scripts (#5968) 2026-06-03 05:39:42 -07:00
install_qwen3_6_mlx.sh Update Install Scripts (#5968) 2026-06-03 05:39:42 -07:00
install_rocm_wsl_strixhalo.sh Windows/WSL installer: fix winget msstore cert failure, amd-smi DiskPart prompt, and enable AMD GPU (Strix Halo gfx1151) (#5940) 2026-06-10 04:24:49 -07:00
leverage_probe.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-26 11:24:35 +00:00
lint_workflow_triggers.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
lockfile_supply_chain_audit.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
notebook_to_python.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
notebook_validator.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
nvfp4_probe.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-26 08:24:58 +00:00
nvfp4_t211_probe.py Studio diffusion (Phase 8): prefer fp8 over nvfp4 in Blackwell auto ladder 2026-06-26 08:56:23 +00:00
perf_verify.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-26 03:20:02 +00:00
prequant_probe.py Studio diffusion (Phase 9) review fixes: prequant safety + validation 2026-06-29 05:27:19 +00:00
quant_probe.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-26 06:17:18 +00:00
run_ruff_format.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
scan_npm_packages.py Package scanners: close fail-open gaps in the sdist fallback and hidden-payload paths (#6359) 2026-06-18 06:50:16 -07:00
scan_npm_packages_baseline.json Package scanners: close fail-open gaps in the sdist fallback and hidden-payload paths (#6359) 2026-06-18 06:50:16 -07:00
scan_packages.py Package scanners: close fail-open gaps in the sdist fallback and hidden-payload paths (#6359) 2026-06-18 06:50:16 -07:00
scan_packages_baseline.json Studio: remove OpenEnv and other unused packages (#6585) 2026-06-23 07:20:47 -07:00
sd_cpp_smoke.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-25 16:08:55 +00:00
sparse_accum_probe.py [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-06-26 06:48:40 +00:00
stamp_studio_release.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
sync_allow_scripts_pins.py Studio: auto-sync allowScripts pins after dependency bumps (#6136) 2026-06-10 02:35:37 -07:00
uninstall.ps1 Windows installer: fix DiskPart UAC mid-install, drive-root cache, and spurious unsloth.exe rename warning (#6296) 2026-06-22 03:09:08 -07:00
uninstall.sh Windows installer: fix DiskPart UAC mid-install, drive-root cache, and spurious unsloth.exe rename warning (#6296) 2026-06-22 03:09:08 -07:00
verify_comment_only_diff.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
verify_import_hoist.py CI: fix import-hoist false positive, vision-cache test cwd, llama.cpp CLI smoke (#6598) 2026-06-23 01:16:47 -07:00
verify_prequant_backend.py Studio diffusion (Phase 9) review fixes: prequant safety + validation 2026-06-29 05:27:19 +00:00