{
  "scope": "Calculated full-attention KV tensor payload for one unshared sequence; not measured allocation or total device memory.",
  "formula": "tokens * full_attention_layers * kv_heads * head_dim * 2(K,V) * 2(bytes per 16-bit element)",
  "units": {
    "KiB": 1024,
    "GiB": 1073741824,
    "GB": 1000000000
  },
  "assumptions": {
    "sequences": 1,
    "bytes_per_key_or_value_element": 2
  },
  "excluded": [
    "model weights",
    "linear-attention recurrent and convolution states",
    "retained serving checkpoints",
    "vision state",
    "activations and workspaces",
    "padding and reservations",
    "allocator overhead"
  ],
  "caveats": [
    "Context-support limits are model-card inputs, not inferred from max_position_embeddings.",
    "Equal token counts need not encode identical text across tokenizers.",
    "Shared prefixes and runtime cache strategies change allocation and concurrency costs.",
    "KV quantization is separate from weight quantization; quantization metadata prevents exact naive byte ratios."
  ],
  "qwen3_to_qwen38_full_attention_payload_ratio": 4.0,
  "models": [
    {
      "name": "Qwen3-32B",
      "revision": "9216db5781bf21249d130ec9da846c4624c16137",
      "sha256": "97e295b63283935788fac5e4f8860862a56d4089538cafc93f0431f2ebe483bb",
      "model_card_sha256": "0af37735eef45eb3b406f3d74952e6cbcbc180904dc68b73a31a690719a235da",
      "native_context_tokens_from_model_card": 32768,
      "context_limit_used_in_table": 131072,
      "context_note": "Above 32,768 tokens requires the model-card context extension; no 262,144-token support is asserted.",
      "config_file": "Qwen3-32B.config.9216db5781bf.json",
      "config_source": "https://huggingface.co/Qwen/Qwen3-32B/blob/9216db5781bf21249d130ec9da846c4624c16137/config.json",
      "model_card": "https://huggingface.co/Qwen/Qwen3-32B/blob/9216db5781bf21249d130ec9da846c4624c16137/README.md",
      "config_max_position_embeddings": 40960,
      "total_hidden_layers": 64,
      "full_attention_layers": 64,
      "linear_attention_layers": 0,
      "kv_heads_per_full_attention_layer": 8,
      "head_dimension": 128,
      "bytes_per_retained_token": 262144,
      "kib_per_retained_token": 256.0,
      "table": [
        {
          "tokens": 32768,
          "kv_bytes": 8589934592,
          "kv_gib": 8.0,
          "context_extension_required": false
        },
        {
          "tokens": 65536,
          "kv_bytes": 17179869184,
          "kv_gib": 16.0,
          "context_extension_required": true
        },
        {
          "tokens": 131072,
          "kv_bytes": 34359738368,
          "kv_gib": 32.0,
          "context_extension_required": true
        },
        {
          "tokens": 262144,
          "kv_bytes": null,
          "kv_gib": null,
          "note": "Beyond context support cited for this model; deliberately omitted."
        }
      ]
    },
    {
      "name": "Qwen3.8-27B",
      "revision": "1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0",
      "sha256": "191e0af232104ed8b65258cf3fb2b842e288008baca7633c11b82a1ac7203aab",
      "model_card_sha256": "57e4bdb258ee1a7d2635c5174ebd4e56abe392505cdb5f8bbb356b0dc4293641",
      "native_context_tokens_from_model_card": 262144,
      "context_limit_used_in_table": 262144,
      "context_note": "The table stops at the model card's 262,144-token native context; extended context is outside this comparison.",
      "config_file": "Qwen3.8-27B.config.1d4bf0f2ff60.json",
      "config_source": "https://huggingface.co/Qwen/Qwen3.8-27B/blob/1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0/config.json",
      "model_card": "https://huggingface.co/Qwen/Qwen3.8-27B/blob/1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0/README.md",
      "config_max_position_embeddings": 262144,
      "total_hidden_layers": 64,
      "full_attention_layers": 16,
      "linear_attention_layers": 48,
      "kv_heads_per_full_attention_layer": 4,
      "head_dimension": 256,
      "bytes_per_retained_token": 65536,
      "kib_per_retained_token": 64.0,
      "table": [
        {
          "tokens": 32768,
          "kv_bytes": 2147483648,
          "kv_gib": 2.0,
          "context_extension_required": false
        },
        {
          "tokens": 65536,
          "kv_bytes": 4294967296,
          "kv_gib": 4.0,
          "context_extension_required": false
        },
        {
          "tokens": 131072,
          "kv_bytes": 8589934592,
          "kv_gib": 8.0,
          "context_extension_required": false
        },
        {
          "tokens": 262144,
          "kv_bytes": 17179869184,
          "kv_gib": 16.0,
          "context_extension_required": false
        }
      ]
    }
  ]
}
