Verdict: worth it with changes — the capability is real, the layer and footprint are right, and every blocker from the closed #454 and my previous review is now addressed. What is left is a genuinely broken new test (it cannot pass), a couple of untested wiring paths, and documentation gaps. Fix those and this should merge.
What the change is now
9 files, +35/−14 plus one new test, entirely in Ignition's Python CLI/planner — no Rust, no per-model branches:
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-137) →limits.max_sequence_tokens(config.rs:148), enforced at admission (helios/src/server/request.rs:350(not opened)) and advertised asmax_model_len(helios/src/server/models.rs:81(not opened)).ignition/planning.py:370-375—Plan.prepared_context= recipe max when no target, elsemin(recipe.context, context_target, self.tokens); stockPlan.context(planning.py:365-368) is untouched.- Wiring:
planning.py:455,461-462,537,593,676;cli/preparation.py:56 (not opened),68;cli/serve.py:206(multi-host),:289;cli/bench.py:177(not opened). - Validations: positive target (
planning.py:461-462), page multiple in__post_init__(planning.py:289-290), and a chunk-vs-context error that distinguishes the default chunk and names--prefill-chunk-size(planning.py:695-700). - Artifacts:
to_dict()key (planning.py:432),--request-contextinreproduction_arguments(rebuild_manifest.py:264-265),context_targetasSCOPE_DEPLOYMENT(rebuild_manifest.py:390). - Docs: capacity/flag table plus both owner rows (
docs/cli-design.md:446,1443,1493). - Test:
tests/cli/test_planning.py:211-265.
Charter mapping
- Goal fit: a capped per-request context is exactly the "long conversations / coding agents on an SM120 workstation or DGX Spark" case the vision names. Measured on one RTX PRO 6000 Blackwell (SM120, 96 GB), Qwen3.8-27B, pinned revision, with commands and a VRAM table — the four required description parts are present.
- Right problem, right layer (#404): the runtime cannot do this.
--kv-cache-limit context|concurrency(helios/src/runtime_core/memory.rs:284-331, defaultmemory,docs/cli-design.md:738) and--memory-limit(memory.rs:238-274) bound the pool; neither can lower the per-request admission ceiling or advertise a smallermax_model_len, because both are baked fromprepared_sequence_tokensat load (config.rs:131-148,helios/src/model.rs:261-273). Honest under-capacity advertising is an export-time decision, which is where this lands. The earlier multi-model rationale (a charter non-goal) is gone from the docs row, so no sign-off question remains. - No per-model branches: one dataclass field with a default, one property, three pass-throughs; nothing recipe-specific.
- Be explicit and pin everything: now satisfied — the setting appears in the printed plan, the embedded preparation manifest and the reproduction command.
- Bring real evidence (#210): solid for the pool effect (~8.2 / ~6.3 / ~4.3 GB per slot; 16 GB freed at concurrency 4). Still missing the measurement only this flag can produce — see gap 5.
Blockers (must fix before merge)
- The new test cannot pass — two independent defects.
tests/cli/test_planning.py:257assertsby_key["context_target"].value.int64_value == 131072. The proto field isint_value(helios/proto/runtime_core.proto:127), so this raisesAttributeError; andrebuild_manifest._preparation_value(rebuild_manifest.py:329-333) emitsuint_valuefor a non-negative int, so the correct assertion isuint_value == 131072.tests/cli/test_planning.py:230-232plans withcontext=500000and expects the clamp.500000 % 64 == 32, so the new page-multiple validation (planning.py:289-290) raisesUsageErrorand the test errors out before reaching the assertion. Use a page-aligned value above the recipe max (e.g.327680or500032). Both are one-line fixes, but as pushed the PR does not pass its own suite.
- Two wiring paths the test does not cover.
common_preparation_kwargsreturningprepared_context(bootstrap.py:58) is the only line that changes the exported core, and the multi-host export path (cli/serve.py:206) was the previous blocker; neither is asserted. Addassert kwargs["context"] == capped.prepared_context(mirroringtests/cli/test_commands.py:88-91) and one assertion that the--ranks > 1plan carries the target.
Should fix
Plan.demand_pagesis uncapped.planning.py:325-326still computesconcurrency * (recipe.context // page_tokens), so the plan's printed/to_dictdemand (planning.py:440) overstates the KV demand of a capped core — the exact number this flag exists to lower. Useprepared_contextthere.- Cap-affected derived values still use the recipe max.
_server_optionssetsmax_body_bytesfromrecipe.contextand tells clients "context is limited by the checkpoint and available cache capacity" (cli/serve.py:68-69); that hint is what users see on a context admission error (helios/src/server/http.rs:59(not opened)). With a cap the hint should name the export cap, andmax_body_bytesshould followmin(recipe.context, prepared_context)or be left deliberately oversized with a comment. Related: a cap also lowers the default output allowance, sincemax_new_tokensdefaults tomax_sequence_tokens(config.rs:210-212) — one sentence in thedocs/cli-design.md:446row. - Evidence still does not show the capability the flag uniquely provides. The table uses
--kv-cache-limit concurrencyfor every column, so it measures the pool, which--kv-cache-limit context/--memory-limitalready move at serve time. 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. That is the claim no runtime knob can reproduce. - The
min(…, self.tokens)clamp bakes export-host VRAM into the artifact.planning.py:375means--request-context 131072can silently prepare less on a fuller GPU. It is legal (the catalog only requiresmax_sequence_tokens <= prepared_sequence_tokensand page alignment,helios/src/model/catalog.rs:48-57) and the description now says it, butto_dict()prints the target, not the effective value; printingprepared_contextnext to it makes the artifact self-describing. - Say the accepted multiple in help.
cli/__init__.py:167-170(not opened) says nothing about the page multiple thatplanning.py:289-290enforces; the neighbouring--prefill-chunk-sizeline states its multiple. Also consider naming the kwargcontext_target=rather thancontext=infit()/plan()(planning.py:455,593), sincePlan.contextkeeps a different meaning; the current naming invites future misuse.
Cost, benefit, alternatives
- Cost: ~35 added lines, one field, one property, three pass-throughs, no runtime or CUDA path, no state/catalog-transition risk; a strict no-op when the flag is omitted (
prepared_contextreturns the recipe max), so existing cores and cached artifacts are unaffected. Maintenance is near zero — the pieces to keep in sync are the three artifact sites, now all covered. - Benefit: for people serving a long-context model on one SM120 card or DGX Spark, the choice between 256K per request and double the concurrency; 16 GB freed at concurrency 4 on Qwen3.8-27B, plus an honestly advertised context. 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 the pool at serve time but cannot change the admission ceiling ormax_model_len, and doing it "without new code" would mean minting variants of each of the thirteen recipes. This is the smallest footprint that reaches the decision point.
Bottom line
Merge after fixing the two broken assertions in tests/cli/test_planning.py:230-232,257, adding the common_preparation_kwargs/multi-host assertions, and using prepared_context in demand_pages (planning.py:325-326). The evidence gap (5) and the hint/body-limit/default-output notes (4) 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.