The key names that the reference writer defines, from the Keys class and MODEL_ARCH_NAMES of gguf-py/gguf/constants.py in llama.cpp (master, read 2026-11-13).
The specification's own list is on the header and metadata page; llama.cpp defines far more than the document's ten architectures. A key marked {arch}
is stored under the model's architecture name (the value of general.architecture), for example llama.attention.head_count. The names in {braces} are filled in:
{id} is an index and {name}, {dense}, {n}, {i} are as the format says. The value types of many keys are not stated in the constants file; they are in the
loader that reads each key and are not listed here. The list changes with almost every llama.cpp release.
Architecture names
MODEL_ARCH_NAMES maps 172 architectures to the string stored in general.architecture (the first, clip, is the multimodal projector file):
clip llama llama4 deci falcon baichuan grok gpt2 gptj gptneox mpt starcoder refact bert modern-bert nomic-bert nomic-bert-moe neo-bert jina-bert-v2 jina-bert-v3 eurobert bloom stablelm qwen qwen2 qwen2moe qwen2vl sensenova_u1 qwen3 flint qwen3moe qwen3next hrm_text beam qwen3vl qwen3vlmoe qwen35 qwen35moe clef vllm-decision2 clover_moe qwen4exp phi2 phi3 phimoe plamo plamo2 plamo3 codeshell orion internlm2 minicpm minicpm3 gemma gemma2 gemma3 gemma3n gemma4 gemma4-assistant gemma-embedding gemma-embedding2 starcoder2 rwkv6 rwkv6qwen2 rwkv7 arwkv7 mamba mamba2 maple jamba xverse command-r cohere2 cohere2moe dbrx olmo olmo2 olmoe muse-glimmer muse-spark openelm arctic deepseek deepseek2 deepseek2-ocr deepseek32 deepseek4 xing4_0 deepseek41 chatglm glm4 glm4moe glm-dsa glm5-next bitnet t5 t5encoder jais jais2 nemotron nemotron_h nemotron_h_moe metis16 exaone exaone4 exaone-moe granite granitemoe granitehybrid graniteswitch granite_swa chameleon wavtokenizer-dec plm bailingmoe bailingmoe2 bailingmoe3 dots1 dots3note arcee afmoe laguna ricursive ernie4_5 ernie4_5-moe falcon-h1 hunyuan-moe hunyuan-dense hunyuan_vl hy_v3 hy_v4 smollm3 gpt-oss lfm2 lfm2moe lfm3 dream smallthinker llada llada-moe seed_oss grovemoe apertus minimax-01 minimax-m2 minimax-m3 cogvlm rnd1 pangu-embedded mistral3 eagle3 dflash mistral4 mistral-large4 paddleocr mimo2 step35 spark2_5 llama-embed maincoder maion-coder kimi-linear kimi-k3 kimi-k31 talkie mellum nanbeige qwen3tts pockettts k2-horizon kolibri1 limite
Enumerations in the same file: GGMLQuantizationType (the tensor type values), the pooling types, rope scaling types, the expert gating function (SOFTMAX 1, SIGMOID 2, SQRTSOFTPLUS 4) and the file types of general.file_type.
General
general.type, general.architecture, general.quantization_version, general.alignment, general.file_type, general.name, general.author, general.version,
general.organization, general.finetune, general.basename, general.description, general.quantized_by, general.size_label, general.license,
general.license.name, general.license.link, general.url, general.doi, general.uuid, general.repo_url, general.source.url,
general.source.doi, general.source.uuid, general.source.repo_url, general.tags, general.languages,
general.tensor_extra.name, general.tensor_extra.prec_a4.
Provenance: general.base_model.count and, for each {id}, general.base_model.{id}.name, .author, .version, .organization, .description, .url,
.doi, .uuid, .repo_url; likewise general.dataset.count and general.dataset.{id}. with the same nine suffixes.
Default sampling (the "prompting" metadata the specification calls TODO): general.sampling.sequence, .top_k, .top_p, .min_p, .xtc_probability, .xtc_threshold,
.temp, .penalty_last_n, .penalty_repeat, .mirostat, .mirostat_tau, .mirostat_eta.
Model parameters ({arch}.…)
vocab_size, context_length, embedding_length, embedding_length_out, features_length, block_count, leading_dense_block_count,
feed_forward_length, expert_feed_forward_length, expert_shared_feed_forward_length, expert_chunk_feed_forward_length, use_parallel_residual,
tensor_data_layout, expert_count, expert_used_count, expert_shared_count, expert_group_count, expert_group_used_count,
expert_weights_scale, expert_weights_norm, expert_gating_func, expert_group_scale, expert_latent_length, experts_per_group,
moe_every_n_layers, moe_latent_size, post_norm_epsilon, nextn_predict_layers, n_deepstack_layers, deepstack_mapping, pooling_type,
logit_scale, decoder_start_token_id, decoder_block_count, attn_logit_softcapping, router_logit_softcapping, final_logit_softcapping,
final_logit_sigmoid_capping, swin_norm, rescale_every_n_layers, time_mix_extra_dim, time_decay_extra_dim, residual_scale,
embedding_scale, token_shift_count, interleave_moe_layer_step, full_attention_interval, num_loops, skip_loop_final_norm,
hash_layer_count, activation_sparsity_scale, altup.active_idx, altup.num_inputs, embedding_length_per_layer_input, swiglu_clamp_exp,
swiglu_clamp_shexp, swiglu_clamp, hidden_activation, {dense}_feat_in, {dense}_feat_out, target_layers, target_hidden_size,
block_size, conv_kernel_size, conv_group_size, selector_rank, selector_top_k, sample_from_anchor, has_confidence_head,
norm_before_residual, norm_before_fc, realtime_delay_tokens, classifier_free_guidance.
Adapters inside a model ({arch}.adapters.): count, token_ids_activate, token_ids_substitute, lora_rank, router_gain.
Attention ({arch}.attention.…)
head_count, head_count_kv, max_alibi_bias, clamp_kqv, key_length, value_length, layer_norm_epsilon, layer_norm_rms_epsilon,
group_norm_epsilon, group_norm_groups, causal, q_lora_rank, kv_lora_rank, decay_lora_rank, iclr_lora_rank,
value_residual_mix_lora_rank, gate_lora_rank, pass_lora_rank, relative_buckets_count, sliding_window, scale,
output_group_count, output_lora_rank, output_scale, value_scale, compress_ratios, compress_rope_freq_base, kv_source_layers,
temperature_length, key_length_mla, value_length_mla, key_length_swa, value_length_swa, key_length_mla_swa, value_length_mla_swa,
kv_lora_rank_swa, shared_kv_layers, kv_source_map, sliding_window_pattern, recurrent_layers, temperature_scale, rope_pattern,
value_expert_count, value_expert_used_count, xsa_epsilon; indexer: indexer.head_count, .key_length, .top_k, .block_size,
.local_blocks, .types, .kpool, .kpool_select_tail, .source_layers, .candidate_source_layer, .candidate_top_k_blocks,
.candidate_block_size.
Rotary embeddings ({arch}.rope.…)
dimension_count, dimension_count_swa, dimension_sections, section_order, freq_base, freq_base_spatial, freq_base_swa,
scaling.type, scaling.factor, scaling.alpha, scaling.attn_factor, scaling.original_context_length, scaling.finetuned,
scaling.yarn_truncate, scaling.yarn_log_multiplier, scaling.yarn_ext_factor, scaling.yarn_attn_factor, scaling.yarn_beta_fast,
scaling.yarn_beta_slow.
State-space, recurrent and other blocks
{arch}.ssm.:conv_kernel,inner_size,state_size,time_step_rank,group_count,dt_b_c_rms,norm_epsilon.{arch}.wkv.head_size.{arch}.kda.:head_dim,safe_gate,gate_lower_bound.{arch}.shortconv.l_cache.{arch}.hyper_connection.:count,sinkhorn_iterations,epsilon,magnitude,low_rank,single_pass.{arch}.engram.:pad_token_id,token_map.{arch}.ple.:layers,ngram_size,heads_per_ngram,conv_kernel,layer_multipliers,head_offsets,head_vocab_sizes,eos_token_id,image_token_id.{arch}.activation.situ_beta,.situ_linear_beta;{arch}.attn_res.block_size;{arch}.mudd.:feed_forward_length,tap_count,tap_indices;{arch}.hrm.:layers_per_stack,h_cycles,l_cycles,prefix_lm;{arch}.metis.:pass_count,memory_length,route_length,continuation_logit_limit.{arch}.posnet.and{arch}.convnext.:embedding_length,block_count(the WavTokenizer decoder).{arch}.classifier.:output_labels,pooling_type,activation.{arch}.decision.:type,block_count,routing_block_count,head_count,max_head_tokens,labels,temperature.{name},score_bias.{n}.{i}.- Fixed-name groups:
lilicorr.(hidden_size,candidate_topk,num_heads,num_layers,factor_dim,mlp_hidden_size,vector_eps,logit_scale);diffusion.shift_logits;xielu.(alpha_p,alpha_n,beta,eps);prism.hadamard.(version,tied_output,block_size,transform,axis,sign_mode,sign_widths,sign_values,weight_names,inverse_weight_names,gdn_v_grouped). - Split files:
split.no,split.count,split.tensors.count. Importance matrix:imatrix.chunk_count,imatrix.chunk_size,imatrix.datasets. Diffusion and other models: see above.
Tokenizer (tokenizer.…)
ggml.model, ggml.pre, ggml.tokens, ggml.token_type, ggml.token_type_count, ggml.scores, ggml.merges, ggml.bos_token_id,
ggml.eos_token_id, ggml.eot_token_id, ggml.eom_token_id, ggml.unknown_token_id, ggml.seperator_token_id (sic), ggml.padding_token_id,
ggml.mask_token_id, ggml.add_bos_token, ggml.add_eos_token, ggml.add_sep_token, ggml.dna_auto_tags, ggml.add_space_prefix,
ggml.remove_extra_whitespaces, ggml.clean_spaces, ggml.precompiled_charsmap, ggml.suppress_tokens, ggml.normalizer.nfc,
ggml.normalizer.lowercase, ggml.normalizer.strip_accents, ggml.metaspace.prepend_scheme, the fill-in-the-middle ids ggml.fim_pre_token_id,
ggml.fim_suf_token_id, ggml.fim_mid_token_id, ggml.fim_pad_token_id, ggml.fim_rep_token_id, ggml.fim_sep_token_id and the older
ggml.prefix_token_id, ggml.suffix_token_id, ggml.middle_token_id; huggingface.json, rwkv.world, chat_template,
chat_template.{name}, chat_templates.
Adapters (LoRA metadata)
adapter.type, adapter.lora.alpha, adapter.lora.task_name, adapter.lora.prompt_prefix, adapter.alora.invocation_tokens. The
LoRA page describes the file layout of a GGUF adapter.
Multimodal projector files (clip.…)
- Top level:
clip.projector_type,clip.has_vision_encoder,clip.has_audio_encoder,clip.has_gen_audio_encoder,clip.has_llava_projector,clip.use_gelu,clip.use_silu. - Vision (
clip.vision.):projector_type,image_size,image_min_pixels,image_max_pixels,preproc_min_tiles,preproc_max_tiles,preproc_image_size,preproc_tile_size,preproc_max_pixels_tolerance,patch_size,embedding_length,feed_forward_length,projection_dim,block_count,image_mean,image_std,max_slice_nums,image_resize_algo,spatial_merge_size,swiglu_clamp,expert_count_per_layer,expert_used_count,n_wa_pattern,wa_layer_indexes,wa_pattern_mode,is_deepstack_layers,window_size,feature_layer,image_grid_pinpoints,attention.head_count,attention.head_count_kv,attention.head_dim,attention.layer_norm_epsilon,projector.scale_factor,projector.query_side,projector.window_side,projector.spatial_offsets,sam.block_count,sam.embedding_length,sam.head_count. - Audio (
clip.audio.):projector_type,num_mel_bins,embedding_length,feed_forward_length,projection_dim,block_count,subsampling_factor,chunk_size,conv_kernel_size,hidden_sizes,patch_sizes,depths,max_pos_emb,feature_layer,rvq.num_quantizers,rvq.codebook_size,wa_pattern_mode,window_size,local_block_count,local_group_size,rope_dims,spk.block_count,spk.head_count,attention.head_count,attention.head_count_kv,attention.head_dim,attention.layer_norm_epsilon,projector.stack_factor,projector.window_size,projector.downsample_rate,projector.head_count. - Audio generation (
clip.gen.audio.):projector_type,model_variant,embedding_length,feed_forward_length,block_count,projection_dim,sampling.temp,sampling.top_k,sampling.penalty_repeat,sampling.penalty_last_n,attention.head_count,attention.head_count_kv,attention.layer_norm_epsilon.
What the architecture keys mean, as the source defines it
Read 2026-11-13 from llama-model.cpp (load_hparams), llama-hparams.h and
llama-arch.cpp of llama.cpp. These are the keys that the loader reads for every architecture; the
right-hand column is what the source states, either in code (defaults and checks) or in a comment on the field. Keys
marked {arch} in the left column are stored under the architecture name. The value types and the required flags are on the
loader page.
| Key | Meaning in the source |
|---|---|
{arch}.context_length | Field n_ctx_train, commented “context size the model was trained on”. Required. |
{arch}.embedding_length | Field n_embd, the embedding width. Required. (For WavTokenizer it is the output embedding width, and features_length is n_embd.) |
{arch}.embedding_length_out | Field n_embd_out_impl, commented “output embedding dimension (0 = use n_embd)”. Optional. |
{arch}.block_count | Field n_layer_all, the number of layers (blocks). Required; the loader asserts it is above 0 and not above LLAMA_MAX_LAYERS (512). |
{arch}.nextn_predict_layers | Field n_layer_nextn (default 0). The source gives no description; the loader asserts that it is not above the block count. |
{arch}.feed_forward_length, attention.head_count, attention.head_count_kv | Each is either one number, used for every layer, or an array with one number per layer (n_ff_arr, n_head_arr, n_head_kv_arr). head_count_kv is optional and defaults to the head count. |
{arch}.attention.key_length, attention.value_length | Head sizes of keys and values, n_embd_head_k_full and n_embd_head_v_full; the header comment calls them the dimension of keys (d_k) and of values (d_v), with the number of query heads being n_head and only n_head_kv key-value heads. Optional; the default is n_embd / n_head. When the model has no attention heads (n_head is 0, the code's “non-transformer models do not have attention heads”) both are 0. |
{arch}.attention.key_length_swa, attention.value_length_swa, rope.dimension_count_swa | The same quantities for layers that use sliding-window attention; the header comments say full-attention and SWA layers may have different head sizes and RoPE dimensions. Each defaults to the value for the full-attention layers. |
{arch}.attention.causal | Field causal_attn, default true: whether attention is causal. |
{arch}.rope.dimension_count | Field n_rot_full, the number of dimensions to which RoPE is applied. Optional; default is the key head size. The code comments give, for GPT-NeoX, n_rot = rotary_pct * (n_embd / n_head) and for GPT-J n_rot = rotary_dim. For the llama, deci, falcon and llama-embed architectures a value different from the key head size is an error (“invalid n_rot”). |
{arch}.rope.freq_base | Field rope_freq_base_train; optional, default 10000. |
{arch}.rope.scaling.type | A string, default linear, converted by llama_rope_scaling_type_from_string; an unrecognised string (the “unspecified” result) fails an assertion. |
{arch}.rope.scaling.factor, rope.scale_linear | The scaling factor; if scaling.factor is absent the old key scale_linear is read. The frequency scale used (rope_freq_scale_train) is 1 divided by the factor, or 1 when the factor is absent or 0. |
{arch}.rope.scaling.original_context_length | Field n_ctx_orig_yarn, the context length the YaRN scaling refers to; default is the training context length. |
{arch}.rope.scaling.finetuned | Field rope_finetuned, default false. The header comment on rope_pattern says that by default all layers use RoPE, “controlled by rope_finetuned”. |
{arch}.rope.scaling.attn_factor, rope.scaling.alpha | rope_attn_factor (default 1.0) and rope_scaling_alpha (default 0.0, commented “NTK-aware alpha for XDRoPE”). |
{arch}.rope.section_order | A string, default tyxz, for M-RoPE: which input position slot feeds each RoPE section. TYXZ is the default, where slot i feeds section i; ZYXT puts time last (commented “MiniCPM-V 4.7: time last”). Any other string throws “unknown rope section order”. |
{arch}.expert_count, expert_used_count | Mixture-of-experts: n_expert and n_expert_used_arr. expert_used_count is one number or one per layer, and is the top-k routing count (comment: “per-layer top-k expert routing count”). The loader asserts the expert count is at most 1024 (LLAMA_MAX_EXPERTS), the used count is not above it and, if experts exist, is above 0; without experts both group values and the used count must be 0. For the hunyuan-vl and hunyuan-dense architectures an expert count of 1 or less is treated as 0. |
{arch}.expert_group_count, expert_group_used_count | n_expert_groups and n_group_used: experts are split into groups. The group count must be below the expert count; when it is above 1 it must divide the expert count, and the used-group count must be above 0 and below the group count. |
{arch}.pooling_type, classifier.pooling_type, classifier.activation, classifier.output_labels | Embedding and classifier models: the pooling type (the pooling enumerations are listed above), the classifier head's pooling type, its activation (a string that must be one the loader knows, or it fails an assertion) and the array of output labels, whose length becomes n_cls_out (the number of classifier outputs, default 1; header comment “for Classifiers”). |
{arch}.classifier_free_guidance | Boolean, commented “each sequence is paired with an unconditional one”. |
{arch}.decision.labels | An array of labels for “decision models”; the field n_layer_decision is commented “trailing blocks that form the decision head”. |
{arch}.features_length, posnet.embedding_length, posnet.block_count, convnext.embedding_length, convnext.block_count | Read only for the WavTokenizer decoder (“for WavTokenizer” in the header): the sizes of its position-network and ConvNeXt stages; each stage's layer count must not exceed the block count. |
Sliding-window attention is described in llama-hparams.h as follows: the SWA type is one of none (0), standard (1), chunked (2) and symmetric (3); n_swa is “the size of the sliding window (0 - no SWA)”; and a layer marked 1 in the per-layer array is_swa_impl is a SWA layer, 0 a dense layer (all dense by default). The non-causal type, used when the causal mask is switched off, is: 0 all layers non-causal with SWA still applied (gemma 3, Qwen-VL and others), 1 SWA layers non-causal and dense layers causal (gemma 4), 2 all layers non-causal with SWA not applied between tokens of the current micro-batch (deepseek 4), 3 dense layers non-causal and SWA layers causal (lfm3 d1). The expert gating function is none (0), softmax (1), sigmoid (2), softmax weight (3, applied to the router weights instead of the logits) or sqrt-softplus (4).
For the other keys listed on this page, the architecture-specific ones, the source defines which field each is stored in (the loader page lists the types and required flags) and gives, for some fields, a one-line comment in llama-hparams.h: for example router_layer (granite-switch: the index of the single-head router KV layer that encodes per-token adapter selection, -1 when absent), n_value_expert (MoVA value experts), n_layer_kv_from_start (if non-negative, the first so many layers have a KV cache), n_shortconv_l_cache and the ssm_* fields (state-space models), the rescale_every_n_layers, time_mix_extra_dim and time_decay_extra_dim fields (RWKV), f_residual_scale and f_embedding_scale (Granite), f_attn_out_scale and attn_temp_length (grok-2), the altup fields (gemma3n), the dense_2_feat_* and dense_3_feat_* fields (the in and out feature counts of sentence-transformers dense layers), and n_deepstack_layers (for qwen3vl deepstack, the first N layers consume the first N deepstack embeddings). For the remaining architecture-specific keys the source gives only the field name and no description; their meaning is in the architecture's graph code under src/models, which was not read, and is listed as unknown on the overview.
What is not here
The value type each key must have, whether it is required, and the tensor names each architecture creates are on the loader page, taken from llama.cpp's loader. The meaning of the architecture-specific keys beyond the table above and the field comments is in that program's graph code under src/models and was not read.