Large Language Models

LLM Context Length: Free Models, Memory Limits, Settings and Roleplay Tips

Why does your AI character forget names after twenty messages? This article explains LLM context length in plain words, compares free models by memory size, shows which settings to change, and gives practical roleplay habits that keep long stories consistent.

LLM Context Length: Free Models, Memory Limits, Settings and Roleplay Tips
Cristian Da Conceicao

Your character just called you by the wrong name. The dragon you killed three scenes ago is suddenly alive again, and the tavern you burned down is serving ale. Nothing is broken, and the model is not being lazy. It simply ran out of room. Every language model reads and writes inside a fixed window of memory, and once your chat outgrows that window, the oldest material quietly falls out of view.

This article explains LLM context length in plain words: what it measures, how big it is on popular free models, which settings change how much the model remembers, and how to keep a long roleplay consistent without paying for a giant window you may not need.

💡 Quick answer: context length is the total number of tokens a model can look at in one request. That total includes your instructions, the chat history, and the reply the model is about to write. When the total goes over the limit, something gets cut.

What Context Length Really Means

Think of the context window as the desk a model works on. Everything it can see has to fit on that desk at the same moment. Anything that does not fit is gone, as far as the model is concerned. It has no hidden filing cabinet, and it does not carry memories from one request to the next. Each reply is generated fresh from whatever text you send along with it.

Paper index cards laid out in a long winding row on a wooden desk

Tokens, Not Words

Models do not count words. They count tokens, which are chunks of text. In English, one token is roughly four characters, or about three quarters of a word. Short common words are often one token. Rare names, slang, and words in other languages can take three or four tokens each.

Context sizeApprox. English wordsRoughly equals
4K (4,096 tokens)3,000A long blog post
8K6,000A short story
32K24,000A novella chapter set
128K96,000A full novel
1M750,000A shelf of books

These are estimates. Code, emoji, and non-English text eat tokens faster, so a chat in Japanese or Arabic fills the same window sooner than a chat in English.

What Fills the Window

Beginners assume the window holds only the chat. It holds much more:

  • The system prompt, which sets the rules and tone.
  • The character card or persona, often 500 to 1,500 tokens on its own.
  • Lorebook or world notes, if your app injects them.
  • Every earlier message from you and from the model.
  • Space reserved for the next reply, set by the max output setting.

That last item surprises people. If your window is 8K and you reserve 1,000 tokens for the answer, you really have 7K for everything else.

Context Sizes Across Free Models

"Free" means different things. It can mean open weights you run on your own computer, a free tier with daily limits, or a model that costs very little per request. In every case, the number printed on the model page is the maximum, not a promise about quality.

Hands typing on a laptop at a coffee shop table beside a notepad with a hand-drawn bar chart

Small Windows: 4K to 8K

Older open models are the classic example. Llama 2 7B Chat and the other Llama 2 sizes, such as Llama 2 13B Chat and Llama 2 70B Chat, work with about 4K tokens. That is fine for a quick question and painful for a story. Meta Llama 3 8B Instruct doubles that to roughly 8K, and Mistral 7B v0.1 sits in the same neighbourhood.

Small windows still have a place. They answer fast, they are cheap to run, and they force you to keep prompts tight, which is a good habit anyway.

Mid and Long Windows

The newer free and low-cost families are far more generous. Granite 4.0 H Small is built specifically for long inputs, and Granite 4.1 8B is a free option for chat and code. If your work is code, Granite 8B Code Instruct 128K carries its window size in the name, and its sibling Granite 20B Code Instruct 8K shows what the older generation offered.

Other families worth testing for long chats include DeepSeek V3, Kimi K2.6, and Qwen3.7 Plus. Check the model page for the exact window on each, since vendors change these numbers between versions.

Giant Windows and Their Catch

Llama 4 Scout Instruct is advertised with a window of up to 10 million tokens, and Llama 4 Maverick Instruct is advertised at around 1 million. Google's Gemini 3.5 Flash and Gemini 3.1 Pro also sit in the long-window camp.

Low-angle view of a wooden library ladder against a towering wall of books in golden light

Here is the catch. By late 2026, windows of 1 million tokens are common, and the median across tracked models is reported around 256K. But the advertised window and the effective window are different things. Independent testing keeps finding that accuracy drops well before the maximum, especially when the one detail you need is buried in the middle of a huge pile of text. A giant window is a big library, not a better reader.

💡 Rule of thumb: treat roughly half of the advertised window as the safe working zone. Past that point, summarize or retrieve instead of pushing more raw text in.

How Memory Limits Break Chats

Most people notice context limits only when something odd happens. There are two main failure patterns, and they look different.

An overstuffed leather satchel with loose paper pages blowing away on a train platform

Silent Truncation

When the chat gets too long, most apps drop the oldest messages first. Your opening scene, the character card (in some apps), and the original rules can vanish without a warning. The model then improvises. That is why a character suddenly changes personality: the text that defined them is no longer on the desk.

Signs of truncation:

  1. The character forgets a name, a promise, or a location.
  2. The writing style drifts toward generic phrasing.
  3. Rules from the system prompt stop being followed.
  4. Replies repeat earlier phrases, because the model only sees its own recent output.

Lost in the Middle

The second pattern happens even when everything technically fits. Models pay the most attention to the start and the end of the window. Facts in the middle get weaker attention. If you stuff 80,000 tokens into a chat and bury the important clue at token 40,000, the model may miss it.

The fix is simple: put the most important information at the very beginning (system prompt, character card) or restate it near the end, close to your latest message.

Settings That Actually Matter

Chat apps and API tools expose many sliders. Only a handful change memory behaviour in a way you will notice.

A woman in a denim jacket adjusting slider knobs on a wooden mixing console in a sunlit office

The Context Size Slider

Many local and self-hosted setups ask you to choose a context size yourself, and the default is often small, such as 2K or 4K, even when the model supports far more. If your character forgets things quickly, check this first. Raising it increases memory use, so there is a limit set by your hardware. On hosted models, the vendor usually sets it for you.

Max Output Tokens

This number is the largest reply the model may write. Set it too low and replies end mid-sentence. Set it too high and you waste window space reserved for text you will never see. For roleplay, 250 to 500 tokens suits most scenes. For long-form writing, go to 1,000 or more.

Temperature and Repetition Penalty

These two do not change how much the model remembers, but they change how well it uses what it remembers.

SettingLow valueHigh valueGood starting point for roleplay
TemperaturePredictable, safeCreative, risky0.7 to 0.9
Top PNarrow word choicesWider variety0.9
Repetition penaltyAllows loopsAvoids repeats, can derail1.05 to 1.15
Max output tokensShort repliesLong replies300 to 500

💡 Watch the penalty. A repetition penalty that is too strong pushes the model away from words it has already used, including your character's own name. If names start to mutate, lower it.

Roleplay Tips for Long Stories

Roleplay is the hardest test of context length, because the story is both long and detail-heavy. You can write for hours on a modest window if you manage what sits on the desk.

A young man on a sofa reading a chat on a tablet in a warm lamp-lit living room

Write a Short Character Card

A character card is paid for in tokens on every single request. A 2,000-token card on an 8K window leaves a quarter of your memory permanently occupied. Aim for 300 to 700 tokens: name, age, voice, three traits, one goal, one fear. Cut backstory the model does not need yet.

A tight card might read like this: "Mara, 34, ship's navigator. Dry humor, speaks in short sentences, distrusts officers. Wants to find her missing brother. Never admits when she is scared."

Do the Math for Your Window

Here is a worked example for an 8K window:

  • System prompt: 300 tokens
  • Character card: 700 tokens
  • Reserved reply space: 400 tokens
  • Left for history: about 6,700 tokens

If each exchange (your message plus the reply) averages 400 tokens, the model remembers roughly 16 exchanges. After that, the oldest turns drop. Knowing this number tells you exactly when to summarize.

Summarize Every 20 Turns

This habit does more than any setting. Every 15 to 20 exchanges, write (or ask the model to write) a short summary of what happened. Paste it near the top of the chat, then delete the old messages it replaces.

A woman's hands writing a summary in a leather journal beside a stack of notebooks and black coffee

A good summary includes:

  1. Who is present and how they feel toward each other.
  2. Where the scene takes place.
  3. What changed (deaths, promises, injuries, items gained or lost).
  4. Open threads the story still needs to resolve.

Keep it under 200 tokens. A story summarized this way can run for hundreds of turns on a window that would otherwise hold only 16.

Pin Facts, Drop Filler

Not every message deserves a place on the desk. Greetings, repeated descriptions, and long out-of-character chatter use tokens without adding story. Many apps let you pin or lock certain messages, or store facts in a lorebook that only loads when a trigger word appears. Use these tools for names, rules, and relationships. Let casual banter fall off the end.

💡 Restate, don't hope. If a detail matters in the next scene (the stolen key, the secret, the injury), mention it again in your own message. One sentence is cheaper than a plot hole.

Picking a Model by Need

Bigger is not always better. A giant window costs more, runs slower, and may bury your details. Match the model to the job.

Three people comparing printed pages and laptops at a long table in a bright co-working space

Your goalWindow you needModels to try
Quick questions, short chats4K to 8KLlama 2 7B Chat, Meta Llama 3 8B Instruct
Everyday chat and light roleplay32K to 128KGranite 4.1 8B, DeepSeek V3
Long stories and lorebooks128K or moreGranite 4.0 H Small, Kimi K2.6
Huge documents, many files1M or moreLlama 4 Scout Instruct, Gemini 3.5 Flash
Polished writing and reasoningLarge, with strong recallClaude Sonnet 5, GPT 5.6 Luna

Window size is one factor. Writing quality, instruction following, and speed matter just as much, so test two or three models with the same opening prompt before you commit to a long story.

Quick Fixes for Common Problems

The Character Forgets Its Name

Check the card first. If the card is long and sits at the very top of an overfull chat, your app may be cutting it. Shorten the card, pin it, or restate the name in your latest message. Then raise the context size if your setup allows it.

Replies Get Cut Off

This is nearly always the max output tokens setting. Raise it to 500 or more. If it is already high, the window may be full, so there is no room left to write. Summarize older turns to free space.

The Model Repeats Itself

Lower the repetition penalty slightly, raise the temperature a little, and trim old messages that contain the repeated phrase. Models love copying patterns they can see in their own history.

Everything Slows Down

Longer context means more computing work on every reply. If speed drops, you are probably sending far more text than needed. A clean summary plus the last ten messages is often faster and sharper than the whole transcript.

Try It on Picasso IA Today

You do not need to guess which model suits your story. Open the large language models collection on PicassoIA, pick two models from the table above, and paste the same opening scene into each. Watch how long each one stays consistent, then adjust the max output and temperature and run the test again.

A young woman smiling at her phone on a sunlit balcony during golden hour

Try a quick experiment: write a 400-token summary of your current story, start a fresh chat with it, and see whether the characters hold together better than they did in the original 100-message thread. For many people, the answer is yes. Then take the same creative spark further, and build the cover art, character portraits, and scene images for your story with the image models on Picasso IA. Start with one chat, one character, and one summary, and you will see the difference in the next scene.

Share this article

Choose your language

FreeCreate AI Images and VideosFree, No Credit CardFree Generations to StartSeedance 2.5 Lite IncludedStart Free Now