{"record":{"id":"fd8caf7efd788635","repo":"janhq/jan","slug":"unknown-gguf-value-type","errorCode":null,"errorMessage":"Unknown GGUF value type: {}","messagePattern":"Unknown GGUF value type: (.+?)","errorType":"exception","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/plugins/tauri-plugin-llamacpp/src/gguf/types.rs","lineNumber":41,"sourceCode":"\nimpl TryFrom<u32> for GgufValueType {\n    type Error = io::Error;\n    fn try_from(value: u32) -> Result<Self, Self::Error> {\n        match value {\n            0 => Ok(Self::Uint8),\n            1 => Ok(Self::Int8),\n            2 => Ok(Self::Uint16),\n            3 => Ok(Self::Int16),\n            4 => Ok(Self::Uint32),\n            5 => Ok(Self::Int32),\n            6 => Ok(Self::Float32),\n            7 => Ok(Self::Bool),\n            8 => Ok(Self::String),\n            9 => Ok(Self::Array),\n            10 => Ok(Self::Uint64),\n            11 => Ok(Self::Int64),\n            12 => Ok(Self::Float64),\n            _ => Err(io::Error::new(\n                io::ErrorKind::InvalidData,\n                format!(\"Unknown GGUF value type: {}\", value),\n            )),\n        }\n    }\n}\n\n#[derive(Serialize)]\npub struct GgufMetadata {\n    pub version: u32,\n    pub tensor_count: u64,\n    pub metadata: HashMap<String, String>,\n}\n\n#[derive(Debug, Serialize, Deserialize)]\npub struct KVCacheEstimate {\n    pub size: u64,\n    pub per_token_size: u64,","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/janhq/jan/blob/7205d770c1e097c3daf35a911176410e93bc5564/src-tauri/plugins/tauri-plugin-llamacpp/src/gguf/types.rs#L23-L59","documentation":"GgufValueType::try_from maps the u32 value-type tag of a GGUF metadata entry to the enum and fails with InvalidData for any tag outside 0-12. GGUF defines exactly 13 value types; an unknown tag means the file was written by a newer spec revision or the stream is misaligned.","triggerScenarios":"read_metadata_entry (directly, or for array element types inside read_gguf_value) encounters a value-type tag > 12 while parsing read_gguf_metadata / find_gguf_tensors input.","commonSituations":"Files written by a newer llama.cpp GGUF version that added value types, corrupted files where the type field is garbage, desynchronized parsing, hand-crafted or fuzzed inputs.","solutions":["Re-export or re-quantize the model with a current llama.cpp version whose GGUF output matches the tags this parser knows (0-12)","Re-download the file and verify its checksum if the tag looks like garbage rather than a plausible new type","Add the new value type to the GgufValueType enum (match arm + read_gguf_value arm) if you must support the newer spec","Check whether an earlier parse error desynchronized the walk before this tag was read"],"exampleFix":"// before\n// types.rs: only 0-12 handled; new spec type 13 fails\n// after\nimpl TryFrom<u32> for GgufValueType {\n    fn try_from(value: u32) -> Result<Self, Self::Error> {\n        match value {\n            // ...existing 0..=12 arms...\n            13 => Ok(Self::Float128), // newly added spec type\n            _ => Err(io::Error::new(io::ErrorKind::InvalidData,\n                format!(\"Unknown GGUF value type: {value}\"))),\n        }\n    }\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match read_gguf_metadata(file) {\n    Err(e) if e.to_string().starts_with(\"Unknown GGUF value type\") => {\n        eprintln!(\"model uses a newer GGUF value type: {e}; update or re-export\");\n    }\n    other => other?,\n}","preventionTips":["Keep this parser in sync with the llama.cpp GGUF spec versions you ship","Re-export models with an older --gguf-version if new value types appear","Check the numeric tag in the message against the GGUF spec to identify the missing type"],"tags":["gguf","enum","value-type","binary-parsing"],"backgroundTag":"invalid-enum-value","analyzedSha":"7205d770c1e097c3daf35a911176410e93bc5564","analyzedAt":"2026-09-17T14:27:30.100Z","contentChangedAt":"2026-09-17T14:27:30.100Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}