GGUFWriter

Minimal GGUF writer that consumes a GgufWriteRequest and emits GGUF v3 bytes. Scope: supports scalar KV types (string/int/long/float/bool) and flat arrays of those scalars; tensor payloads support FP32, FP16, BF16, F64, Int8/Int16/Int32/Int64 plus raw-byte passthrough for other quantization tags.

Functions

Link copied to clipboard
fun writeToByteArray(request: GgufWriteRequest, options: GGUFWriteOptions = GGUFWriteOptions()): Pair<GGUFWriteReport, ByteArray>

Write into a byte array (most portable).

Link copied to clipboard
fun writeToSink(request: GgufWriteRequest, sink: Sink, options: GGUFWriteOptions = GGUFWriteOptions()): GGUFWriteReport

Stream GGUF bytes to a Sink without buffering the whole file in memory.