You've been chatting with a local model for an hour, and suddenly it has forgotten the name you gave it at the start. Or you paste a long report and the app says it's too long. Both come down to one setting: the context window. This guide explains what it is, why it costs memory, and how to get the most from it on a Mac, iPhone, or iPad.
What a context window is
A language model doesn't remember your conversation the way you do. Every time it answers, it rereads everything it's been given: its instructions, the conversation so far, any document excerpts, and the reply it's writing. The context window is the most text it can hold in that single read.
It's measured in tokens, the small pieces of words that models work with. In English, one token is about three quarters of a word, so:
| Context window | Roughly |
|---|---|
| 4K tokens | About 3,000 words, a short article |
| 8K tokens | About 6,000 words, a long chat |
| 32K tokens | About 24,000 words, around 50 pages of plain text |
| 128K tokens | About 96,000 words, a short book |
Code, tables, and languages other than English use more tokens per word, so they fill the window faster.
Everything shares the same window
The window isn't only for your messages. Several things fit in the same space at once:
- The model's instructions (the system prompt)
- The conversation so far, both your messages and its replies
- Any document excerpts or pasted text
- Room for the answer it's about to write
That last one surprises people. If a model can write answers up to 4,000 tokens long, that space has to be kept free, so a 32K window leaves about 28K for everything else.
What happens when the window fills up
Something has to give. Most apps drop the oldest messages so the newest ones still fit, which is why a model "forgets" early details in a long chat. It isn't broken. Those messages are simply no longer in front of it.
In Kynora AI, Chat keeps its instructions and removes the oldest messages first when a conversation outgrows the window. The Writing Assistant works differently: if the text you selected is too long for the model, it tells you so and gives a rough word limit, instead of quietly cutting part of it. That matters when you use Replace, because a trimmed input could delete text from your document.
Why a bigger window costs memory
While it reads, the model keeps a working copy of the whole context, called the KV cache. It sits in memory next to the model's weights and grows with every token in the window.
How much depends on the model's design. As an example, Llama 3.1 8B needs about 128KB per token at full precision:
| Context in use | Extra memory for Llama 3.1 8B |
|---|---|
| 8K tokens | About 1GB |
| 32K tokens | About 4GB |
| 128K tokens | About 16GB |
That's on top of the roughly 4.5GB the model's weights take at 4-bit. Newer models are often more efficient: Qwen2.5 7B needs less than half as much per token. But the rule holds for every model. A long context can cost as much memory as the model itself, and that's why a model that fits on paper can slow down late in a long chat. For how this fits into planning your memory, see how much RAM you need for local AI.
Trained limit vs the limit you set
Every model has a maximum it was trained for. Llama 3.1, for example, supports up to 128K tokens. That doesn't mean you should use all of it. Apps set a working size that fits your device's memory, and you can usually change it.
In Kynora AI, the Chat setting is Settings → Chat → Context window. It defaults to 32K tokens, never goes above the model's own maximum, and is lowered automatically on devices with less memory to keep things stable. Next to it you'll see the size the model reports and its maximum, and if you pick a size above the safe one, the app warns you it may use more memory. Ask Docs has its own setting under Settings → Ask Docs.
Long documents don't need a huge window
You might assume that asking about a 300-page PDF needs a window big enough to hold all 300 pages. It doesn't. That's what retrieval-augmented generation (RAG) is for. Kynora AI's Ask Docs indexes the whole document on your device, then finds the passages that matter for each question and gives the model only those. It sizes how many excerpts to include based on the context window, and always leaves room for the answer.
This is usually better than pasting the whole document, too. Models pay the most attention to the start and end of a long context and can miss details in the middle. A few relevant passages give a sharper answer than 300 pages at once, and Ask Docs cites the page each one came from.
Tips for working within the window
- Start a new chat for a new topic. Old messages take up space and can steer the model off course.
- Restate key facts in long chats. If something from the start matters, mention it again.
- Use Ask Docs for documents instead of pasting long text into Chat.
- Raise the window only if you need it. On 16GB or more, 32K is comfortable for most models. On 8GB devices, a smaller window keeps replies fast.
- Choose a model with a long trained context if you regularly work with long material. Kynora AI shows each model's maximum in the settings.
The bottom line
The context window is the model's short-term memory. It's measured in tokens, it's shared by your messages, documents, and the reply, and it costs memory as it grows. A bigger window isn't always better on a phone or laptop. Pick one that fits your device, start fresh chats often, and let Ask Docs handle long documents. Understanding model quantization helps too, because smaller weights leave more memory for context.