# mlx.core.save_safetensors — MLX 0.0.7 documentation

Skip to main content
`Ctrl`+`K`

# mlx.core.save_safetensors

mlx.core.save_safetensors(file: str, arrays: Dict[ str , array ], /, retain_graph: Optional[ bool ] = None)

  Save array(s) to a binary file in `.safetensors` format.

  For more information on the format see https://huggingface.co/docs/safetensors/index.

  Parameters:

    - file (file, str) – File in which the array is saved>

    - arrays (dict ( str , array )) – The dictionary of names to arrays to be saved.

    - retain_graph (bool , optional) – Whether or not to retain the graph during array evaluation. If left unspecified the graph is retained only if saving is done in a function transformation. Default: `None`.