llmrun

Best local LLMs for long context

Run open models featuring a context window of at least 128K tokens to handle large documents and full codebases easily. We rank them using the llmrun Composite Score, highlighting our top recommendation for every memory capacity.

Best for long context on

DeepSeek V4.1 Flash 1017

DeepSeek · Q4_K_M · needs 458 GB · up to 1M context · runs on about 7× H100 SXM 80 GB · from $18.83/hr in the cloud

No memory limit: the best model, whatever memory it needs.

All 298 long-context models, no memory limit ↓

Also worth a look

MiMo V2.6 Pro RL

Q4_K_M · needs 614 GB · about 5× H200 SXM 141 GB · 1M ctx

Best long-context model by memory

Highest llmrun Composite Score that fits each size with at least 128K context and 10 t/s, at a Q3 or better quant. Speed is decode tokens per second on that size's reference GPU. The last row has no memory limit: the best model whatever it needs, on the GPU plan shown. Full ranking

Long-context models, no memory limit298

Ranked by Composite Score, models without one after. Memory is what the listed quant needs; speed is shown only for models that fit one 48 GB GPU.

298 models

Score: llmrun Score, 100 = average model. Ordered by Score. How ranking works

LLM models ranked by Score, recency and Fit
ModelVRAMScore
MiMo V2.5
Q4_K_M·—
187.6 GB
DeepSeek V3.1 Terminus
Q4_K_M·—
412.2 GB
MiniMax M2.7
Q4_K_M·—
139.6 GB
Qwen3.6 35B A3B
Q4_K_M·146.1 t/s
22.0 GB
Gemma 4 31B IT
Q4_K_M·30.6 t/s
21.7 GB
MiniMax M2.1
Q4_K_M·—
139.6 GB
Gemma 4 26B A4B IT
Q4_K_M·165.2 t/s
16.5 GB
Qwen3.5 35B A3B
Q4_K_M·146.1 t/s
22.0 GB
MiniMax M2
Q4_K_M·—
139.6 GB
Qwen3.5 27B
Q4_K_M·35.8 t/s
17.9 GB
DeepSeek R1 0528
Q4_K_M·—
412.2 GB
GLM 4.6
Q4_K_M·—
216.9 GB
Kimi K2 Instruct 0905
Q4_K_M·—
617.3 GB
Seed OSS 36B Instruct
Q4_K_M·28.0 t/s
24.1 GB
GLM 4.5
Q4_K_M·—
217.9 GB

How much memory do you need for long context?

On 8 GB the best long-context model is Gemma 4 E4B IT. At 12 GB it is Qwen3.5 9B (score 99). At 16 GB it is Gemma 4 26B A4B IT (score 106). From 24 to 32 GB it is Qwen3.8 27B (score 122). With no memory limit, the best is DeepSeek V4.1 Flash 1017 (score 133). Weights cover just part of the cost. As tokens fill the cache in your window, a complete 128K prompt may require several gigabytes beyond the model itself. The listed sizes allow space for up to a 16K context.

Frequently Asked Questions

What is the best local LLM for long context?

On 24 GB, Qwen3.8 27B is the top pick with a score of 122, running at about 40 t/s on RTX 4090. It fits up to 128K tokens of context there. On 8 GB, the best fit is Gemma 4 E4B IT. With no memory limit, the best is DeepSeek V4.1 Flash 1017. Open a model to see which GPUs and Macs run it.

Does a long context window use more memory?

The key-value cache scales linearly as token count rises, reaching sizes that can match the model's weights around 128K tokens. Techniques like cache quantization or using grouped-query attention can shrink this footprint.

Is a bigger context window always better?

Quality for info buried deep in a long prompt often slips, plus handling a lengthy request eats up time. Stick to the length you actually need instead of maxing it out.