Expand description
2026-09-25: Resolution of the MTP drafter context from the environment: whether
the drafter KV is batch-prefilled over the prompt (prefill) and whether it is
carried across the turns of a session (carry).
Carry depends on prefill. In the model’s trait_impl/speculative.rs a carried
drafter KV is adopted (try_carry_drafter) only inside
if !self.mtp_prefill_hidden.is_null(), and the model allocates that capture
only when drafter.prefill is set (layers::mtp_drafter_prefill_enabled), so
the two are resolved together.
A configured carry is armed only in single-sequence MTP
(mtp_carry::carry_armed).
variable (exactly 1) | result |
|---|---|
| neither | DrafterContext::BOTH |
METRALE_NO_MTP_DRAFTER_CONTEXT | DrafterContext::OFF |
METRALE_MTP_DRAFTER_CONTEXT_PREFILL_ONLY_UNSAFE | prefill on, carry off; warned at startup |
Any other value, 0 included, changes nothing.
Owner: model-layers (MTP drafter). Invariants:
resolvenever returnscarrywithoutprefill.- The kill switch wins over the prefill-only variable.
Structs§
- Drafter
Context - 2026-09-25: Which halves of the drafter context are configured.
resolvenever returnscarrywithoutprefill.
Constants§
- DISABLE_
ENV - 2026-09-25: Kill switch for both halves; only the exact value
1counts. - PREFILL_
ONLY_ ENV - 2026-09-25: Prefill without carry; only the exact value
1counts, andDISABLE_ENVwins over it.
Functions§
- resolve
- 2026-09-25: Resolve the two variables’ values with no environment access, so
the rule is unit-tested (SBIO).
disablewins overprefill_only. - resolve_
from_ env - 2026-09-25: Resolve the policy from the environment.
ModelLevers::from_envcalls it, and the result isModelLevers::drafter. The outcome is logged once per process (REPORTED).