Skip to main content

Python class

WeightsFormat

WeightsFormatโ€‹

class max.graph.weights.WeightsFormat(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

source

Bases: str, Enum

Enumeration of supported weight file formats.

MAX supports multiple weight formats to accommodate different model sources and use cases.

ggufโ€‹

gguf = 'gguf'

source

GGUF (GPT-Generated Unified Format) for quantized models.

File extension: .gguf

Optimized for quantized large language models, particularly those from the llama.cpp ecosystem. Supports multiple quantization schemes (Q4_K, Q5_K, Q8_0, etc.) and includes model metadata in the file.

safetensorsโ€‹

safetensors = 'safetensors'

source

Safetensors format for secure and efficient tensor storage.

File extension: .safetensors

Designed by Hugging Face for safe serialization that prevents arbitrary code execution. Uses memory-mapped files for fast loading and supports sharding across multiple files.