"""GGUF header parsing and model classification, including malformed input. Guards the model picker: vision projectors and embedding models are valid GGUF files that cannot answer a prompt, and selecting one used to produce an empty report with no error at all. """ from __future__ import annotations import struct import tempfile from pathlib import Path from _harness import Results, bootstrap bootstrap() from gguf import ( # noqa: E402 EMBEDDING, GENERATIVE, MAGIC, PROJECTOR, UNKNOWN, architecture, classify, read_metadata, ) r = Results("GGUF parsing and classification") def synth(pairs, tmp: str, magic: int = MAGIC) -> Path: """Write a minimal GGUF file with the given (key, type, value) triples.""" out = bytearray(struct.pack("