Verdict: worth it with changes — the capability is needed, the layer is right, the footprint is tiny (9 files, +35/−14 plus one test, all Ignition Python), and the flag is a strict no-op when omitted. But as pushed the new test still cannot pass, and the "page-multiple validation" the description claims was removed in this revision, leaving an unaligned target that exports a core Helios refuses to load after a full GPU preparation.
What the change does (verified on the head)
ignition/preparation/bootstrap.py:58—"context": plan.prepared_contextreplacesplan.recipe.context. This is the only line that reaches the core:BasePreparationConfig.context(bootstrap.py:33) → Heliosprepared_sequence_tokens(helios/src/server/config.rs:131) →limits.max_sequence_tokens(config.rs:148), narrowed to the physical pool (helios/src/model.rs:268-272), enforced at admission (helios/src/server/request.rs:350) and advertised asmax_model_len(helios/src/server/models.rs:81(not opened)). A cap also lowers the default output allowance, sincemax_new_tokensdefaults tomax_sequence_tokens(config.rs:210-212).ignition/planning.py:186—context_target: int | None = Noneon the frozenPlan;:377-381—prepared_context= recipe max when no target, elsemin(recipe.context, context_target, tokens); stockPlan.context(:372-374) untouched.- Wiring:
planning.py:549,689;cli/preparation.py:68-69;cli/serve.py:207(multi-host),:291,:476;cli/bench.py:177. All four entry points forward the flag — the multi-host gap from the earlier round is closed. - Artifacts:
to_dict()(planning.py:438) carriescontext_targetandprepared_context;--request-contextinreproduction_arguments(rebuild_manifest.py:264-265);context_targetasSCOPE_DEPLOYMENT(rebuild_manifest.py:389); bench configuration record now includes both keys (cli/bench.py:248); the "Select GPUs" line prints the effective value (cli/serve.py:319). - Docs: flag row plus both ownership rows (
docs/cli-design.md:446,1443,1493).
Charter mapping
- What gets merged: "a measured performance/memory issue". The description gives a measured VRAM table on a named SM120 card, model, pinned revision and the exact commands.
- Vision fit: the exact case the vision names — long conversations / coding agents on one SM120 workstation or DGX Spark — where a 256K per-request ceiling over-provisions KV for the requests actually served. Single-model rationale; the multi-model framing that was a charter non-goal is gone from the docs row.
- Right problem, right layer (#404): the runtime genuinely cannot do this.
--kv-cache-limit context|concurrency(helios/src/runtime_core/memory.rs:284-331) and--memory-limit(memory.rs:238-274) shape the pool; neither can lowermax_sequence_tokensor the advertisedmax_model_len, which are baked fromprepared_sequence_tokensat load. An honest under-capacity advertisement is an export-time decision. - No per-model branches: one dataclass field, one property, three pass-throughs, one help line. Nothing recipe-specific, no Helios change, no new mechanism.
- Be explicit: the setting now reaches the plan JSON, the printed plan line, the benchmark record, the embedded preparation manifest and the reproduction command.
- Evidence: solid for the pool effect (~8.2 / ~6.3 / ~4.3 GB per slot; 16 GB freed at concurrency 4), but see gap 5.
Blockers (must fix before merge)
- The new test cannot pass — two independent defects in
tests/cli/test_planning.py.:254assertsby_key["context_target"].value.int64_value == 131072._preparation_valuewritesuint_valuefor a non-negative int (rebuild_manifest.py:332-333; proto fields areint_value = 2,uint_value = 3,helios/proto/runtime_core.proto:127-128), so the attribute does not exist →AttributeError. Correct assertion:uint_value == 131072.:238-240expectsmatch="multiple of the"forcontext=100. No page-multiple validation exists on this head (Plan.__post_init__,planning.py:224-296, never mentionscontext_target; search finds no such error string anywhere inignition/).context=100is rejected instead by the chunk check atplanning.py:709-711— "--prefill-chunk-size 4,096 exceeds the 100-token context this plan allows" — sopytest.raises(..., match="multiple of the")fails.
- The alignment validation the description advertises is missing, and its absence is a real export-time defect. Helios rejects a core whose
prepared_sequence_tokensorlimits.max_sequence_tokensis not a multiple of the page size (helios/src/model/catalog.rs:49-57, called at load fromhelios/src/server/config.rs:226). With no export-time check,--request-context 131100on a 64-token-page recipe plans cleanly, spends the full GPU preparation, and then the core fails with "invalid prepared model configuration" atflare run. Add the check inPlan.__post_init__on the value actually served —min(recipe.context, context_target) % page_tokens(page_tokens is available there viaplanning.py:335-338) — so an oversized-but-aligned target (500000-alignment aside) stays accepted,100is rejected, and the docs may then state the rule. Either implement it or drop the claim from the description and document that unaligned targets fail at load.
As pushed, pytest tests/cli/test_planning.py therefore fails; the head has no CI, which is why it has not been seen.
Should fix
Plan.demand_pagesis still uncapped (planning.py:331-332):concurrency * (recipe.context // page_tokens)feeds the printed/to_dictKV demand (:446), so a capped core's report overstates the very number this flag lowers. Useprepared_context.- Cap-affected derived values still use the recipe max.
_server_optionssizesmax_body_bytesfromrecipe.contextand tells clients "context is limited by the checkpoint and available cache capacity" (cli/serve.py:68-69) — that hint is what a user sees on a context admission error. With a cap both misdescribe the served ceiling. Related:ignition/cli/help.py:38advertises--prefill-chunk-size: 64..{recipe.context}, a range above the effective context once capped; anddocs/cli-design.md:446should note that a cap also lowers the default output allowance (config.rs:210-212). - The evidence still does not measure what only this flag can do. Every column uses
--kv-cache-limit concurrency, so the table measures the pool, which--kv-cache-limit context/--memory-limitalready move at serve time (and under the default--kv-cache-limit memory,page_ceilingreturnsOk(None),helios/src/runtime_core/memory.rs:290-292, so the headline should state the condition). Add one case at equal prompt and output length proving the ceiling: a request between the cap and the recipe max rejected by the capped core and accepted by stock, plus/v1/modelsreporting the smallermax_model_len. - One description claim is false. "a cap above the pool is a no-op: the prepared context resolves to the pool-bound value, matching stock behavior" — stock passed
recipe.contextunclipped (bootstrap.py:58before this PR), whereasprepared_contextismin(recipe.context, target, tokens)(planning.py:381), so a cap above the pool can prepare a lowermax_sequence_tokensthan the same export without the flag. That is a deliberate, defensible clamp (the pool cannot hold more), but it is a behaviour change and should be stated as one. The description also claims the test covers "the bootstrap value"; it does not — nothing assertscommon_preparation_kwargs(plan)["context"] == plan.prepared_context(tests/cli/test_commands.py:94-97checks only prefill chunk and max_active). That is the one line that changes the exported core, so it deserves the assertion. - Name the kwarg
context_target=infit()/plan()(planning.py:461,605) —context=next to aPlan.contextwith different meaning invites misuse. Minor: put the positive-value check (planning.py:467-468) beside the alignment check so both live in__post_init__and both cover directPlan(...)construction.
Cost, benefit, alternatives
- Cost: ~35 added lines, one optional field with a default, one property, three pass-throughs, one help line, no runtime or CUDA path, no catalog or state-transition risk. Maintenance is the three artifact sites, all now covered. Omitting the flag returns
recipe.contextexactly (planning.py:379-380), so existing cores and cached artifacts are unaffected. - Benefit: for someone serving one long-context model on a single SM120 card or DGX Spark, the choice between 256K per request and roughly double the concurrency, plus an honestly advertised context. 16 GB freed at concurrency 4 on Qwen3.8-27B is real, but bounded — it helps the memory-constrained single-model deployment the vision describes, not a broad audience.
- Simpler alternative / duplication: checked and rejected.
--kv-cache-limitand--memory-limitshape loaded KV but cannot lower the admission ceiling ormax_model_len; doing it "without new code" would mean minting recipe variants. This is the smallest footprint that reaches the decision point. - Risk: low. The only semantic change is that a cap below the pool now caps admission and the advertised
max_model_len— which is the point — plus the alignment hole in blocker 2.
Bottom line
Merge once the two broken assertions in tests/cli/test_planning.py:239-240,254 are fixed, the page-multiple validation the description promises is actually implemented (or the claim and docs corrected to say a misaligned target fails at load), and demand_pages uses prepared_context. The hint/body-limit/help notes and the missing ceiling measurement are worth one revision of the description and one line of docs; none of them touch the design, which is well placed, general, and a no-op by default.