Solutions · Long context
Best LLMs for long context
200K to 2M token windows for repos, filings, and transcripts.
Long-context routes evaluate RULER @128K, needle-in-a-haystack at depth, and effective recall — not just the marketing window size. Use auto:long-context when your prompt exceeds 100K tokens; the router excludes models whose accuracy collapses past 64K.
| # | Model | Score | RULER @128K | Why |
|---|---|---|---|---|
| 1 | gemini-3.1-pro | 98 | 94.7% | 2M window with the best effective recall at depth. |
| 2 | gemini-2.5-pro | 95 | 92.1% | Cheaper 2M-window option; nearly identical recall to 3.1. |
| 3 | gpt-4.1 | 92 | 89.8% | 1M window, strong RULER, excellent prompt caching. |
| 4 | claude-opus-4.5 | 90 | 88.4% | 200K window but best-in-class accuracy end-to-end. |
| 5 | claude-sonnet-4.5 | 88 | 87.1% | Best $/M-input under 200K for RAG replacements. |
| 6 | gemini-3.6-flash | 85 | 84.0% | 1M window at $0.30/M — the value pick for doc Q&A. |
| 7 | gpt-4.1-mini | 82 | 81.5% | 1M window, cheapest OAI long-context. |
| 8 | qwen3-235b-a22b | 78 | 76.9% | Open MoE with 256K native; self-hostable. |
| 9 | llama-4-maverick | 76 | 74.2% | 10M-window Maverick; recall drops past 500K. |
| 10 | deepseek-v4 | 74 | 72.5% | 128K, cheapest capable long-context on the roster. |
Why these models
- RULER benchmark at 32K, 128K, and 512K depths — not marketing window size.
- $/1M input tokens and prompt-cache hit rate matter more than output speed.
- Preference for models with prompt caching support to amortize document re-reads.
Drop-in example
const res = await client.chat.completions.create({
model: "auto:long-context",
messages: [
{ role: "system", content: "Answer strictly from the document." },
{ role: "user", content: repoContents /* ~800K tokens */ + "\n\nQ: which module handles auth?" },
],
});