validate_and_parse_gguf

Function validate_and_parse_gguf 

Source
pub fn validate_and_parse_gguf(
    parser: &dyn GgufParserPort,
    file_path: &str,
) -> Result<GgufMetadata>
Expand description

Validates a GGUF file and extracts its metadata using the provided parser.

This function performs both file validation (existence and extension) and GGUF format parsing to extract model metadata.

§Arguments

  • parser - The GGUF parser to use (injected via port)
  • file_path - Path to the GGUF file to validate and parse

§Returns

  • Ok(GgufMetadata) with extracted metadata if valid
  • Err if file doesn’t exist, has wrong extension, or can’t be parsed