A long-document task is decided by one number: the document’s token count against each model’s context window. A model whose window is smaller than the document cannot read it whole, whatever else it can do. List the candidates’ windows, compare them with the document, and pick the smallest model whose window fits, so you do not pay for context you do not use.
Prerequisites
- The document’s token count.
- The context window of each candidate model, from its model card.
- The runtime’s actual window, which may be smaller than the advertised one.
Steps
Step 1: Measure the document
Count the document’s tokens. A 40,000-token report needs a window above 40,000 tokens plus room for the question and the answer.
Step 2: List the windows
List each candidate model’s advertised window and the runtime’s actual window for it. The smaller of the two is the window you actually get; the advertised number alone is not enough.
Step 3: Pick the smallest fit
Pick the smallest model whose actual window fits the document plus the question and the answer. If no model fits, the document must be split or summarized first.
Worked example: Harbor Light library 40,000-token report
The fictional Harbor Light library compares 3 models for a 40,000-token annual report.
| Model | Advertised window | Actual window | Fits 40,000 tokens |
|---|---|---|---|
| Model A | 8,192 | 8,192 | No |
| Model B | 128,000 | 32,768 | No: runtime gives 32,768 |
| Model C | 128,000 | 128,000 | Yes |
Model A fits nothing, model B advertises 128,000 but the runtime gives 32,768, and only model C fits the 40,000-token report, so the library picks model C.
Expected result. You have a written comparison of advertised and actual windows, and the choice follows from the document size. UNTESTED: this guide was not run against a live model or API. The worked example below is fictional practice material, and its result is the expected result, not a measured one.
Limits
- A larger window needs more memory for the KV cache; check that the model still fits.
- Advertised windows change with model versions; check the current model card.
- This guide does not cover splitting or summarizing, which are the alternatives when nothing fits.
