大模型网摘deepseek.wang

Guides · 2026-10-28

Using 1M Context Wisely: When to Fill the Window, and When to Retrieve Instead

1M context is no longer rare: DeepSeek's current V4.1-Flash-1017 and V4-Pro-0813 both carry an official 1M-token context length with 384K max output (see our open-weights deep dive), and Kimi K3.1 Pro matches the 1M figure. Once the window is big enough, the question shifts from "does it fit" to "should you fill it". This guide draws a pragmatic line.

First, price the fill

Per the official pricing page (as of press time), filling a 1M input on cache miss costs about $0.15 off-peak / $0.30 peak on deepseek-flash, and $0.66/$1.32 on deepseek-v4-pro (the peak/off-peak explainer covers the mechanics). A single full-window fill looks cheap — but if the window is rebuilt on every request, say by re-pasting documents each turn, costs scale linearly with request count. The cache-hit price is the real dividing line: on Flash, $0.003 off-peak versus $0.15 on miss is roughly a 50x gap, which means repeated prefixes must hit the cache — expanded in our API cost-saving guide.

What belongs in the window — and what does not

Good fits for a full window: one-off deep analysis of long documents (contracts, research reports, a concentrated review of a large codebase) and tasks that need global structure (cross-chapter rewrites, whole-repo refactor reviews). Poor fits: frequently repeated fixed instructions and knowledge (settle them into a stable prefix to hit the cache) and retrievable factual content (hand it to Search & Fetch or your own retrieval, pulled on demand). Stuffing generic filler into the window buys tokens and pays with money and latency.

Three practical habits

One, keep the prefix stable: system prompt, tool definitions and format requirements go first, verbatim and unchanged, with dynamic content after — that is the precondition for cache hits. Two, summarize per section, then expand on demand: have the model produce chapter summaries before pasting full text of relevant sections — cheaper than one giant input and often more accurate. Three, watch usage: the usage field in responses reports cached tokens, and reconciling it exposes invisible waste like windows being rebuilt every turn. Serving-side optimizations help too — mechanisms such as DeepInfer's SWA bounded replay show long-context decoding costs can be engineered down. For model names and prices, see the quick reference.

In one line: the 1M window is a capability ceiling, not a budget target. Structured context management saves far more than "stuff as much as fits" — and stays controllable.