{ "_comment": "Call sites that predate the gate, each with why it is safe. New ones fail; see scripts/lint_risky_loaders.py.", "targets": [ "unsloth", "unsloth_cli", "studio", "docker", "scripts", "cli.py", "unsloth-cli.py" ], "entries": [ { "file": "unsloth/models/float8_training.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "78b864cf6acb1555", "count": 1, "reason": "Standalone import fallback loads only unsloth/kernels/fp8_lora.py beside this shipped module, from __file__; no model metadata or caller input selects the module name or path." }, { "file": "scripts/prequant_probe.py", "rule": "unsafe-deserialize", "sink": "torch.load", "digest": "a9e1e9849ae6234f", "count": 1, "reason": "Maintainer probe script, not shipped; CKPT is a constant path to a locally built checkpoint." }, { "file": "studio/backend/core/_torchao_stub.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "a332a4e1ffe5dbe0", "count": 1, "reason": "Loads the installed torchao package file it is stubbing around, located via find_spec." }, { "file": "studio/backend/core/export/reap.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "9f96fe82c04e1bd3", "count": 1, "reason": "Loads Unsloth's own installed models/mapper.py (plain data), located via find_spec, to read its 16-bit Hub id table without importing unsloth." }, { "file": "studio/backend/core/export/worker.py", "rule": "trust-remote-code", "sink": "assignment", "digest": "a751fa788de6b6e6", "count": 1, "reason": "Nemotron-H only, for unsloth/ or nvidia/ names confirmed as genuine first-party Hub repos by is_trusted_org_repo." }, { "file": "studio/backend/core/export/worker.py", "rule": "trust-remote-code", "sink": "keyword", "digest": "35a68c33b5a8b4ad", "count": 1, "reason": "Argument to the consent evaluator inside `if trust_remote_code:`; it scans the code and blocks unless approved." }, { "file": "studio/backend/core/import_guards.py", "rule": "dynamic-import", "sink": "import_module", "digest": "8a43c55c018acccf", "count": 1, "reason": "Re-imports unsloth / unsloth_zoo by their fixed names after purging stubs." }, { "file": "studio/backend/core/inference/__init__.py", "rule": "dynamic-import", "sink": "import_module", "digest": "21de5335c8af2970", "count": 1, "reason": "Lazy attribute loader over the fixed _LAZY_ATTRS table of this package's own submodules." }, { "file": "studio/backend/core/inference/diffusion_cache.py", "rule": "dynamic-import", "sink": "import_module", "digest": "59e72c01edb14c86", "count": 1, "reason": "Iterates the fixed _UNREGISTERED_BLOCK_METADATA table of diffusers block classes." }, { "file": "studio/backend/core/inference/diffusion_flux2_rope.py", "rule": "dynamic-import", "sink": "import_module", "digest": "0d420008334333ee", "count": 1, "reason": "Module name comes from a fixed table or constant in this file, not from a model, request or download." }, { "file": "studio/backend/core/inference/diffusion_int8_fused.py", "rule": "dynamic-import", "sink": "import_module", "digest": "8a43c55c018acccf", "count": 1, "reason": "Imports a name from the constant _TORCHAO_INTMM_MODULES tuple (torchao's safe_int_mm homes); never a model, request or download name." }, { "file": "studio/backend/core/inference/diffusion_prequant.py", "rule": "dynamic-import", "sink": "__import__", "digest": "7daba5f579d7e4de", "count": 1, "reason": "Iterates the fixed (diffusion_families, video_families) pair inside this package." }, { "file": "studio/backend/core/inference/diffusion_prequant.py", "rule": "dynamic-import", "sink": "import_module", "digest": "7ff41ce8b4bc8d80", "count": 1, "reason": "Iterates the fixed _PREQUANT_SAFE_GLOBALS allowlist of torchao classes." }, { "file": "studio/backend/core/inference/diffusion_prompt_cache.py", "rule": "dynamic-import", "sink": "import_module", "digest": "e37f0ae9a5cd2615", "count": 1, "reason": "Module name comes from a fixed table or constant in this file, not from a model, request or download." }, { "file": "studio/backend/core/inference/diffusion_qwenimage21.py", "rule": "dynamic-import", "sink": "import_module", "digest": "0d420008334333ee", "count": 1, "reason": "Module name comes from a fixed table or constant in this file, not from a model, request or download." }, { "file": "studio/backend/core/inference/diffusion_qwenimage21_rope.py", "rule": "dynamic-import", "sink": "import_module", "digest": "0d420008334333ee", "count": 1, "reason": "Module name comes from a fixed table or constant in this file, not from a model, request or download." }, { "file": "studio/backend/core/inference/diffusion_qwenimage_rope.py", "rule": "dynamic-import", "sink": "import_module", "digest": "0d420008334333ee", "count": 1, "reason": "Module name comes from a fixed table or constant in this file, not from a model, request or download." }, { "file": "studio/backend/core/inference/diffusion_rocm_fused.py", "rule": "dynamic-import", "sink": "import_module", "digest": "59e72c01edb14c86", "count": 1, "reason": "install_rope only imports a name already in _ROPE_FNS, which is built from the fixed _MODULES tuple of two diffusers Flux transformer modules." }, { "file": "studio/backend/core/inference/diffusion_torchao_patches.py", "rule": "dynamic-import", "sink": "import_module", "digest": "59e72c01edb14c86", "count": 2, "reason": "Module names come from fixed in-file torchao tables." }, { "file": "studio/backend/core/inference/diffusion_zimage_fused.py", "rule": "dynamic-import", "sink": "import_module", "digest": "0d420008334333ee", "count": 3, "reason": "Module name comes from a fixed table or constant in this file, not from a model, request or download." }, { "file": "studio/backend/core/inference/ltx2_import_compat.py", "rule": "dynamic-import", "sink": "import_module", "digest": "59e72c01edb14c86", "count": 1, "reason": "Called with fixed LTX-2 / diffusers module names from this file." }, { "file": "studio/backend/core/inference/mcp_client.py", "rule": "dynamic-import", "sink": "__import__", "digest": "cdd1ee7836f42455", "count": 1, "reason": "Iterates a fixed pair of mcp.shared.exceptions class names." }, { "file": "studio/backend/core/inference/mcp_client.py", "rule": "dynamic-import", "sink": "import_module", "digest": "84203683666dcacf", "count": 1, "reason": "Top-level package of an already imported HTTP client class (its __module__), not external input." }, { "file": "studio/backend/core/inference/native_audio.py", "rule": "trust-remote-code", "sink": "keyword", "digest": "9acb0bb5af068e24", "count": 1, "reason": "MOSS types are in REMOTE_CODE_AUDIO_TYPES, so load() raises without trust_remote_code, and the codec repo is added to the consent scan targets." }, { "file": "studio/backend/core/inference/prequant_legacy_int8.py", "rule": "dynamic-import", "sink": "import_module", "digest": "7ff41ce8b4bc8d80", "count": 1, "reason": "Module name comes from a fixed table or constant in this file, not from a model, request or download." }, { "file": "studio/backend/core/inference/skills.py", "rule": "unsafe-deserialize", "sink": "yaml.load", "digest": "df424636e7148b98", "count": 2, "reason": "Loader is _FrontmatterLoader, a yaml.SafeLoader subclass that only adds a merge-key pair budget; no Python object construction." }, { "file": "studio/backend/core/inference/video_wan_fused.py", "rule": "dynamic-import", "sink": "import_module", "digest": "0d420008334333ee", "count": 1, "reason": "Imports the module-level _MODULE constant (diffusers' transformer_wan) to patch WanTransformerBlock; never a model, request or download name." }, { "file": "studio/backend/core/inference/vllm_server.py", "rule": "dynamic-import", "sink": "import_module", "digest": "3bc930c482122edb", "count": 1, "reason": "Iterates two fixed vLLM middleware module paths." }, { "file": "studio/backend/core/inference/vllm_server.py", "rule": "dynamic-import", "sink": "runpy.run_module", "digest": "e87de9560cced259", "count": 1, "reason": "Entry shim: the module comes from the argv Studio itself builds to launch vLLM's server." }, { "file": "studio/backend/core/inference/worker.py", "rule": "trust-remote-code", "sink": "assignment", "digest": "a751fa788de6b6e6", "count": 1, "reason": "Nemotron only (_needs_nemotron_trust): genuine first-party unsloth/ or nvidia/ repos confirmed by is_trusted_org_repo." }, { "file": "studio/backend/core/inference/worker.py", "rule": "trust-remote-code", "sink": "keyword", "digest": "0c3bb6fa20c6f007", "count": 1, "reason": "Argument to the consent evaluator inside `if trust_remote_code:`; it scans the code and blocks unless approved." }, { "file": "studio/backend/core/library.py", "rule": "dynamic-import", "sink": "import_module", "digest": "b991b1dc9a21d26e", "count": 1, "reason": "Prefix-bounded to core.inference.; the name comes from the fixed _GALLERIES table." }, { "file": "studio/backend/core/rag/embeddings.py", "rule": "dynamic-import", "sink": "import_from_string", "digest": "ad319be07f7da5ad", "count": 1, "reason": "The metadata reference is accepted only with the sentence_transformers. prefix, so it can import installed package code only; non-package refs are skipped and the real loader performs the same lookup." }, { "file": "studio/backend/core/rag/embeddings.py", "rule": "dynamic-import", "sink": "import_module", "digest": "d78c0ba207ccee5a", "count": 1, "reason": "Written-out names only: the three sentence_transformers.models module paths in a literal tuple, imported to wrap their import_from_string with the trust gate (#14437)." }, { "file": "studio/backend/core/systemone/laya_runtime.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "938c44d9558f813a", "count": 1, "reason": "Loads the vendored laya package shipped inside Studio (_VENDORED_LAYA)." }, { "file": "studio/backend/core/systemone/native_worker.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "33b35eda3d46f307", "count": 1, "reason": "Loads the vendored Clef reference (unsloth/_vendor/clef/joint_schema_model.py) from the installed unsloth package or the repo checkout, located via find_spec; a fixed file name, never caller input." }, { "file": "studio/backend/core/training/account_jobs.py", "rule": "dynamic-import", "sink": "import_module", "digest": "9eb7902991e3aa20", "count": 1, "reason": "Job module and target come from Studio's own spawn spec (account_process_spec callers), not a request." }, { "file": "studio/backend/core/training/worker.py", "rule": "dynamic-import", "sink": "__import__", "digest": "ffd393570a168e12", "count": 1, "reason": "Probes fixed kernel package names (causal_conv1d, mamba_ssm, flash_attn) after installing them." }, { "file": "studio/backend/core/training/worker.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "18d25a0356adb1dd", "count": 1, "reason": "Loads _import_metadata_cache.py, a fixed file name, from the installed unsloth package directory (find_spec of the literal 'unsloth'); stdlib only, nothing from a model repo." }, { "file": "studio/backend/core/training/worker.py", "rule": "trust-remote-code", "sink": "item", "digest": "64be60c61f04074b", "count": 1, "reason": "Nemotron only, for unsloth/ or nvidia/ names confirmed as genuine first-party Hub repos by is_trusted_org_repo." }, { "file": "studio/backend/core/training/worker.py", "rule": "trust-remote-code", "sink": "keyword", "digest": "b0e48aa315431594", "count": 1, "reason": "Argument to the consent evaluator, reached only when config trust_remote_code is set; it scans and blocks unless approved." }, { "file": "studio/backend/hub/services/models/deletion.py", "rule": "dynamic-import", "sink": "__import__", "digest": "b097279f2312331d", "count": 1, "reason": "Iterates two fixed module:attr strings for the active diffusion and video engines." }, { "file": "studio/backend/routes/inference.py", "rule": "trust-remote-code", "sink": "item", "digest": "c47fdb9c09e7e0a3", "count": 1, "reason": "Auto-switch sets it only with a fingerprint of code this account approved, recomputed from disk; the worker consent gate rescans and enforces it." }, { "file": "studio/backend/routes/training.py", "rule": "trust-remote-code", "sink": "item", "digest": "81b2dbc83d544567", "count": 1, "reason": "Only when the bundled model defaults YAML asks for it and is_trusted_org_repo confirms a first-party repo." }, { "file": "studio/backend/utils/hardware/hardware.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "880a3dce444c227f", "count": 1, "reason": "Loads dataset_num_proc.py from the installed unsloth package, located via find_spec." }, { "file": "studio/backend/utils/hf_xet_fallback.py", "rule": "dynamic-import", "sink": "import_module", "digest": "59e72c01edb14c86", "count": 2, "reason": "Every caller passes a fixed unsloth_zoo.hf_xet_health / unsloth_zoo.hf_xet_tuning name." }, { "file": "studio/backend/utils/mlx_repair.py", "rule": "dynamic-import", "sink": "import_module", "digest": "7ff41ce8b4bc8d80", "count": 1, "reason": "Iterates the fixed _MLX_RUNTIME_IMPORTS tuple." }, { "file": "studio/backend/utils/models/unsloth_mirror.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "01b003571a7b15a2", "count": 1, "reason": "Loads mapper.py from the installed unsloth package, located via find_spec." }, { "file": "studio/backend/utils/native_path_leases.py", "rule": "dynamic-import", "sink": "import_module", "digest": "52e9a0e89a8e084e", "count": 1, "reason": "Target is a module path passed by Studio's own worker spawn code." }, { "file": "studio/backend/utils/security/__init__.py", "rule": "trust-remote-code", "sink": "default", "digest": "02604be5f1981efe", "count": 1, "reason": "The default only means 'the caller is asking for remote code'; this function is the consent scan itself, not a load." }, { "file": "studio/backend/utils/security/__init__.py", "rule": "trust-remote-code", "sink": "default", "digest": "530cdf25b852d669", "count": 1, "reason": "The default only means 'the caller is asking for remote code'; this function is the consent scan itself, not a load." }, { "file": "studio/backend/utils/security/remote_code_scan.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "d96c86392e96178e", "count": 1, "reason": "Loads the repo's own scripts/scan_packages.py scanner from this checkout or install." }, { "file": "studio/backend/utils/ssm_runtime.py", "rule": "dynamic-import", "sink": "__import__", "digest": "ffd393570a168e12", "count": 1, "reason": "Probes fixed SSM kernel package names." }, { "file": "studio/backend/utils/third_party_source.py", "rule": "dynamic-import", "sink": "import_module", "digest": "59e72c01edb14c86", "count": 1, "reason": "import_pinned_module: the source is fetched at a pinned revision and sha256-verified before import." }, { "file": "studio/backend/utils/torch_warmup.py", "rule": "dynamic-import", "sink": "import_module", "digest": "59e72c01edb14c86", "count": 1, "reason": "Iterates the fixed _DIFFUSERS_PREWARM_MODEL_MODULES tuple." }, { "file": "studio/backend/utils/utils.py", "rule": "dynamic-import", "sink": "import_module", "digest": "4885bc5b2c6e8403", "count": 1, "reason": "Iterates the fixed _OFFLINE_CONSTANTS table of huggingface_hub / transformers modules." }, { "file": "studio/install_audio_cpp_prebuilt.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "67045d79b6761bf3", "count": 1, "reason": "Loads a helper .py shipped next to this installer." }, { "file": "studio/install_python_stack.py", "rule": "dynamic-import", "sink": "import_module", "digest": "59e72c01edb14c86", "count": 2, "reason": "Iterates fixed packaging / pip._vendor.packaging module names." }, { "file": "unsloth/__init__.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "27bf0ec897678cb9", "count": 1, "reason": "Loads unsloth's own _mlx_raw_text.py from the installed package directory; the path is derived from __file__." }, { "file": "unsloth/__init__.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "5f461f0c8175f45a", "count": 1, "reason": "Loads unsloth/models/decision_mlx.py from a fixed path inside this package on Apple Silicon, where importing unsloth.models would import torch; never a downloaded or user-supplied file." }, { "file": "unsloth/__init__.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "8840de300c0740e6", "count": 1, "reason": "Loads unsloth/dataprep/ebooks.py from a fixed path derived from this package's __file__ on MLX to avoid importing torch through dataprep; never an ebook-provided or downloaded code path." }, { "file": "unsloth/_cpu_init.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "4aa05e0119cd9062", "count": 1, "reason": "Loads unsloth/dataprep/raw_text.py and ebooks.py on the CPU backend from a fixed path derived from this package's __file__, with only those two constant names passed and the helper deleted after import, to skip dataprep/__init__ (which needs a GPU device type); never a dataset-provided or downloaded code path." }, { "file": "unsloth/_gpu_init.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "8c9ff15e7eed9db1", "count": 1, "reason": "Loads unsloth's own hf cache helper from the installed package directory; the path is derived from __file__." }, { "file": "unsloth/dataset_num_proc.py", "rule": "dynamic-import", "sink": "__import__", "digest": "fd6171fa78fd5a1e", "count": 1, "reason": "Called with the stdlib multiprocessing module names only, to read their start method." }, { "file": "unsloth/import_fixes.py", "rule": "dynamic-import", "sink": "import_module", "digest": "1cf4f547b72b3f63", "count": 1, "reason": "Iterates the fixed _VLLM_COMPILED_EXTENSIONS tuple to surface ABI-broken vLLM extensions." }, { "file": "unsloth/import_fixes.py", "rule": "dynamic-import", "sink": "import_module", "digest": "228679880d1b3db7", "count": 1, "reason": "Iterates a fixed dict of vLLM LoRA op module paths." }, { "file": "unsloth/import_fixes.py", "rule": "dynamic-import", "sink": "import_module", "digest": "59e72c01edb14c86", "count": 4, "reason": "Module names come from fixed in-file tables (_PEFT_TORCHAO_TENSOR_SUBCLASSES, _TORCHAO_IMPORT_TIME_MODULES and the transformers symbol homes); remote code can only name an attribute, which resolves inside an already installed transformers module." }, { "file": "unsloth/import_fixes.py", "rule": "dynamic-import", "sink": "import_module", "digest": "8a43c55c018acccf", "count": 2, "reason": "Names come from the fixed _PEFT_CONVERSION_SYMBOLS table and the transformers conversion module list." }, { "file": "unsloth/import_fixes.py", "rule": "dynamic-import", "sink": "import_module", "digest": "c19dff67fe237be9", "count": 1, "reason": "Imports the torchao NF4 module at a fixed relocated path (_TORCHAO_NF4_NEW constant)." }, { "file": "unsloth/import_fixes.py", "rule": "dynamic-import", "sink": "import_module", "digest": "cbc2c89aff4d7aaf", "count": 1, "reason": "Iterates the fixed _IMAGE_PROCESSING_SYMBOL_HOMES tuple of transformers modules." }, { "file": "unsloth/import_fixes.py", "rule": "dynamic-import", "sink": "import_module", "digest": "e79cc5aade79e54d", "count": 1, "reason": "Imports the fixed literal peft.utils.transformers_weight_conversion held in a local." }, { "file": "unsloth/models/_decision_common.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "3738585f7559a2ad", "count": 1, "reason": "Imports the laya copy vendored in this repository at a fixed path (studio/backend/vendor/laya/__init__.py); never a downloaded or user-supplied file." }, { "file": "unsloth/models/_utils.py", "rule": "dynamic-import", "sink": "get_class_from_dynamic_module", "digest": "1bf1ae2e2285284f", "count": 1, "reason": "Returns None unless hub_kwargs carries trust_remote_code, same contract as from_pretrained." }, { "file": "unsloth/models/_utils.py", "rule": "dynamic-import", "sink": "get_class_from_dynamic_module", "digest": "281f4ae0ed10fad9", "count": 1, "reason": "Returns early unless trust_remote_code is set (resolve_remote_code_model_class)." }, { "file": "unsloth/models/_utils.py", "rule": "dynamic-import", "sink": "get_class_from_dynamic_module", "digest": "b7a268bb9c7ebe2c", "count": 1, "reason": "Returns early unless trust_remote_code is set, and refuses cross-repo (--) references." }, { "file": "unsloth/models/_utils.py", "rule": "dynamic-import", "sink": "import_module", "digest": "ed81224ea9382685", "count": 1, "reason": "Sibling of the config class's own module: only resolves inside an installed transformers package or an already trusted remote-code module." }, { "file": "unsloth/models/_utils.py", "rule": "unsafe-deserialize", "sink": "torch.load", "digest": "7de1f016ac2d1555", "count": 1, "reason": "Reads back a .pt file this function just wrote with torch.save into the local offload folder; never a downloaded file." }, { "file": "unsloth/models/decision_gguf.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "6894b59960c95a35", "count": 1, "reason": "Loads Studio's standard-library gguf_export_contract.py from a constant path beside the unsloth package; nothing caller-supplied picks the file." }, { "file": "unsloth/models/decision_mlx.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "d4eff4fdda8d4ae4", "count": 1, "reason": "Loads the sibling _decision_common.py by a fixed name beside this file, so the MLX path shares the torch-free helpers without importing unsloth.models; nothing caller-supplied picks the file." }, { "file": "unsloth/models/decision_mlx.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "e1987e041e60a061", "count": 1, "reason": "Loads the sibling decision_gguf.py by a fixed name beside this file for GGUF export on MLX, without importing unsloth.models; nothing caller-supplied picks the file." }, { "file": "unsloth/models/diffusion_masked.py", "rule": "dynamic-import", "sink": "get_class_from_dynamic_module", "digest": "9fc70fcf03d7ec35", "count": 1, "reason": "Falls back to the auto class unless the caller passed trust_remote_code; revision pinned to the config commit hash." }, { "file": "unsloth/models/float8_training.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "2e91eef0396304a9", "count": 1, "reason": "Fallback when this file is loaded on its own: loads unsloth/precision/__init__.py from the sibling directory of the shipped package, a fixed path, never a user-supplied one." }, { "file": "unsloth/models/fsdp2_save.py", "rule": "unsafe-deserialize", "sink": "pickle.loads", "digest": "bf2d3c412d57fd50", "count": 1, "reason": "_share_from_writer: unpickles only what the export's writer rank stored under an unsloth_fsdp2_export_* key in the job's own default c10d store; a party able to write that store already controls the job's collectives." }, { "file": "unsloth/models/loader.py", "rule": "dynamic-import", "sink": "import_module", "digest": "ebe737f7f7773a19", "count": 1, "reason": "Prefix-bounded to transformers.models..modeling_; can only import a module transformers already ships." }, { "file": "unsloth/models/loader_utils.py", "rule": "dynamic-import", "sink": "import_module", "digest": "bbec50d33c36333c", "count": 1, "reason": "Iterates the fixed (loraga, corda) pair under peft.tuners.lora." }, { "file": "unsloth/models/loader_utils.py", "rule": "unpinned-code-fetch", "sink": "branch-head-url", "digest": "da770f64b1008f75", "count": 1, "reason": "mapper.py from unsloth main is parsed as data with ast (tables and literal strings only), never imported or executed." }, { "file": "unsloth/models/rl.py", "rule": "dynamic-import", "sink": "import_module", "digest": "705322645c08649e", "count": 1, "reason": "Prefix-bounded to trl.experimental.; names come from walking the installed TRL package." }, { "file": "unsloth/models/rl.py", "rule": "dynamic-import", "sink": "import_module", "digest": "7c2f62e557f23dba", "count": 1, "reason": "Home module of an installed TRL config class (its __module__), not external input." }, { "file": "unsloth/models/rl.py", "rule": "dynamic-import", "sink": "import_module", "digest": "fe73e10b8cc4e18a", "count": 1, "reason": "Prefix-bounded to trl.trainer.; name comes from the installed TRL trainer classes." }, { "file": "unsloth/models/sentence_transformer.py", "rule": "dynamic-import", "sink": "import_from_string", "digest": "180573f5aeefdb98", "count": 3, "reason": "Gated: classes outside sentence_transformers.* need trust_remote_code; inside it the path must be dotted identifiers resolving to a module class (#12436). The WordEmbeddings tokenizer_class check imports only after the caller refuses anything outside sentence_transformers.* (#14437)." }, { "file": "unsloth/models/sentence_transformer.py", "rule": "trust-remote-code", "sink": "keyword", "digest": "9a08f32d1af83ea3", "count": 1, "reason": "Reached only after the trust_remote_code gate in _resolve_module_class raises for an untrusted non sentence_transformers class." }, { "file": "unsloth/models/tp_replica.py", "rule": "unsafe-deserialize", "sink": "pickle.loads", "digest": "bf2d3c412d57fd50", "count": 1, "reason": "Reads the result rank 0 published to this job's own torch.distributed c10d store (the same trust boundary as broadcast_object_list); no file or network payload from outside the process group." }, { "file": "unsloth/save.py", "rule": "trust-remote-code", "sink": "setdefault", "digest": "c6f8db768c498be7", "count": 1, "reason": "Only when the model itself was already loaded via approved remote code (_loaded_via_remote_code), so the export reload follows that decision." }, { "file": "unsloth/save.py", "rule": "unpinned-code-fetch", "sink": "git-clone-unpinned", "digest": "6030da6ce18569c3", "count": 1, "reason": "Known residual: the legacy GGUF save path clones llama.cpp from upstream master (install_llama_cpp_clone_non_blocking / install_llama_cpp_blocking), the same upstream trust as installing llama.cpp; pinning is a separate change." }, { "file": "unsloth/save.py", "rule": "unpinned-code-fetch", "sink": "git-clone-unpinned", "digest": "72fcdff75af05310", "count": 1, "reason": "Known residual: the legacy GGUF save path clones llama.cpp from upstream master (install_llama_cpp_clone_non_blocking / install_llama_cpp_blocking), the same upstream trust as installing llama.cpp; pinning is a separate change." }, { "file": "unsloth/save.py", "rule": "unsafe-deserialize", "sink": "torch.load", "digest": "7de1f016ac2d1555", "count": 1, "reason": "Reads back a .pt file this function just wrote with torch.save into temporary_location; never a downloaded file." }, { "file": "unsloth/tokenizers_v1.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "71f24ac068b052d3", "count": 1, "reason": "Opt-in only (UNSLOTH_TOKENIZERS_V1=1): loads the tokenizers 1.0 extension module from the directory the user installed it into (UNSLOTH_TOKENIZERS_V1_PATH, default ~/.cache/unsloth/tokenizers_v1); never a downloaded or model-supplied file." }, { "file": "unsloth/trainer.py", "rule": "dynamic-import", "sink": "get_class_from_dynamic_module", "digest": "553d43d8ed624697", "count": 1, "reason": "Returns None unless trust_remote_code is granted, and remote code is tried last." }, { "file": "unsloth/trainer.py", "rule": "dynamic-import", "sink": "import_module", "digest": "d78c0ba207ccee5a", "count": 1, "reason": "Iterates a fixed tuple of torch wrapper classes (DataParallel, FSDP, OptimizedModule)." }, { "file": "unsloth_cli/__init__.py", "rule": "dynamic-import", "sink": "import_module", "digest": "59e72c01edb14c86", "count": 1, "reason": "Module-level __getattr__ for the lazily loaded command names: the module name comes only from the literal _LAZY_ATTRIBUTES table of unsloth_cli.commands.* modules, and an unknown name raises AttributeError before any import." }, { "file": "unsloth_cli/_studio_deps.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "64638e81faf798ab", "count": 1, "reason": "Loads studio/install_manifest.py from this checkout or install, not a download." }, { "file": "unsloth_cli/commands/eval.py", "rule": "unsafe-deserialize", "sink": "yaml.load", "digest": "7a94da1fd84a23da", "count": 1, "reason": "_task_yaml_loader() returns a yaml.SafeLoader subclass; it only adds a tag for lm-eval's !function references." }, { "file": "unsloth_cli/commands/studio.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "1eec04886487848b", "count": 1, "reason": "Loads Studio's own backend/run.py from the installed Studio tree." }, { "file": "unsloth_cli/commands/studio.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "af52cd628452c924", "count": 1, "reason": "Loads Studio's own cloudflare_tunnel.py from the installed Studio tree." }, { "file": "unsloth_cli/commands/studio.py", "rule": "dynamic-import", "sink": "spec_from_file_location", "digest": "fff48dd3d69aa0d2", "count": 1, "reason": "Loads Studio's own auth/storage.py from the installed Studio tree." } ] }