You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
security: Restrict model loading to SafeTensors format only
PyTorch pickle files (.bin, .pt) can execute arbitrary code during
deserialization — a known supply chain attack vector. MLX Code now:
- Rejects any model directory that lacks .safetensors files
- Skips non-SafeTensors models during discovery (won't appear in list)
- Throws MLXServiceError.unsafeModelFormat with an explanatory message
if a user somehow tries to load a rejected model
- Logs a warning when a model is skipped during discovery
All mlx-community models on HuggingFace use SafeTensors by default,
so this has no impact on normal usage.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
return"Unsafe model format rejected: \(path)\n\nMLX Code only loads SafeTensors (.safetensors) models. PyTorch pickle files (.bin, .pt) are not permitted."
0 commit comments