{"record":{"id":"62db3102a6105919","repo":"ruvnet/ruflo","slug":"unknown-gguf-value-type-valuetype","errorCode":null,"errorMessage":"Unknown GGUF value type: ${valueType}","messagePattern":"Unknown GGUF value type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/appliance/gguf-engine.ts","lineNumber":142,"sourceCode":"  }\n}\n\n/** Read a single GGUF typed value (scalar or array) from the buffer. */\nfunction readGgufValue(reader: BufferReader): unknown {\n  const valueType = reader.readU32();\n  if (valueType === GgufValueType.ARRAY) {\n    const elemType = reader.readU32();\n    const len = reader.readU64AsNumber();\n    const arr: unknown[] = [];\n    for (let i = 0; i < len; i++) {\n      const v = readScalar(reader, elemType);\n      if (v === undefined) throw new Error(`Unknown GGUF array element type: ${elemType}`);\n      arr.push(v);\n    }\n    return arr;\n  }\n  const v = readScalar(reader, valueType);\n  if (v === undefined) throw new Error(`Unknown GGUF value type: ${valueType}`);\n  return v;\n}\n\n// ── GGUF Header Parsing ─────────────────────────────────────\n\n/**\n * Parse the header and metadata from a GGUF file without loading tensors.\n * Reads only the first 256 KB of the file.\n */\nexport async function parseGgufHeader(path: string): Promise<GgufMetadata> {\n  const fileInfo = await fsStat(path);\n  const readSize = Math.min(fileInfo.size, 256 * 1024);\n  const fh = await open(path, 'r');\n  try {\n    const buf = Buffer.alloc(readSize);\n    await fh.read(buf, 0, readSize, 0);\n    return parseGgufBuffer(buf, fileInfo.size, path);\n  } finally {","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/appliance/gguf-engine.ts#L124-L160","documentation":"Same type switch as the array case, but for a top-level scalar metadata value: the u32 valueType read from the buffer is not one of GgufValueType 0-12 (ARRAY=9 is handled separately). This means the metadata uses a type the parser does not know, or the reader is misaligned due to earlier corruption, and parsing stops rather than guessing a width.","triggerScenarios":"A metadata key whose value type code is >12 (future GGUF spec) or an invalid number; a value-type field read from the wrong offset after a preceding string/array was corrupt.","commonSituations":"Bleeding-edge llama.cpp files ahead of this engine's supported spec; converter bugs; random corruption that still passed magic and version checks.","solutions":["Dump the metadata with a current gguf tool to identify the unknown type code","Upgrade @claude-flow/cli so its GgufValueType covers the file's spec revision","Reconvert the model with standard tooling to a v2/v3 file using known types","Reject the file outright on this error — subsequent reads would be misaligned"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { meta = await parseGgufHeader(path); }\ncatch (e) { if (e instanceof Error && e.message.includes('GGUF value type')) { reportUnsupportedModel(path); } else throw e; }","preventionTips":["Convert models with the same toolchain generation as your runtime engine","Upgrade @claude-flow/cli when adopting newer llama.cpp model revisions","Fail fast on first unknown type — later fields would be garbage anyway"],"tags":["gguf","binary-parsing","file-format","unsupported-type","nodejs"],"backgroundTag":"unsupported-file-format-value","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}