{"record":{"id":"ac14fd2af83368ab","repo":"ruvnet/ruflo","slug":"unknown-gguf-array-element-type-elemtype","errorCode":null,"errorMessage":"Unknown GGUF array element type: ${elemType}","messagePattern":"Unknown GGUF array element type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/appliance/gguf-engine.ts","lineNumber":136,"sourceCode":"    case GgufValueType.BOOL:    return reader.readBool();\n    case GgufValueType.STRING:  return reader.readString();\n    case GgufValueType.UINT64:  return Number(reader.readU64());\n    case GgufValueType.INT64:   return Number(reader.readI64());\n    case GgufValueType.FLOAT64: return reader.readF64();\n    default: return undefined;\n  }\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);","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/appliance/gguf-engine.ts#L118-L154","documentation":"When readGgufValue encounters an ARRAY value it reads each element via readScalar(elemType), whose switch covers GgufValueType 0-12 (UINT8 through FLOAT64). An element type outside that set — a newer GGUF type code, or garbage read because the buffer is misaligned — makes readScalar return undefined and this error throws.","triggerScenarios":"A GGUF file using an array element type added after this parser was written (code >12); element-type bytes misread after an earlier field desynchronized the reader; corrupted metadata blocks.","commonSituations":"New llama.cpp GGUF revisions introducing additional value types; models from third-party converters with non-standard encodings; truncated headers leaving the reader mid-field.","solutions":["Inspect the file with an up-to-date external tool (e.g. llama.cpp gguf dump) to see which type code it uses","Upgrade @claude-flow/cli to a build whose GgufValueType enum covers the new type","Reconvert the model with a current, standard GGUF conversion tool","On failure, reject the whole model rather than continuing — later fields will be misaligned anyway"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { meta = await parseGgufHeader(path); }\ncatch (e) { if (e instanceof Error && e.message.includes('array element type')) { reportUnsupportedModel(path); } else throw e; }","preventionTips":["Pin model files to GGUF spec versions your engine supports","Validate new model sources with an external gguf dump tool before deployment","Treat any parse failure as 'reject the whole file' — never partially consume GGUF metadata"],"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"}