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/.pthfiles (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
- Gguf
Info - GGUF file information
- Onnx
Info - ONNX file information
- Safe
Tensors Info - SafeTensors file information
- Tensor
Info - Tensor information
Enums§
- Model
Format - Detected model format
- Quant
Type - 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