Skip to main content
PromptQuorumBuilt for humans. Structured for AI.

Best Local LLM for Document Summarization?

By · 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
Best Local LLM for Document Summarization?

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.
Quick AnswersIntermediate

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.

ModelOllama tagDownloadContext
Llama 3.1 8Bllama3.1:8b4.9 GB128K
Gemma 4 E4Bgemma4:e4b6.6–9.5 GB128K
Gemma 4 12Bgemma4:12b7.7–8.0 GB256K
Gemma 4 26B A4Bgemma4:26b16–19 GB256K
Qwen3.8 27Bqwen3.8:27b18 GB256K
Gemma 4 31Bgemma4:31b19–20 GB256K

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 ps
Rule of thumb: one token is about 0.75 English words, so a 50,000-word document is roughly 67,000 tokens. Other languages use more tokens per word.

Full-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

Frequently Asked Questions

What is the best Ollama model for summarization?▾
Gemma 4 12B (gemma4:12b) for most machines: 256K context in a 7.7–8.0 GB download. On a 24 GB GPU, use Qwen3.8 27B or Gemma 4 31B. These picks rest on listed specs and vendor results, not a summarization benchmark we ran.
Why does my local summary only cover part of the document?▾
Usually the context window is too small. Ollama defaults to 4K on GPUs under 24 GiB VRAM, so the rest of the document is dropped. Set OLLAMA_CONTEXT_LENGTH above the document's token count and confirm it with ollama ps.
Does Qwen3 14B support 128K context on Ollama?▾
No. Ollama lists qwen3:14b with a 40K context window; only qwen3:4b and qwen3:30b are listed at 256K. For long documents, use Gemma 4 12B or Qwen3.8 27B instead.
Which models work for offline or edge devices?▾
Gemma 4 E4B (gemma4:e4b, 128K) and Llama 3.1 8B (4.9 GB, 128K) suit 8 GB-class machines; Gemma 4 E2B (gemma4:e2b, 128K) is smaller still. Once a model is downloaded, summarization runs without an internet connection.
How do I stop a summary from oversimplifying?▾
Tell the model what to keep: request section-by-section summaries that preserve numbers, names and caveats, set a target length per section, and ask it to quote the source sentence behind each key claim. Then spot-check the middle of the document against the source.
Do I need extra VRAM to use the full context?▾
Yes. The context cache grows with sequence length on top of the model's download size. Check ollama ps after loading: if the PROCESSOR column shows a CPU/GPU split, lower the context length or choose a smaller model.
Is chunking ever better than full-context summarization?▾
Yes, when VRAM is limited or the document exceeds the context window. Chunking also helps when you need to cite which section a summary point came from, since full-context summarization can blur section boundaries.
MCP