Measure what a local coding model can really get done.
Localgauge is an experimental, standard-library Python and shell harness for measuring local OpenAI-compatible models through both direct HTTP and a coding-agent workflow. It records inference timing, token and cache fields, sandboxed coding-task outcomes, tool failures, and independently verified test results.
It is for people evaluating a local model on hardware they own: model experimenters, Pi coding-agent users, and researchers comparing endpoint overhead with useful coding work. In this document, Pi means the terminal coding-agent CLI, not Raspberry Pi hardware.
This is an experiment, not a benchmark certification.
Measured now: five-way direct/full-agent/lightweight-agent cold and warm inference; request-level timings and cache fields; ten seeded Polyglot coding tasks; a pinned real-task corpus; sandbox and path/privacy protections.
Not yet validated: broad model or hardware generalization, statistically robust task rankings, production worker delegation, or a single score that represents coding ability. Headline comparisons below are fixed samples from the linked evidence, not universal claims.
Six local setups use ten Polyglot tasks; the hosted and hybrid rows use the fixed eight-task subset. Attempt counts differ, and the historical frontier review check expected loader.go:25 while A/B accepted the equivalent finding at loader.go:252, so the rates are samples, not rankings. Quantization details · frontier details · hybrid details
Mean wall time from runner start through model-agent completion and pass rate for the same ten-task and eight-task samples. Failed and timed-out attempts are included; fixture preparation and separate verification are excluded. Frontier expected loader.go:25 while A/B accepted the equivalent finding at loader.go:252, so hosted rows are not like-for-like statistical estimates. Frontier comparison
Five workflows on eight tasks: local-only has 24 historical attempts; frontier-only, A (plan then implement), and B (implement, review, fix) have one per task. Frontier-only expected loader.go:25 while A/B accepted the equivalent finding at loader.go:252. Mode C (local-first, escalate-on-failure) combines the first local attempt with an existing hosted result and was not rerun. Hybrid workflow details
These projects are prior art and useful companions, not targets Localgauge claims to replace.
bench/ — five-way benchmark runner, metric parsers, and the Node fetch preload that captures Pi’s inference requests.profiles/pi-local/ — isolated, reduced Pi profile and wrapper.evals/ — sandboxed coding-task runners and real-task manifests.evals/tasks/go-bugfix-01/ — the small default fixture used by the quick start.evals/tasks/polyglot/ — pinned Polyglot/Exercism fixture selection.evals/tasks/real/ — pinned real-repository task manifests and patches.results/reference/ — committed reference evidence; other results/ paths are your ignored local runs.docs/ — measurement notes and comparisons.machines/ — facts for the reference measurement host.Clone the repository and run the commands below from its root directory:
git clone https://github.com/gambtho/localgauge.git
cd localgauge
Localgauge runs the Pi coding-agent CLI on disposable task fixtures: copies of small coding exercises or pinned repository tasks. Bubblewrap (bwrap) isolates the fixture and verifier, while the Python runner records the model calls and independently checks the resulting patch.
These are the measured and tested versions. Compatibility outside this list is unverified:
212c547febwrap) 0.9.0Install Pi with:
npm install -g --ignore-scripts @earendil-works/pi-coding-agent@1.7.0
This workflow is tested on Linux (including the documented WSL2 reference host). Other operating systems are not covered. Install Node/npm, Bubblewrap, Go, Python, pytest, and the llama CLI with Linux packages or the llama.cpp build instructions. Check that the required tools resolve with python3 --version, node --version, go version, pytest --version, bwrap --version, and llama --version. Test the Linux sandbox once with bwrap --ro-bind / / true; it should exit silently with status 0. If that fails because user namespaces are restricted, use a Linux host that permits unprivileged user namespaces or fix that host setting before running tasks.
The Localgauge runners use only the Python standard library. Quantization controls model weight size and quality, --gpu-layers controls how much work moves to the GPU, and --ctx-size reserves token context. If the model does not fit, choose a smaller quantization or context and offload fewer layers; an exact replacement for your hardware cannot be inferred here. The reference machine is an RTX 4060 Ti 16 GB, but an unauthenticated OpenAI-compatible endpoint can also be used.
For llama.cpp, select a model and context size that fit your hardware, then start a loopback server. This is the tested reference model and context; adjust the model, quantization, GPU offload, and cache settings for a different machine:
llama serve -hf unsloth/Inkling-2-Mini-GGUF:UD-Q4_K_M --ctx-size 65536 \
--gpu-layers 999 --cache-type-k q8_0 --cache-type-v q8_0 \
--host 127.0.0.1 --port 8080 --jinja
The runners expect the OpenAI-compatible API at http://127.0.0.1:8080/v1. For the example base URL, the metadata helpers are http://127.0.0.1:8080/health and http://127.0.0.1:8080/props. For another compatible endpoint, set --base-url to its API root and --model to the model name returned or required by that API. If either helper route is absent, pass --context-window N to either runner, where N is the server’s configured context capacity in tokens (not necessarily the model’s advertised maximum).
python3 -m evals.run_task \
--base-url http://127.0.0.1:8080/v1 \
--model 'unsloth/Inkling-2-Mini-GGUF:UD-Q4_K_M' \
--fixture evals/tasks/go-bugfix-01 \
--attempts 1 \
--max-tokens 8192 \
--timeout-seconds 900
Each attempt copies the fixture to a new attempt directory, runs Pi under bwrap, and verifies the result in a separate sandbox. The fixture’s acceptance.json declares protected tests and allowed implementation paths; changing protected content or another out-of-scope path makes acceptance fail. The model’s final text is not used as proof of a pass. This single-task command writes timestamped JSON and Markdown directly under results/; the command prints both paths when it finishes.
python3 -m evals.run_suite \
--base-url http://127.0.0.1:8080/v1 \
--model 'unsloth/Inkling-2-Mini-GGUF:UD-Q4_K_M' \
--attempts 3 \
--max-tokens 8192 \
--timeout-seconds 900
With no positional fixtures, this runs all ten pinned Go and Python tasks. To run a subset, list fixture directories after the module name. --max-tokens applies to each Pi model response; --timeout-seconds bounds the Pi attempt, after which separate acceptance verification still runs. The default output directory is results/runs/<timestamp>-<model-slug>/. Ctrl-C keeps finished task results. Resume that same directory with --resume. The fixture list, base URL, model, attempts, token limit, timeout, and optional context window must match the saved suite-run.json:
python3 -m evals.run_suite \
--resume \
--output-dir results/runs/DATE-unsloth-Inkling-2-Mini-GGUF-UD-Q4_K_M \
--base-url http://127.0.0.1:8080/v1 \
--model 'unsloth/Inkling-2-Mini-GGUF:UD-Q4_K_M' \
--attempts 3 \
--max-tokens 8192 \
--timeout-seconds 900
Replace the example --output-dir with the exact directory created by the interrupted run.
Use localgauge delegate when an orchestrator needs a worker result it can parse without trusting the worker’s final message:
./localgauge delegate \
--repo /path/to/committed/repository \
--ref HEAD \
--task 'Fix the parser so malformed records are rejected.' \
--allowed-path src/parser.py \
--test-command 'python3 -m unittest' \
--timeout-seconds 900
A local path uses committed HEAD unless --ref selects another commit; caller working-tree edits are not copied. A Git URL must use public HTTPS and include an explicit --ref. --profile defaults to pi-local, and the model defaults to the standard Caveling server profile. Pass --module-cache /path/to/cache when the repository’s offline test command needs a caller-owned Go module cache.
The command prints one JSON object with files_changed, a binary-safe diff, diff_encoding, worker test runs, tool errors, token and wall-time evidence, and scope.within_allowed_paths. diff_encoding is normally utf-8; base64 marks a localgauge-diff-base64-v1: payload that preserves non-text patch bytes. independent_tests.passed comes from a fresh read-only sandbox test rerun after files outside the allowed paths have been restored from the pre-worker baseline. Require that result and the scope result before applying the diff. Real-task manifests still own hidden patches, mutant checks, structured reviews, and recovery-event checks; a generic test command is not a replacement for that stronger acceptance.
For a suite run, start with summary.md. It reports the pass rate by language and task plus failure categories; summary.json contains the same data for programs. Each suite task also has a JSON evidence file and a per-attempt Markdown table. For a single-task run, open the timestamped Markdown path printed by the command; there is no generic summary.md at the root. Task JSON includes settings, Pi settlement state, needed_intervention, intervention_reasons, Pi tool-call counts, request counts, prompt/cached/generated token counts, wall time, and verification.pass. needed_intervention records a detected condition; it does not mean a person actually intervened.
agent_settled is true for Pi’s documented final agent_settled event with no abort, false for an observed abort, and unknown when Pi exits normally without that event. needed_intervention is true for observed reasons such as abort, timeout, eight identical consecutive tool calls (tool_loop), invalid event output, model give-up, or a nonzero Pi exit. An unknown settlement state alone is not an intervention. Wall time is in seconds, token fields are counts, and verification.pass is the acceptance result.
For an apples-to-apples task score comparison, use the same ten fixtures, --max-tokens 8192, and three attempts. The highlighted reference uses caveman-so/caveling-2-mini-GGUF:Q4_K_M at 65,536 context and passed 24/30 attempts on the 16 GB reference machine; its complete server settings and caveats are in the quantization comparison, with raw evidence under results/reference/. This is a comparison of observed scores on those tasks, not proof that one model is better: quantization, accelerator, drivers, KV-cache settings, endpoint, and timeouts can all change the outcome. The command above starts the Inkling reference model, so it will produce an independent run rather than reproduce the Caveling score.
New runs under results/ are ignored by Git. Committed measurements moved to results/reference/ and are documented in results/README.md. Links from the measurement notes point to that reference folder so a newcomer can distinguish published evidence from their own runs.
The reduced Pi profile is available directly:
profiles/pi-local/pi-local -p \
"What is the difference between a Go slice and an array? Answer in three sentences."
The five-way endpoint/profile benchmark remains available as python3 -m bench.run --help. It records direct HTTP, full Pi cold, full Pi warm, reduced Pi cold, and reduced Pi warm results.
Real-world task validation confirms that each pinned start state fails and its committed reference patch passes without contacting a model:
python3 -m evals.validate_real_tasks --cache-dir /path/to/scratch
python3 -m evals.validate_real_tasks --cache-dir /path/to/scratch --cache-only
A model run can reuse the validated cache:
python3 -m evals.run_task \
--fixture evals/tasks/real/bugfix-intelligence-json/task.json \
--cache-dir /path/to/scratch \
--cache-only
See evals/tasks/real/README.md for the pinned-source, hidden-test, review, recovery, and attribution contracts.
All items below are measured samples on the reference machine unless stated otherwise.
caveman-so/caveling-2-mini-GGUF:Q4_K_M) at 64K passed 24/30 attempts (80.0%) while Inkling Q4_K_M at 64K passed 16/30 (53.3%). Caveling had lower generated-token use but higher mean task wall time. Measured: quantization and suite comparison, Caveling suite evidence.The reference machine is an RTX 4060 Ti 16GB, Ryzen 9 5900X, 128 GB DDR4, under WSL2. See reference machine notes for exact server configurations and fit observations. See historical measurements for earlier supplied evidence that is explicitly marked as not reproduced by the current harness.
python3 -m unittest discover
python3 scripts/check_home_paths.py
python3 scripts/check_markdown_links.py
bash -n profiles/pi-local/pi-local
bash -n scripts/pre-push-public-privacy
node --check bench/pi_fetch_capture.cjs
node --check bench/pi_frontier_budget.cjs
The optional real-task integration gate points the test suite at the same pre-fetched cache with a test-only environment variable:
MODEL_REAL_TASK_CACHE=/path/to/scratch python3 -m unittest discover
LOCALGAUGE_REAL_TASK_SOURCE_URL and --cache-dir configure the validator CLI. MODEL_REAL_TASK_CACHE is the exact, test-only environment variable retained by the existing optional unit-test gate; it is not a typo for the Localgauge CLI variable.
CI runs the checks on each pull request and on main.
Use a fresh branch, preserve measurement provenance, and add focused tests for serialization or verification changes. See CONTRIBUTING.md, including the opt-in private-term pre-push hook.
Do not commit credentials, private denylist entries, machine identities, or absolute home paths. For a suspected credential exposure or security issue, do not open a public issue; contact the repository owner through a private GitHub channel with the affected revision and file. Public bug reports should contain only reproducible, non-sensitive details.
Localgauge is available under the MIT License. Copyright 2026 Thomas Gamble.
Thanks to elboaf for early support and testing, and for suggesting the web UI.