okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-ds-out ac306afb2 into f-own-intaff3a132f

main
1.0 KiB19 linesraw
1"""The conversation context a model starts with: 128K on every card, unless the person picks another (owner, 2026-11-01).
2
3One rule for the app (apps/host/src/lib/default-context.ts says the same), the Terminal (`strata launch`, `setup`) and the MCP tools: 128K, or the
4largest size the model offers when that is under 128K. The VRAM tiers that used to lower it on small
5cards are gone; a card that 128K leaves little room on gets a warning, never a lower number (the engine says plainly if it cannot start).
6A Mac keeps its unified-memory rule (strata_control/mac_fit.py), which the owner has not changed.
7"""
8from __future__ import annotations
9
10from typing import Iterable
11
12DEFAULT_CONTEXT = 131072
13
14
15def pick(sizes: Iterable[int] | None = None) -> int:
16    """128K, or the largest of `sizes` under it, or (when every size is longer) the smallest."""
17    have = sorted(int(s) for s in (sizes or ()) if int(s) > 0)
18    under = [s for s in have if s <= DEFAULT_CONTEXT]
19    return under[-1] if under else (have[0] if have else DEFAULT_CONTEXT)