device: applegpu_g14s  |  34 GB RAM (26.2 GB reclaimable now), 22.9 GB Metal working set
model:  48 layers x 512 experts x 2.76 MB (24576 records = 67.9 GB streamed from SSD)
weights: present by size, 105.3 GB at ~/.slotstream/models/qwen38-flash-next-mlx-4bit (run pull --verify for hashes)

slotstream memory plan (--memory-gb)
  device: 34 GB RAM (26.1 GB reclaimable now), 22.9 GB Metal working set
  target: 10.0 GB total process budget, not a RAM usage goal
  cache:  ~17 of 512 experts per layer  (834 global slots = 2.3 GB pool)
  plan:   ~9.0 GB full-workload envelope, ~3 tok/s warm decode (est. from M5 Pro anchors)
  memory: 2.3 GB expert cache at load; 6.7 GB allowed for runtime, context and workspace; 1.0 GB budget headroom. Short requests can use less.
  disk:   that estimate assumes an SSD like the one it was measured on (17.3 GB/s). A base-storage Mac mini M2 reads 1.5 GB/s and decoded at 1.41 tok/s against a ~4 estimate, so on base storage expect well under the number above — see docs/HARDWARE.md
  prefill: 256 tokens per pass (~85 tok/s here; costs ~0.3 GB of the target)
  mtp:    draft head on — speculative decode; its experts stream through a 64-expert cache (0.4 GB resident, charged above)
  vision: images accepted — first image reserves +0.9 GB inside the target; refused if it cannot fit
  context: up to 32768 tokens per request (prompt + reply); a full-length prompt takes ~6.4 min before its first token here, follow-up turns read only what is new
  reuse:  up to 11975 tokens across 4 conversations (~0.7 GB), so a follow-up turn re-prefills only what is new
memory-feasible window: 52224 tokens; separate from the 30.0-minute request-to-first-token policy

context window: automatic, 32768 tokens on this machine's memory tier. Auto takes the largest
window that keeps speculative decoding, retains one complete conversation, and adds at most 10%
to the estimated time of a 2000-token prompt with a 400-token reply:
Cache reductions above the measured decode range are declined, even when the estimate is flat.
   window   experts/layer   draft   lookahead    pass   typical request   full-window wait
    32768          17/512      on         off     256    138.6 s (+0.0%)   ~6.4 min   <- auto
    65536   does not fit with one complete conversation retained
   131072   does not fit with one complete conversation retained
   262144   does not fit with one complete conversation retained
  --max-context N chooses any window up to 262144. A larger window costs memory and
  reading time; it does not guarantee answer quality over very long context.

memory controls (with none, auto is the default):
  --memory-limit-gb G     adaptive ceiling; cache shrinks and recovers within it
  --memory-gb G           total process budget with a fixed cache
  --experts-per-layer N   precise: cache N of 512 per layer (pool = N x 0.133 GB)
  --pool-gb G             raw pool size (1 GB = 7.5 experts/layer)
Use the adaptive ceiling alone. Among fixed controls, experts-per-layer
takes precedence over pool-gb, then memory-gb.
min ~13/layer = 8.1 GB total. The pool is one global cache shared across
all layers -- per-layer is the unit of intuition (a token activates 10
of its 512 per layer), not a quota: hot layers borrow slots from cold.

what a memory target buys (conservative warm-decode estimate from
measured M5 Pro anchors: 30/layer = 6.0, 150/layer = 11.6; the last
column is the wait before the first token of a prompt filling the
whole context, follow-up turns read only what is new):
  target     experts/layer  est. warm decode   pass    full 32768-token prompt
     8.1 GB         13/512      ~ 3 tok/s     256   ~6.4 min
    10.0 GB         17/512      ~ 3 tok/s     256   ~6.4 min
    12.0 GB         28/512      ~ 6 tok/s     512   ~4.4 min
    16.0 GB         51/512      ~ 7 tok/s    1024   ~3.3 min
    24.0 GB   above this Mac's 22.9 GB Metal working set
    28.0 GB   above this Mac's 22.9 GB Metal working set
    36.0 GB   above this Mac's 22.9 GB Metal working set
    48.0 GB   above this Mac's 22.9 GB Metal working set
    73.0 GB   above this Mac's 22.9 GB Metal working set

time to first token at this plan, by prompt length (the pass shrinks past ~4k
tokens so its transient memory stays inside what was measured):
  2k ~24 s · 8k ~1.6 min · 16k ~3.2 min · 32k ~6.4 min (the cap)
  context state is ~27 KiB per token, up to the model's 262144-token limit.
  `slotstream context-check --tokens N` reads an N-token synthetic prompt on this Mac and
  stops early if reclaimable memory falls below its floor or its time limit passes.
