{
 "schema_version": 1,
 "rule_version": 1,
 "unit": "GiB (1024^3 bytes). Card memory advertised as '8GB' is treated as 8 GiB so the two are comparable.",
 "what_it_answers": "Whether a quantised model file fits entirely in a graphics card's memory. It is not a statement about whether the model will run, how fast it will run, or how good its output will be.",
 "not_tested": "These figures are calculated from published file sizes and model architecture. No combination on this site has been tested on physical hardware.",
 "constants": {
  "kv_cache_bytes_per_element": 2,
  "kv_cache_precision": "16-bit (assumed)",
  "short_context_tokens": 4096,
  "working_context_tokens": 32768,
  "runtime_overhead_gib": 1.0,
  "rounding_gib": 0.1,
  "rounding_direction": "up"
 },
 "formulas": {
  "required_vram_gib": "quantised_file_size + kv_cache + runtime_overhead",
  "kv_cache_bytes": "2 (key and value) * 2 bytes * num_kv_heads * head_dim * sum(tokens held per layer)",
  "tokens_held_full_attention": "num_layers * context_tokens",
  "tokens_held_with_sliding_window": "(num_layers - sliding_window_layers) * context_tokens + sliding_window_layers * min(context_tokens, sliding_window_tokens)"
 },
 "measured_inputs": [
  "The size in bytes of the quantised file that is actually distributed.",
  "Model architecture: layer count, key/value head count, head dimension, sliding-window width.",
  "Card memory size as published by the graphics vendor."
 ],
 "assumed_inputs": [
  "The key/value cache is held at 16-bit precision for every token.",
  "Two context lengths are assumed: 4,096 and 32,768 tokens.",
  "A flat 1.0 GiB is set aside for compute buffers, the driver context and the display."
 ],
 "confidence": "Every outcome here is calculated rather than stated by a vendor, so none of them is better than grade B. Where a figure an outcome rests on — the card's memory size, the size of the distributed model file, or the model's attention geometry — carries a weaker grade than that, the weaker grade is shown on the row alongside B, and the row says which figure it is.",
 "verdicts": {
  "fits_in_vram": "The whole model fits in this card's memory at the assumed working context length.",
  "fits_short_context_only": "It fits at the short context length but not at the working context length.",
  "exceeds_vram": "It does not fit in this card's memory even at the short context length. That is not the same as 'will not run': inference software can keep part of the model in system memory.",
  "unverified": "A value needed for the calculation is missing, so no verdict is given."
 },
 "rules": [
  {
   "id": "r1",
   "when": "card memory >= requirement at the working context length",
   "verdict": "fits_in_vram"
  },
  {
   "id": "r2",
   "when": "card memory >= requirement at the short context length only",
   "verdict": "fits_short_context_only"
  },
  {
   "id": "r3",
   "when": "card memory < requirement at the short context length",
   "verdict": "exceeds_vram"
  },
  {
   "id": "r3b",
   "when": "card memory < the model file itself",
   "verdict": "exceeds_vram"
  },
  {
   "id": "r3w",
   "when": "the key/value cache cannot be calculated and card memory < file + overhead",
   "verdict": "exceeds_vram"
  },
  {
   "id": "r0w",
   "when": "the key/value cache cannot be calculated but file + overhead fits",
   "verdict": "unverified"
  },
  {
   "id": "r0",
   "when": "card memory or file size is unknown",
   "verdict": "unverified"
  }
 ]
}
