Best Local LLM for Document Summarization?
By Hans Kuepper · Founder of PromptQuorum · Discovery engine for open-weight & open-source AI
Gemma 4 12B is the best starting point for local summarization on Ollama: it has a 256K context window, a 7.7–8.0 GB download and lists text summarization as an intended use. On a 24 GB GPU, Qwen3.8 27B and Gemma 4 31B (both 256K) handle longer or denser documents. Ollama's default context is only 4K on GPUs under 24 GiB VRAM, so raise it before summarizing or part of the document is dropped.
Key Takeaways
- ✓Best pick: Gemma 4 12B — 256K context, 7.7–8.0 GB download, summarization listed as an intended use
- ✓Best for 24 GB GPUs: Qwen3.8 27B or Gemma 4 31B — both 256K context, stronger on dense, multi-topic documents
- ✓Ollama defaults to a 4K context on GPUs under 24 GiB VRAM — raise OLLAMA_CONTEXT_LENGTH before summarizing
- ✓Qwen3 14B is listed at only 40K context on Ollama, so it is not a long-document pick
- ✓Chunking remains the right approach when the document exceeds the context window or VRAM is tight

Quick Answer
Gemma 4 12B is the best starting point on Ollama: 256K context in a 7.7–8.0 GB download. Qwen3.8 27B and Gemma 4 31B suit 24 GB GPUs.
- ▸Gemma 4 12B (gemma4:12b) has a 256K context window and Apache 2.0 licensing — the default pick for 12–16 GB machines.
- ▸Qwen3.8 27B (18 GB) and Gemma 4 31B (19–20 GB) suit 24 GB GPUs; Google reports 66.4% for the 31B versus 43.4% for the 12B on the MRCR v2 8-needle 128K test.
- ▸Set the context length yourself: Ollama defaults to 4K on GPUs under 24 GiB VRAM, which cuts off long documents.
Best Pick: Gemma 4 12B (Qwen3.8 27B or Gemma 4 31B for 24 GB)
Gemma 4 12B is the best starting point for local summarization: its Ollama tag (gemma4:12b) lists a 256K context window in a 7.7–8.0 GB download, and Google's model card names summaries of reports and research papers as an intended use. It is released under Apache 2.0 and fits comfortably on a 12–16 GB machine.
On a 24 GB GPU, step up to Qwen3.8 27B (qwen3.8:27b, 18 GB, 256K) or Gemma 4 31B (gemma4:31b, 19–20 GB, 256K). Google reports 66.4% for the 31B against 43.4% for the 12B on the MRCR v2 8-needle 128K long-context test, so the larger model is the safer choice for dense, multi-topic documents where the summary must not miss a section.
We did not run a summarization benchmark for this page. The picks rest on Ollama-listed context windows, download sizes and vendor-reported results — test any model on your own documents before relying on it. ([Gemma 4 model card](https://huggingface.co/google/gemma-4-12b-it), [Ollama library](https://ollama.com/library/gemma4))
Llama 3.1 8B (llama3.1:8b, 4.9 GB, 128K) still works for lightweight summarization on 8 GB machines, but its Ollama listing has not been updated in about a year.
Model Picks by Memory Size
Listed context windows and download sizes from the Ollama library, smallest to largest. Download size is not total memory: the context cache comes on top and grows with context length.
| Model | Ollama tag | Download | Context |
|---|---|---|---|
| Llama 3.1 8B | llama3.1:8b | 4.9 GB | 128K |
| Gemma 4 E4B | gemma4:e4b | 6.6–9.5 GB | 128K |
| Gemma 4 12B | gemma4:12b | 7.7–8.0 GB | 256K |
| Gemma 4 26B A4B | gemma4:26b | 16–19 GB | 256K |
| Qwen3.8 27B | qwen3.8:27b | 18 GB | 256K |
| Gemma 4 31B | gemma4:31b | 19–20 GB | 256K |
Raise Ollama's Context Length First
Ollama defaults to a 4K context on GPUs with under 24 GiB VRAM, 32K on 24–48 GiB and 256K at 48 GiB or more, so a long document is cut off unless you raise the setting. A 4K window holds about 3,000 English words; the model then summarizes only what fits. See the [Ollama context length documentation](https://docs.ollama.com/context-length).
Set OLLAMA_CONTEXT_LENGTH before starting the server, sized to the document plus room for the summary, then run ollama ps: the CONTEXT column shows the allocated length and PROCESSOR shows whether the model sits fully on the GPU. Aim for 100% GPU at the context you need.
OLLAMA_CONTEXT_LENGTH=65536 ollama serve
# in a second terminal
ollama pull gemma4:12b
ollama run gemma4:12b
ollama psFull-Context Summarization vs Chunking
Feeding a whole document into a long-context model in one pass avoids the cross-chunk context loss of chunk-and-summarize pipelines, but it needs more memory and is not automatically more faithful.
Research on long-form summarization reports positional bias in how faithful summaries are to different parts of a long document ([On Positional Bias of Faithfulness for Long-form Summarization](https://arxiv.org/abs/2410.23609)), so check the middle of long documents against the source.
Use chunking — summarize each section, then summarize the summaries, optionally with an embedding model for retrieving relevant sections — when VRAM is limited, the document exceeds the context window, or you need to cite which section a point came from.
Related Reading
- ▸Which Ollama Models Support 128K Context? — the full list of long-context models
- ▸Best Embedding Model for Local RAG — a chunking-based alternative approach
- ▸How Much VRAM Do You Need for a Local LLM? — sizing hardware for long-context work