GgufParserPort

Trait GgufParserPort 

Source
pub trait GgufParserPort: Send + Sync {
    // Required methods
    fn parse(&self, file_path: &Path) -> Result<GgufMetadata, GgufParseError>;
    fn detect_capabilities(&self, metadata: &GgufMetadata) -> GgufCapabilities;
}
Expand description

Port for parsing GGUF file metadata.

This trait abstracts GGUF parsing so that different implementations can be injected (full native parser, stub for tests, etc.).

§Port Signature Rules

  • All types in signatures are from gglib-core (domain types)
  • No gglib-gguf symbols appear in signatures
  • Implementations live in gglib-gguf and implement this trait

Required Methods§

Source

fn parse(&self, file_path: &Path) -> Result<GgufMetadata, GgufParseError>

Parse metadata from a GGUF file.

§Arguments
  • file_path - Path to the GGUF file
§Returns

Returns the parsed metadata, or an error if parsing fails.

Source

fn detect_capabilities(&self, metadata: &GgufMetadata) -> GgufCapabilities

Detect capabilities from parsed metadata.

Analyzes the metadata to detect model capabilities like reasoning or tool calling support.

§Arguments
  • metadata - The parsed GGUF metadata
§Returns

Returns structured capabilities (bitflags + extensions).

Implementors§