You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error: 400: {"type":"invalid_request_error","message":"prompt (38963 tokens) + max tokens (226281) exceeds the context (262144); requests are never truncated"} #545
Getting stuck with this error even after compacting. Increasing context does not help. I am using Pi.dev 1.0 harness. This issue does not happen with qwen 3.8 27b. Machine has 16g VRAM and 64g RAM.
Thanks. Pi asked for 226,281 output tokens on a 38,963-token prompt. Together that is about 3K over the 262,144-token context, and the server refuses such a request instead of cutting anything. Pi bases the output size on its context setting, so a larger context doesn't help. Two ways around it:
add "fit_max_tokens": true to the model's strata-<model>.json in the Strata folder and restart. The server then shortens max_tokens to the room that's left;
or give the model a smaller max output in Pi's model settings (e.g. 32768).
From 0.1.38 the error message itself says this and gives the largest max_tokens that fits.
one more thing: looks like it happens after compaction. I manually requested pi to compact, compact was successful, but after that i started getting this error and was not able to re-open session
Activity
serve: the "exceeds the context" 400 says how to get past it (#545)
Niko1221 commentedon Oct 3, 2026
Thanks. Pi asked for 226,281 output tokens on a 38,963-token prompt. Together that is about 3K over the 262,144-token context, and the server refuses such a request instead of cutting anything. Pi bases the output size on its context setting, so a larger context doesn't help. Two ways around it:
"fit_max_tokens": trueto the model'sstrata-<model>.jsonin the Strata folder and restart. The server then shortensmax_tokensto the room that's left;From 0.1.38 the error message itself says this and gives the largest
max_tokensthat fits.avarakin commentedon Oct 3, 2026
I added the parameter but still not able to open problematic session. I am able to open it with another qwen model and llama.cpp
avarakin commentedon Oct 3, 2026
one more thing: looks like it happens after compaction. I manually requested pi to compact, compact was successful, but after that i started getting this error and was not able to re-open session
avarakin commentedon Oct 3, 2026
Never mind, it worked. I applied the change incorrectly.
serve: the "exceeds the context" 400 says how to get past it (#545)
serve: the "exceeds the context" 400 says how to get past it (Niko122…
serve: the "exceeds the context" 400 says how to get past it (Niko122…