Files
alzeo/docs/context-1m.md
T
Hasan BasbunarandClaude Opus 5 719c17b947 docs: the README becomes an entry point, and its numbers are checked against the record
1,045 lines, one door, and the only way to find anything was to scroll. It is 509
now: what this is, the seven targets with their measured headline, how to install
it, what speed and quality to expect, the targets and the switch, the tools, the
cockpit in short, and an index table naming every other file and the question it
answers. Seven sections moved out whole, each to its own file under docs/, each
leaving a summary and a link behind: the 1M context mode, the flash lane, the
cockpit tour, operations and upgrades, the opencode integration, the GB10 memory
trap in full, and where each lane stands against upstream.

The split was checked line by line against the file it came from. Of 1,045 lines,
the only ones with no verbatim equivalent in the new README or in one of those
files are the 32 rewritten on purpose, and each of those is a correction:

- the headline said 65 tok/s for the 27B lane, which is the v1.9 figure. v1.14.0
  measured 71.4 on the release image this lane has served since 2026-09-17, in the
  same campaign that measured 69.8 on the image it replaced. Title, target table
  and speed section now say 71.4 and name the campaign behind each number.
- the memory section read as though the installed fraction were 0.50, which is the
  native-mode and ./run.sh value. The 1m mode has been the default since v1.12.1
  and runs 0.76. Both are stated now, each with its mode.
- the KV pool comparison published three boots against two. The engine journal has
  eleven for that day, six and five: 517,184 to 566,016 against 482,560 to 510,592.
  The ranges still do not overlap, by 6,592 tokens at their closest, but the gap on
  the means is 9.6% and not the 6% published from the subset. README, BENCHMARKS and
  the v1.14.1 entry all carry the full set now.
- two citations pointed at text that is not there: the README claimed a flat-memory
  result was "quoted elsewhere in this README" when it lives in BENCHMARKS.md, and
  keepalive-proxy.py justified its 92% usable share by quoting a README line about a
  178,560-token pool that no longer exists anywhere. Both now name where the number
  actually is. Neither was caused by this release; both survived because nothing
  checks a quoted section title.
- the flash lane's quality is in the README as measured rather than as adjectives:
  GSM8K 97.41% over all 1,319 questions, MMLU 500 at 90.8%, HumanEval 164 pass@1 at
  95.73%, tool calling 15/15 with reasoning off and on, needle 2/2 at 120K and 200K,
  conc-check 40/40 serial and 80/80 at four concurrent.

evals/ ships the two drivers, because two of those numbers could not be reproduced
from this repo. The image's run_eval --eval-name mmlu shells out to an sgl-eval
binary it does not ship, and its HumanEval path needs a package that is not there
and then dies in os.fork against the image's filelock. Six gates hold what makes
them work, with a stub sglang and no network: the score line a caller greps, the
dataset MMLU is measured against, spawn rather than fork, and one sample per task
instead of the harness default of five, which at temperature 0 is the same answer
five times.

ARCHITECTURE.md gains the two directories it did not describe and tools-check.py in
its table of instruments. TESTING.md gains a 2026-09-19 column counted mechanically
on both commits: 34 test files against 20, 587 test functions against 442, 55 CI
steps against 38. docs/flash-lane.md records the one boot in thirteen that died at
CUDA graph capture on 2026-09-18, because a failure that costs twelve minutes and
explains nothing belongs written down even when it happened once.

Local CI: 56 steps, 55 ok, the socket gate failing on this serving box because
other processes cycle ephemeral listeners during the suite, which is the case its
own message describes. Both suites green: 223 and 370.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 12:55:10 +02:00

7.4 KiB

The 1M context mode (27B lanes)

What a plain 27B install serves since v1.12.1: a 1,010,000-token window, what it costs, and how the limits are fitted to the pool your own boot got. Moved out of the README in v1.14.2 so the README could stay an entry point.

Since v1.12.1 this is what a plain 27B install serves. It was opt-in behind an env var until then, which meant the window this whole stack is built around was off for anybody who had not read this page.

curl -fsSL .../get.sh | bash        # 1M, and combines freely with MODEL_CHOICE=uncensored
CONTEXT_MODE=native ./install.sh    # the 262144 window instead

The flash lane and --no-service cannot serve it and stay native with no refusal, because a default must never reject something the operator did not type. A re-run keeps the mode already installed, in both directions: an update does not patch YaRN into the configs of a box that chose native.

This is, as one converging command, the exact preset that serves the reference box daily since 2026-08-22:

  • 1,010,000-token window via YaRN static scaling (factor 4.0, original_max_position_embeddings: 262144) patched into both cached config.json files by patch-yarn.py (target model AND DFlash2 draft, or the draft crashes at load; originals backed up next to them as config.json.pre-yarn), plus --context-length 1010000 and SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1.
  • --mem-fraction-static 0.76 (0.70 before v1.14, see the memory trap): the KV pool is a boot lottery, and the measurement campaigns on this box do not agree. Five boots in the v1.3 era reported 917K-1019K tokens; three around 2026-08-30 reported 863,398, 893,479 and 913,334 for the same checkpoint; four on the official image at 0.76, on 2026-09-17 and 18, reported 902,398, 889,131, 889,722 and 887,797. The ranges do not overlap, so treat 863K as the floor to plan against until a fresh campaign settles it. DFlash2 acceptance is unchanged either way, and a real 690K-token request has been served (cold prefill 40 min, then cached).
  • The limits are fitted to your own boot, automatically. The generated opencode limits below are static, and their 1m worst case (compaction at ~680K plus 200K of output) sits above the 863,398 floor: on an unlucky boot a long session can meet a proxy refusal mid-conversation, which is the field case that produced this tool. Since v1.12.1, install.sh runs oc-fit-limits.py itself at the end of every 1m install, once the engine is up: it reads the pool your boot actually got and rewrites the limits to fit it, up or down. Run it by hand (or press the cockpit's button) after any later reboot you want re-fitted. The FP8 targets ship lower static limits already, because their pool is about 92,000 tokens smaller.
  • The keepalive proxy becomes load-bearing. Every service install ships it (see "opencode integration"), but at 1M it is not optional: a cold 690K-token prefill can keep the wire silent for tens of minutes. The proxy injects the official Anthropic ping event on /v1/messages and an authentic empty chunk on the OpenAI dialect, every 10 s, only at SSE event boundaries (a keepalive inside an event corrupts the JSON, measured); it closes the upstream the moment the client disconnects, and reports an explicit SSE error after 3600 s of true upstream silence (above the worst legitimate prefill). Agent clients must use the proxy port; the direct server port stays for curl and benches.
  • HF_HUB_OFFLINE=1 in the unit, so no Hub metadata check can re-resolve a checkpoint and silently undo the YaRN-patched configs (see Operations).
  • Restart=always: a crash that exits 0 (a Triton compile crash measured 2026-08-22 ended in SystemExit: 0) still gets relaunched; on-failure would not.
  • A corruption tripwire (proxy v6.11). When a decode path loses its state on this hardware it does not stop: it emits runs of token id 0, which is ! in the Qwen tokenizer, and the client reads a wall of exclamation marks as if it were an answer (sglang #36537, #36558, #36806, #36845). The proxy counts those characters across the stream and, past CORRUPTION_RUN of them in a row (128 by default, 0 disables), aborts the generation upstream and sends an explicit corrupted_output error instead. It reads only the delta text it already relays, never tool-call arguments, so a model writing !!! in prose is untouched.
  • No zombie generations (proxy v6.14). A client that gives up leaves the engine decoding unless the abort reaches it in time, and it cannot: abort_request() returns early once the rid has left rid_to_state, which the disconnect itself empties (sglang#35255, merged upstream 2026-09-04 and in neither image this repo serves). Measured here on 2026-09-09: 6,582 state was deleted in TokenizerManager lines in one day, one request decoding 6 min for nobody. The proxy now names every request itself (x-override-rid, which the engine honours because the units pass SGLANG_ENABLE_REQUEST_HEADER_OVERRIDES=1), so a request abandoned during prefill still has a name, and it aborts before closing the socket rather than in a thread racing it. Where no rid can exist, on /v1/messages (the Anthropic route mints its own msg_<uuid> and applies no header overrides), the answer is drained to its end instead of being orphaned. Same request through both proxies: 223 flood lines and a held slot before, 0 after.
  • A tool-schema guard (proxy v6.13). The engine validates every tool's parameters with jsonschema, whose regex format check compiles pattern with Python's re. JSON Schema says pattern is ECMA-262, which has Unicode property escapes (\p{Cc}) that re rejects outright, so a single such tool makes the engine answer 400 to every request of the session (measured 2026-09-09 against Claude Code 2.1.266 and its Artifact tool). The proxy removes only the patterns Python cannot compile, only inside tool parameter schemas, and forwards every other body untouched and unparsed.
  • The generated opencode config switches to context/input 700000, output 200000 (compaction fires at 680000; worst case 880000, under the worst measured pool).

Quality past the native 262144 window is not formally evaluated here: treat it as an experimental preset. Proof it holds up operationally, one continuous opencode session (reasoning effort xhigh, output cap lifted) built a playable 3D zombie FPS from a single prompt by YouTuber Bijan Bowen:

  • 535,361 tokens of context reached in one session, twice the native window, zero compaction
  • ~360K tokens generated, 239 agent steps, 274 tool calls, no retry, no manual rescue
  • Result, single HTML file: https://subway-fps.vercel.app

Back to native: CONTEXT_MODE=native ./install.sh (removes the proxy service and restores the pre-YaRN config.json.pre-yarn originals over the patched target and draft configs; a native server crashes at load on a patched config, so run.sh refuses a patched cache early instead of ten minutes into the boot, and the installer refuses with a re-download fix-it when a backup is gone).

Back to the README