GetSafetensorsDtype returns the quantization type for a safetensors model.
Reads tensor headers until quantized weights are found.
Falls back to torch_dtype from config.json if no quant metadata exists.
GetSafetensorsLLMInfo extracts model information from safetensors LLM models.
It reads the config.json layer and returns a map compatible with GGML's KV format.
GetSafetensorsTensorInfo extracts tensor information from safetensors model layers.
Each tensor is stored as a minimal safetensors file with an 88-byte header containing metadata.