Show notes
From 4K to 2 million tokens#
Not long ago, developers worked with context windows of around four thousand tokens and took pride in clever chunking strategies. Windows then grew to 32K, 128K and one million tokens. At the time of recording (April 2026), Grok 4.1 Fast shipped with a two-million-token window, and Gemini 3.1 Pro offered similar capacity.
Two million tokens is roughly one and a half million words: a shelf of full-length novels, a medium-sized codebase, hundreds of legal documents, or the complete documentation of most open-source projects, all in one API call. The raw number is not the real breakthrough, though. The breakthrough is how much infrastructure it lets you stop building.
The infrastructure you no longer need#
The biggest impact of very large context windows is what teams can skip. Three areas stand out:
- RAG pipelines. If the whole knowledge base fits in context, you may not need embedding models, a vector database, chunking, retrieval tuning or re-ranking. You load everything and ask the question, and accuracy is often better because the model sees all of the material rather than only what the retriever judged relevant.
- Conversation management. Multi-turn agents that once hit limits after a handful of exchanges can now run for hundreds of turns without summarization steps or sliding-window hacks that drop early context.
- Document processing. Instead of splitting a long document across calls, reassembling the results and handling chunk-boundary edge cases, one call sees the full document with its cross-references intact.
RAG is not dead. With millions of documents you still need retrieval. But for the surprisingly large number of applications whose total corpus is under a million tokens, the simplest architecture just became the best one.
How the cost math compares#
At the time of recording (April 2026), the cheapest long-context models priced a completely full two-million-token request at well under a dollar of input, and cache hits on a repeated context cost a fraction of that. Caching matters most for patterns like a coding assistant that sends the same codebase with every request.
Compare that with what a RAG pipeline really costs: a managed vector database billed monthly, a steady stream of embedding calls, and, largest of all, the engineering time needed to keep the pipeline tuned and working. For many teams the math clearly favors a bigger context window. The question shifts from whether you can afford large context to whether you are using enough of it.
Flash-class models were priced lower still for this pattern at the time of recording. Once a single full-context request costs this little, the practical constraint is no longer the price of one call but the total volume you send, which is why the next section matters.
The gotchas nobody mentions#
Large context is not free of trade-offs, and the marketing pages rarely emphasize them:
- Latency scales with context size. A two-million-token prompt takes meaningfully longer to process than a ten-thousand-token one, which can hurt real-time chat. Pre-process and cache during off-peak periods where you can.
- Attention degrades over long inputs. Models do not attend equally to every part of a long prompt. The well-documented lost-in-the-middle problem has improved but not disappeared, so put critical information at the beginning or end.
- Costs can surprise you. Sending full-window requests at high volume multiplies quickly. Caching helps enormously, but only if you design for it deliberately.
- Models are not equal at long context. Benchmark performance at very long lengths varies significantly. Test with your actual data at your actual context lengths before committing to an architecture.
Practical patterns that work#
Four patterns are working well in production:
- The full-codebase assistant. Load an entire repository, since tens of thousands of lines of code fit comfortably, and ask the model to implement features, find bugs or refactor. It picks up your coding patterns, naming conventions and architecture without a retrieval layer.
- The document analyst. Legal, compliance and research teams load a full document set and ask complex cross-reference questions in a single call.
- The long-running agent. Agentic workflows accumulate tool outputs, history and intermediate results over dozens of steps, and a larger window lets them tackle more complex tasks before hitting limits.
- The multi-document synthesizer. Load several research papers and ask for contradictions, common themes and gaps. This is hard to do with RAG because the model must see every document at once.
Because price and long-context quality differ by model, it pays to compare a few on your own workload. Through an OpenAI-compatible gateway such as Crazyrouter, switching between long-context models is a change to one model string.
