The context budget is 47,104 tokens against a 1M-token model, because num_ctx is a local-inference parameter applied to a hosted route #115
Labels
No labels
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/agent-proxy#115
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raised by Kai while reading #113: "doesn't deepseek have a massive context window?" It does. The proxy is using 4.7% of it.
The numbers
Every
request.prompt_trimmedevent in the last 7 days, all 11 of them, across every logical model:Invariant.
48128 = 47 × 1024,47104 = 46 × 1024— round numbers in the shape of a VRAM allocation, not a provider limit.Against that, from DeepSeek's published pricing page:
deepseek-v4-flashdeepseek-v4-proThe fleet is on the v4 line — litellm logs carry the model group
evaluation/deepseek-v4-flash. I have not confirmed which upstream modelsirens-echo/deepseekresolves to, since that lives in litellm's config and is not visible in telemetry; that is the one thing to check before acting on this. But there is no plausible resolution under which 47,104 is the right number.num_ctxis the tellnum_ctxis an Ollama parameter — the context window you allocate when loading a model into VRAM. It is a real and necessary constraint for the local tier: #108 documentsGET http://100.118.232.24:11434/api/tagshealth checks, and the configured fallbacks aredeploy-backend/ornith:9banddeploy-backend/ornith:35b.For a hosted OpenAI-compatible API it means nothing. The budget appears to be derived once from local-model sizing and applied to every route, including routes served by a provider with a 1M window and no VRAM to run out of.
The provider is not the one objecting
Direct evidence that 47,104 is not an upstream limit, from the 08-10 trim events in #113:
The provider parsed a 171K-token payload far enough to validate message structure and complained about something else entirely. Nothing upstream has ever rejected these requests for length.
What it costs
It manufactures the failures in #113. Trimming is the only thing that breaks these requests, and the budget is the only reason trimming runs. In trace
1a49200c3bebaed778ef2ac5b79d3d99the prompt was 48,226 tokens — 1,122 over budget, and roughly 95% under the model's actual window. That turn was destroyed to enforce a limit that does not exist.It caps every turn's working memory at 47K.
coilyco-gaming/sirens-echo#162records a 53 KB system prompt shipping on every turn; that alone consumes a meaningful fraction of the budget before the member's message is read. Round depth, tool-result retention, and conversation history are all bounded by this number.Related, same shape:
max_tokens: 3600in the captured request body, against a model advertising 384K max output.coilyco-gaming/sirens-echo#367is currently deliberating whether to raise 3600 and estimating a 10–22% token cost. Worth knowing what the ceiling actually is before that decision is priced.What I am not claiming
sirens-echo/deepseekresolves to. Not visible from telemetry. Check litellm's config first.coilyco-gaming/sirens-echo#162shows the prompt is uncached, so a large budget has a real bill attached. The defect is that the number is derived from the wrong thing, not that it is small.ornith:9bandornith:35b,num_ctxis exactly right. This is about applying it where it does not belong.Acceptance
num_ctx.num_ctx, and the log says which of the two bound the request.Related
num_ctxis legitimate.coilyco-gaming/sirens-echo#162— the 53 KB uncached system prompt competing for this budget.coilyco-gaming/sirens-echo#367— themax_tokens: 3600decision, priced without the real ceiling.Next owner
Engineer.