Skip to main content

Module format

Module format 

Source
Expand description

Model Format Detection and Metadata

Detects model file formats and extracts metadata from model files.

§Supported Formats

  • GGUF: GGML Universal Format (llama.cpp, ollama)
  • SafeTensors: HuggingFace safe tensor format
  • APR: Aprender native format
  • ONNX: Open Neural Network Exchange
  • PyTorch: .pt/.pth files (detection only)

§Example

use pacha::format::{detect_format, ModelFormat};

let format = detect_format(&data)?;
match format {
    ModelFormat::Gguf(info) => println!("GGUF: {} params", info.parameters),
    ModelFormat::SafeTensors(info) => println!("SafeTensors: {} tensors", info.tensor_count),
    _ => println!("Other format"),
}

Structs§

AprInfo
APR (Aprender) file information
GgufInfo
GGUF file information
OnnxInfo
ONNX file information
SafeTensorsInfo
SafeTensors file information
TensorInfo
Tensor information

Enums§

ModelFormat
Detected model format
QuantType
Common quantization types (GGUF spec naming convention)

Functions§

detect_format
Detect model format from bytes
detect_format_from_path
Detect format from file path extension