GgufModelHeader

Parsed GGUF header: metadata key/values and tensor descriptors. Tensor data is never read.

Types

Link copied to clipboard
object Companion

Constants and factory functions of GgufModelHeader.

Properties

Link copied to clipboard

tensor data alignment (general.alignment, default 32).

Link copied to clipboard

general.architecture (for example llama, qwen2, gemma3).

Link copied to clipboard

Transformer block count (<arch>.block_count).

Link copied to clipboard

Training context window (<arch>.context_length).

Link copied to clipboard

absolute file offset at which tensor data starts.

Link copied to clipboard

The tensor type that holds the most bytes (for example Q4_K in a Q4_K_M file).

Link copied to clipboard

Embedding width (<arch>.embedding_length).

Link copied to clipboard

general.file_type (llama_ftype), or null if absent.

Link copied to clipboard

Attention head count (<arch>.attention.head_count; the maximum if it is a per-layer array).

Link copied to clipboard

KV head count (<arch>.attention.head_count_kv), defaulting to headCount (no GQA).

Link copied to clipboard

Key head size (<arch>.attention.key_length), defaulting to embeddingLength / headCount.

Link copied to clipboard

every metadata key/value pair, in file order.

Link copied to clipboard
val name: String?

general.name.

Link copied to clipboard

Total number of parameters (sum of tensor element counts).

Link copied to clipboard

Human-readable quantization label: the llama_ftype name (for example Q4_K_M) from general.file_type, or the dominantTensorType name if that key is absent or unknown.

Link copied to clipboard

Bytes of tensor data, from the tensor types and shapes. Tensors of unknown type count as 0.

Link copied to clipboard

every tensor descriptor, in file order.

Link copied to clipboard

Value head size (<arch>.attention.value_length), defaulting to embeddingLength / headCount.

Link copied to clipboard

GGUF version (1, 2 or 3).

Link copied to clipboard

Vocabulary size (<arch>.vocab_size, else the length of tokenizer.ggml.tokens).

Functions

Link copied to clipboard
fun long(key: String): Long?

Integer value of key, or null. For an array of integers (per-layer hyper-parameters) the maximum is returned.

Link copied to clipboard
fun string(key: String): String?

String value of key, or null.