LM Studio: "context length is too small for this request"
Why a long chat suddenly fails three times in a row, and the two settings that fix it.

Your chat was working, then every reply fails with:
The selected model was loaded with a context length that is too small for this request
Why it happens
The model was loaded with a smaller context length than the chat now needs. The counter at the bottom of the chat shows how big the conversation is. Tools that read files make it grow fast, because the file text is added to the chat.
In my case the model was loaded with 24,064 tokens while the chat had reached about 40K. The Automatic Optimize Based on Hardware setting had picked the small number.
The fix
- Turn Automatic Optimize Based on Hardware off.
- Set Context Length to 65536.
- Set Max Concurrent Predictions to 1.
- Eject the model and load it again. The change only applies on reload.
| Setting | Before | After |
|---|---|---|
| Automatic Optimize | On | Off |
| Context Length | 24,064 (auto) | 65,536 |
| Max Concurrent Predictions | 4 | 1 |
A bigger context uses more memory. If loading fails, try 49,152.
Setup where this happened: RTX 5080 16 GB, 64 GB RAM, Qwen 3.6 35B A3B Q4_K_M.
Comments
Loading…