{
  "licence": "https://creativecommons.org/licenses/by/4.0/",
  "credit": "Saulius Beconis, sbeconis.com",
  "page": "https://sbeconis.com/lab/private-llm/",
  "url": "https://sbeconis.com/lab/private-llm/llm-2026-10-07.json",
  "note": "Measurements and text are CC BY 4.0. Source data and quoted excerpts keep their own licences: see \"attribution\".",
  "lab": "LAB/005",
  "title": "Private LLM on one 12 GB GPU",
  "date": "2026-10-07",
  "method": {
    "runtime": "llama.cpp b11461 (CUDA 13.4), llama-server, all layers on the GPU, flash attention, f16 KV cache",
    "speed": "llama-bench: prompt 512 and 4096 tokens, generation 128 tokens, 3 repetitions; GPU memory read from nvidia-smi minus the idle desktop",
    "dataset": "SQuAD 2.0 dev (CC BY-SA 4.0): 500 questions, seed 7, one third unanswerable",
    "context": "gold paragraph + 4 random paragraphs from the same article, shuffled and numbered",
    "prompt": "You answer questions using only the numbered passages provided. If the passages contain the answer, reply with the shortest exact phrase from the passage that answers it, followed by the passage number in square brackets, for example: Paris [2]. If the passages do not contain the answer, reply exactly: NOT FOUND. Do not use outside knowledge. Reply with one line and nothing else.",
    "decoding": "greedy (temperature 0), max 64 tokens, Qwen3-8B/14B with thinking disabled",
    "scoring": "official SQuAD normalisation; EM/F1 against all gold answers; NOT FOUND scores 0 on answerable questions",
    "end_to_end": "BAAI/bge-base-en-v1.5 cosine search over 1204 paragraphs, top 5, same prompt; 4096-token context and fp16 embedder so both fit on the GPU with Qwen3-14B"
  },
  "environment": {
    "gpu": "RTX 4070 12 GB",
    "cpu": "i5-13400F",
    "ram": "32 GB",
    "os": "Arch Linux",
    "llama.cpp": "b11461 (CUDA 13.4)"
  },
  "headline": {
    "value": "0.4 s",
    "label": "to search 1,204 text passages and answer, 95% of the time, fully offline on one consumer GPU"
  },
  "tables": {
    "speed": {
      "caption": "Speed and memory on one RTX 4070 (12 GB), llama.cpp, all layers on the GPU, flash attention. Generation speed is what a person waiting for an answer feels.",
      "columns": [
        {
          "key": "file",
          "label": "File (GB)",
          "decimals": 1
        },
        {
          "key": "vram",
          "label": "GPU memory at 8k context (GB)",
          "decimals": 1
        },
        {
          "key": "pp",
          "label": "Reading (prompt tok/s, 4k)",
          "decimals": 0
        },
        {
          "key": "tg",
          "label": "Writing (tok/s)",
          "decimals": 0
        },
        {
          "key": "ctx",
          "label": "Longest context that fits",
          "decimals": 0
        },
        {
          "key": "load",
          "label": "Load (s)",
          "decimals": 1
        }
      ],
      "rows": [
        {
          "label": "Qwen3-4B Instruct-2507 Q4_K_M",
          "cells": {
            "file": 2.5,
            "vram": 3.71,
            "pp": 7076.7,
            "tg": 150.6,
            "ctx": 49152,
            "load": 0.71
          },
          "highlight": false
        },
        {
          "label": "Qwen3-4B Instruct-2507 Q8_0",
          "cells": {
            "file": 4.28,
            "vram": 5.38,
            "pp": 7371.3,
            "tg": 98.6,
            "ctx": 49152,
            "load": 0.81
          },
          "highlight": false
        },
        {
          "label": "Qwen3-8B Q4_K_M",
          "cells": {
            "file": 5.03,
            "vram": 5.77,
            "pp": 4362.3,
            "tg": 90.9,
            "ctx": 40960,
            "load": 0.91
          },
          "highlight": false
        },
        {
          "label": "Qwen3-8B Q8_0",
          "cells": {
            "file": 8.71,
            "vram": 8.91,
            "pp": 4580.7,
            "tg": 55.6,
            "ctx": 24576,
            "load": 1.21
          },
          "highlight": false
        },
        {
          "label": "Qwen3-14B Q4_K_M",
          "cells": {
            "file": 9,
            "vram": 9.55,
            "pp": 2374.7,
            "tg": 51.4,
            "ctx": 16384,
            "load": 1.34
          },
          "highlight": false
        },
        {
          "label": "Phi-4-mini Q4_K_M",
          "cells": {
            "file": 2.49,
            "vram": 3.58,
            "pp": 8475.4,
            "tg": 162.2,
            "ctx": 65536,
            "load": 0.82
          },
          "highlight": true
        },
        {
          "label": "Phi-4-mini Q8_0",
          "cells": {
            "file": 4.08,
            "vram": 5.06,
            "pp": 8898.8,
            "tg": 105.9,
            "ctx": 49152,
            "load": 0.91
          },
          "highlight": false
        }
      ],
      "note": "Context steps tested: 4k, 8k, 16k, 24k, 32k, 40k, 48k, 64k, 96k, 128k, 256k, capped at the model's native length. Load time with the file already in the OS cache"
    },
    "qa": {
      "caption": "Grounded answering on 500 SQuAD 2.0 questions: the right paragraph plus 4 others from the same article. 167 questions have no answer in the text.",
      "columns": [
        {
          "key": "overall",
          "label": "Overall correct",
          "suffix": "%"
        },
        {
          "key": "f1",
          "label": "Answer F1 (answerable)",
          "suffix": "%"
        },
        {
          "key": "cite",
          "label": "Cites the right passage",
          "suffix": "%"
        },
        {
          "key": "ab_r",
          "label": "Says NOT FOUND when it should",
          "suffix": "%"
        },
        {
          "key": "ab_p",
          "label": "NOT FOUND was right",
          "suffix": "%"
        },
        {
          "key": "p50",
          "label": "Median answer time (s)",
          "decimals": 2
        }
      ],
      "rows": [
        {
          "label": "Qwen3-4B Instruct-2507 Q4_K_M",
          "cells": {
            "overall": 74.6,
            "f1": 75,
            "cite": 95.8,
            "ab_r": 70.1,
            "ab_p": 84.2,
            "p50": 0.217
          },
          "highlight": false
        },
        {
          "label": "Qwen3-4B Instruct-2507 Q8_0",
          "cells": {
            "overall": 73.2,
            "f1": 74,
            "cite": 95.3,
            "ab_r": 69.5,
            "ab_p": 87.2,
            "p50": 0.234
          },
          "highlight": false
        },
        {
          "label": "Qwen3-8B Q4_K_M",
          "cells": {
            "overall": 72,
            "f1": 78.1,
            "cite": 96.5,
            "ab_r": 55.7,
            "ab_p": 84.5,
            "p50": 0.327
          },
          "highlight": false
        },
        {
          "label": "Qwen3-8B Q8_0",
          "cells": {
            "overall": 74.8,
            "f1": 81.5,
            "cite": 97.5,
            "ab_r": 55.1,
            "ab_p": 88.5,
            "p50": 0.372
          },
          "highlight": false
        },
        {
          "label": "Qwen3-14B Q4_K_M",
          "cells": {
            "overall": 75.6,
            "f1": 85.9,
            "cite": 97.3,
            "ab_r": 50.3,
            "ab_p": 98.8,
            "p50": 0.594
          },
          "highlight": true
        },
        {
          "label": "Phi-4-mini Q4_K_M",
          "cells": {
            "overall": 63.6,
            "f1": 80.5,
            "cite": 74.5,
            "ab_r": 23.4,
            "ab_p": 100,
            "p50": 0.189
          },
          "highlight": false
        },
        {
          "label": "Phi-4-mini Q8_0",
          "cells": {
            "overall": 63.4,
            "f1": 80.9,
            "cite": 88.6,
            "ab_r": 24,
            "ab_p": 100,
            "p50": 0.206
          },
          "highlight": false
        }
      ],
      "note": "Overall correct: answerable questions need an answer with F1 ≥ 0.5, unanswerable ones need NOT FOUND"
    },
    "e2e": {
      "caption": "End to end: the question searches all 1,204 paragraphs (BAAI/bge-base-en-v1.5, top 5), then the model answers from what was found.",
      "columns": [
        {
          "key": "rec",
          "label": "Right paragraph retrieved",
          "suffix": "%"
        },
        {
          "key": "overall",
          "label": "Overall correct",
          "suffix": "%"
        },
        {
          "key": "f1",
          "label": "Answer F1",
          "suffix": "%"
        },
        {
          "key": "ab_r",
          "label": "NOT FOUND when it should",
          "suffix": "%"
        },
        {
          "key": "emb",
          "label": "Search (ms)",
          "decimals": 0
        },
        {
          "key": "gen",
          "label": "Answer (ms)",
          "decimals": 0
        },
        {
          "key": "p95",
          "label": "Total p95 (s)",
          "decimals": 2
        }
      ],
      "rows": [
        {
          "label": "Qwen3-14B Q4_K_M",
          "cells": {
            "rec": 90,
            "overall": 69,
            "f1": 77.4,
            "ab_r": 50.9,
            "emb": 4.49,
            "gen": 596.5,
            "p95": 1.075
          }
        },
        {
          "label": "Qwen3-4B Instruct-2507 Q4_K_M",
          "cells": {
            "rec": 90,
            "overall": 71.4,
            "f1": 67.8,
            "ab_r": 76,
            "emb": 4.38,
            "gen": 216,
            "p95": 0.415
          }
        }
      ],
      "note": "Stage times are medians"
    }
  },
  "charts": {
    "speed": {
      "title": "Writing speed, tokens per second",
      "meta": "Higher is faster · reading speed is not shown: it is 2,000–9,000 tok/s for every model",
      "max": 170.31,
      "decimals": 0,
      "groups": [
        {
          "bars": [
            {
              "label": "Qwen3-4B Instruct-2507 Q4_K_M",
              "value": 150.6,
              "highlight": false
            },
            {
              "label": "Qwen3-4B Instruct-2507 Q8_0",
              "value": 98.6,
              "highlight": false
            },
            {
              "label": "Qwen3-8B Q4_K_M",
              "value": 90.9,
              "highlight": false
            },
            {
              "label": "Qwen3-8B Q8_0",
              "value": 55.6,
              "highlight": false
            },
            {
              "label": "Qwen3-14B Q4_K_M",
              "value": 51.4,
              "highlight": false
            },
            {
              "label": "Phi-4-mini Q4_K_M",
              "value": 162.2,
              "highlight": true
            },
            {
              "label": "Phi-4-mini Q8_0",
              "value": 105.9,
              "highlight": false
            }
          ]
        }
      ]
    },
    "quality": {
      "title": "Overall correct on grounded questions",
      "meta": "Scale 0–100% · includes saying NOT FOUND when the answer is missing",
      "max": 100,
      "suffix": "%",
      "groups": [
        {
          "bars": [
            {
              "label": "Qwen3-4B Instruct-2507 Q4_K_M",
              "value": 74.6,
              "highlight": false
            },
            {
              "label": "Qwen3-4B Instruct-2507 Q8_0",
              "value": 73.2,
              "highlight": false
            },
            {
              "label": "Qwen3-8B Q4_K_M",
              "value": 72,
              "highlight": false
            },
            {
              "label": "Qwen3-8B Q8_0",
              "value": 74.8,
              "highlight": false
            },
            {
              "label": "Qwen3-14B Q4_K_M",
              "value": 75.6,
              "highlight": true
            },
            {
              "label": "Phi-4-mini Q4_K_M",
              "value": 63.6,
              "highlight": false
            },
            {
              "label": "Phi-4-mini Q8_0",
              "value": 63.4,
              "highlight": false
            }
          ]
        }
      ]
    },
    "abstain": {
      "title": "Unanswerable questions: how often the model says NOT FOUND",
      "meta": "Scale 0–100% · the rest got a confident, wrong answer",
      "max": 100,
      "suffix": "%",
      "groups": [
        {
          "bars": [
            {
              "label": "Qwen3-4B Instruct-2507 Q4_K_M",
              "value": 70.1,
              "highlight": false
            },
            {
              "label": "Qwen3-4B Instruct-2507 Q8_0",
              "value": 69.5,
              "highlight": false
            },
            {
              "label": "Qwen3-8B Q4_K_M",
              "value": 55.7,
              "highlight": false
            },
            {
              "label": "Qwen3-8B Q8_0",
              "value": 55.1,
              "highlight": false
            },
            {
              "label": "Qwen3-14B Q4_K_M",
              "value": 50.3,
              "highlight": true
            },
            {
              "label": "Phi-4-mini Q4_K_M",
              "value": 23.4,
              "highlight": false
            },
            {
              "label": "Phi-4-mini Q8_0",
              "value": 24,
              "highlight": false
            }
          ]
        }
      ]
    }
  },
  "examples": {
    "hallucination": {
      "title": "No answer in the text, but the model gave one",
      "verdict": "wrong",
      "fields": [
        {
          "label": "Question",
          "text": "What rule didn't some native live under?"
        },
        {
          "label": "Passage [1] (the one the question was written against; 4 other passages not shown)",
          "text": "In between the French and the British, large areas were dominated by native tribes. To the north, the Mi'kmaq and the Abenaki were engaged in Father Le Loutre's War and still held sway in parts of Nova Scotia, Acadia, and the eastern portions of the province of Canada, as well as much of present-day Maine. The Iroquois Confederation dominated much of present-day Upstate New York and the Ohio Country, although the latter also included Algonquian-speaking populations of Delaware and Shawnee, as well as Iroquoian-speaking Mingo. These tribes were formally under Iroquois rule, and were limited by them in authority to make agreements."
        },
        {
          "label": "Qwen3-14B Q4_K_M replied",
          "text": "Iroquois rule [1]",
          "mono": true
        },
        {
          "label": "Other models",
          "text": "0 of 7 configurations replied NOT FOUND."
        }
      ],
      "source": "SQuAD 2.0 dev, question 5ad3a3fc604f3c001a3fea7b, article “French and Indian War”. CC BY-SA 4.0."
    },
    "abstained": {
      "title": "No answer in the text, and the model said so",
      "verdict": "correct",
      "fields": [
        {
          "label": "Question",
          "text": "During what years was William Ellery Channing President of Harvard?"
        },
        {
          "label": "Passage [1] (the one the question was written against; 4 other passages not shown)",
          "text": "Charles W. Eliot, president 1869–1909, eliminated the favored position of Christianity from the curriculum while opening it to student self-direction. While Eliot was the most crucial figure in the secularization of American higher education, he was motivated not by a desire to secularize education, but by Transcendentalist Unitarian convictions. Derived from William Ellery Channing and Ralph Waldo Emerson, these convictions were focused on the dignity and worth of human nature, the right and ability of each person to perceive truth, and the indwelling God in each person."
        },
        {
          "label": "Qwen3-14B Q4_K_M replied",
          "text": "NOT FOUND.",
          "mono": true
        },
        {
          "label": "Other models",
          "text": "7 of 7 configurations replied NOT FOUND."
        }
      ],
      "source": "SQuAD 2.0 dev, question 5a8205d131013a001a3350f7, article “Harvard University”. CC BY-SA 4.0."
    }
  },
  "attribution": "Questions and passages: SQuAD 2.0 (Rajpurkar, Jia and Liang, 2018), CC BY-SA 4.0, drawn from Wikipedia articles (CC BY-SA).",
  "scatters": {
    "speed_quality": {
      "title": "Speed against answer quality, one 12 GB GPU",
      "meta": "One point per model and quantisation · up and to the right is better",
      "x": {
        "label": "Generation speed (tokens per second)",
        "min": 0,
        "max": 180,
        "decimals": 0,
        "suffix": "",
        "better": "higher"
      },
      "y": {
        "label": "Grounded QA score",
        "min": 50,
        "max": 80,
        "decimals": 0,
        "suffix": "",
        "better": "higher"
      },
      "points": [
        {
          "label": "Qwen3-4B Q4_K_M",
          "x": 150.6,
          "y": 74.6,
          "highlight": true,
          "labelled": true
        },
        {
          "label": "Qwen3-4B Q8_0",
          "x": 98.6,
          "y": 73.2,
          "highlight": false,
          "labelled": false
        },
        {
          "label": "Qwen3-8B Q4_K_M",
          "x": 90.9,
          "y": 72,
          "highlight": false,
          "labelled": false
        },
        {
          "label": "Qwen3-8B Q8_0",
          "x": 55.6,
          "y": 74.8,
          "highlight": false,
          "labelled": false
        },
        {
          "label": "Qwen3-14B Q4_K_M",
          "x": 51.4,
          "y": 75.6,
          "highlight": false,
          "labelled": true
        },
        {
          "label": "Phi-4-mini Q4_K_M",
          "x": 162.2,
          "y": 63.6,
          "highlight": false,
          "labelled": true
        },
        {
          "label": "Phi-4-mini Q8_0",
          "x": 105.9,
          "y": 63.4,
          "highlight": false,
          "labelled": false
        }
      ]
    }
  }
}
