Repository navigation
feat(323): P3a — a local model's window is sized from the machine it runs on - #120
Merged
Merged
Conversation
A model on the operator's machine costs its weights plus a constant per context token, and on the MLX runner its cache climbs to the whole window and stays there until it unloads (measured, §9 G6). Past the GPU working set it does not fail; it spills, and every request slows. - `models:verify-local` measures each build's footprint (weights, cost per token) and checks the catalog entry against it; Gemma 4 26B is 16.15 GB and about 120 KB a token at the q8_0 cache type; - the host executor reads the GPU working set once through Metal (or nvidia-smi), caches it, and publishes it in its inventory; - `localModelFit` answers fits / tight / does not fit / unknown for a model, a machine and a window; - a connection that sets no window gets, per model, the largest that fits, never below the 32K the platform's agents need; a configured window is used as set; - the AI executor and the API server's clients size the same window, and readiness reports the fit beside each role's model. On the 24 GB machine Gemma fits 16K, below Helmsman's ~18K first prompt, so it runs at 32K and says it will spill; a 64 GB machine gets its full 256K. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sewhere - readiness asks the runtime what it has loaded, so each role on a model on this computer shows whether it is loaded and at what size beside the GPU working set: a model spilling because it holds every conversation's cache says so; - Load now (at the window requests will use) and Unload, through operator-only routes refused outside the local edition — loading is the operator's act, never a side effect of picking a model; - `gpu_memory_gb` on the Ollama connection sizes windows for a runtime on another machine; this machine's inventory is never applied to one elsewhere, and the server, executor and readiness resolve the runtime and its machine by one rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan 323 P3a: each model's context window is now sized from the machine it runs on, and the operator can see and manage what a local model is holding. Follows #118.
Why
On the 24 GB M3, Helmsman on Gemma 4 26B worked but was slow. The cause was measured (plan §9 G6):
The fixed 32K default context window was too large for this machine and too small for a big one.
What changes
localModelFit) answers fits / tight / does not fit / unknown for a model, a machine and a window.nvidia-smion Linux), caches it in~/.aflow/machine.json, and publishes it in its inventory. The AI executor, titles and judges all size the same window.yarn models:verify-localmeasures each model's memory footprint and fails on drift. Gemma's entry passes at 16.15 GB and 120,469 bytes per token.gpu_memory_gbfield sizes its windows. This machine's figures are never applied to a runtime elsewhere.Verified
yarn testwith no database (16,142 passed; the one failure is the shared-Redis test below),tsc -b, the UI typecheck,format:check, and repo-wide lint with 0 errors.Not yet run
The dev stack on this branch. This means the host executor publishing the machine, the note and the Load/Unload buttons in the UI, and a Helmsman conversation at the automatic window. Once this branch is merged into
live, open Models & reasoning and look under the role on Gemma.Notes
streamRetention.test.ts› "never lets consumer hygiene delete a consumer…" runs consumer cleanup across every stream on this machine's shared Redis, the running dev stack's included. It can fail while a stack runs, and it briefly removes that stack's idle consumers, which re-register on their next read. It's unrelated to this branch and worth its own fix.🤖 Generated with Claude Code