Repository navigation
feat(323): P0 gates measured + P1 — a model on this computer runs an agent - #118
Merged
Merged
Conversation
`yarn models:local-gates` answers each P0 gate against the installed Ollama and prints reproducible JSON: overflow (G1), locality (G2), pull lifecycle (G3), embeddings (G4) and the machine profile (G5). Results for an Apple M3 with 24 GB on Ollama 0.40.5 are committed beside the plan. The plan's decisions are revised from what was measured: the llama.cpp runner truncates silently while the MLX runner ignores num_ctx; prompt_eval_count is exact, so D5 sizes from an exact baseline plus a conservative delta and a one-token exact count; replayed thinking reaches no model; /api/status and /api/tags carry the locality signals; MLX footprint needs process memory, not /api/ps. The call-site inventory moves compaction and the clerk into P1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An `ollama` provider, connected through the credential registry with no required secret and offered only by the local edition, behind an adapter on Ollama's native API: - the context window is the connection's, narrowed to the catalog's and sent on every request; a prompt that might not fit is counted exactly by a one-token evaluation and refused before it is sent, the answer gets what the window leaves, and a response the runtime truncated fails; - JSON rides a tool call where the runner refuses `format` (MLX); - native tool calling follows the measured capability, not a provider list; - a runtime admits `max_parallel` requests across every caller, through a Redis lease keyed by the runtime and a new `StepHandler.admit` that waits before the step starts, without its slot and outside its timeout; - local models get a prefill-sized idle window; - compaction and the clerk resolve a free local default, so a space with only this computer's model can compact and title; - `yarn models:verify-local` measures a build and checks its catalog entry. Gemma 4 26B is the first entry, measured on Ollama 0.40.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every script that runs tsx on a file of the repository goes through scripts/with-stack-env.mjs; the guard test names the two new ones. 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: P0 (feasibility gates, measured) and P1 (one model on this computer runs an agent). The plan doc is updated to say what was built and what is still open.
P0 — measured, not researched
yarn models:local-gates <gate>runs each gate against the installed Ollama and prints JSON you can reproduce. Results for an Apple M3 with 24 GB on Ollama 0.40.5 are indocs/plans/323-p0/apple-m3-24gb.json; plan §9 summarises them. What they changed:num_ctxat all.prompt_eval_countis exact. The count includes any cached prefix; caching only changes the timing. That makes a one-token pre-count nearly free.GET /api/statusreports the cloud-disable setting, and cloud models showremote_hostin/api/tags.truncate: falseis sent./api/psdoes not reflect the context size there.P1 — what it adds
ollamaprovider on Ollama's native/api/chatand/api/embed. It is a credential-registry connection with no required secret, offered only by the local edition: the providers list, credential writes and/catalog/modelsall filter by edition.client.contextWindowFor). A prompt that may not fit is counted exactly by a one-token evaluation, the answer gets what the window leaves, and a prompt that doesn't fit is refused before it is sent. A response the runtime truncated fails instead of answering.format(MLX returns 501). The adapter learns this per model from the runtime's answer.capabilities.functionCallinginstead of a five-provider list.functionCalling: true, onto native tool calls. Their route already accepts tool definitions in the streaming path (models:verify-reasoningexercises it).max_parallel.StepHandler.admit: the step waits before it is started, without its executor slot and outside its timeout. A cancel ends the wait, and a draining executor hands the step back.createByokAiClientFactory(db, admission): titles decline when the runtime is busy, post-run judging waits.ai.local_runtime_lease_renewal.AI_LOCAL_MODEL_IDLE_TIMEOUT_MS) with the agent-turn ceiling.automode takes a free space default, and compaction takes the clerk's model, so a space whose only provider is this computer can compact and title.localprovider as ready with no credential, and the connect dialog can connect a provider that needs no key.yarn models:verify-localmeasures a build (digest, runner, quantisation, runtime version) and exits non-zero when its catalog entry drifts.ollama-gemma4-26b(aliasgemma-local).Verified
admithook, credential config, clerk, check probe and the edition filters.yarn testwith no database (Postgres suites skipped),tsc -b,format:checkand repo-wide lint (0 errors).gemma4:26b): plain text, two parallel native tool calls, streaming with thinking, JSON through the tool fallback after the 501, and a refusal before sending of a prompt the llama.cpp runner would have cut.Not yet run
P1's exit: a Helmsman conversation through the web UI on the dev stack started from this branch, three concurrent sessions, and a long-prompt prefill. To try it:
Gemma 4 26B (this computer)for the tenant.🤖 Generated with Claude Code