local-engineer

module
v0.0.0-...-0cceabf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: Apache-2.0

README

Local Engineer

A local coding agent engineered for 8 GB GPUs, with verification built into the workflow.

CI

Local Engineer investigates repositories, plans scoped changes, edits code, and runs verification on your machine. A Go supervisor surrounds local inference with a code graph, bounded tools, persistent evidence, and a human approval gate.

The reference configuration targets an 8 GB NVIDIA GPU and 64 GB system RAM. It runs Ternary Bonsai 2 27B, PTQ1_0 for the structured phases and Qwen3-Coder-30B-A3B, Q4_K_M for editing, one at a time, through PrismML's llama.cpp fork. The engineering goal is useful repository work on consumer hardware: spend the GPU budget on generating a change; let software handle lookup, permissions, state, and checks.

Get started · The 8 GB stack · Architecture · Verification · Trust boundaries · Measurements · Documentation

Pre-1.0. The task pipeline is implemented. The current reference model has been measured on an RTX 4060 Laptop GPU; broad task effectiveness on this stack is not yet established. Historical task evaluations use a different model and include false acceptances. Passing checks is evidence, not proof of correctness.

Why an 8 GB budget changes the design

Running a coding model is only one part of running a coding agent. Repository search, long conversations, repeated prompt ingestion, verification tools, and competing inference processes all consume resources. A model that fits can still produce a slow or unreliable workflow.

Local Engineer gives the model smaller, explicit problems:

  • Find relevant code: SQLite FTS5, typed relationships, signature inspection, and targeted file reads support localization. The repository stays on disk.
  • Describe a bounded change: a structured plan names exact writable files, tests, risks, and affected consumers. Code validates it before editing.
  • Act through a small tool surface: reads, exact edits, searches, impact queries, and predefined verification recipes. The native agent has no shell tool.
  • Use observable feedback: compiler errors, test failures, scope violations, and review findings feed bounded repair attempts.
  • Carry state outside the conversation: a SQLite journal and persisted workflow state retain what ran, what changed, and what remains uncertain.

This is how the system seeks capability through architecture. It does not make a local model equivalent to a frontier model, and the graph's benefit still needs stronger experimental evidence. Read the design argument.

What you can do

Ask for a bounded bug fix with a regression test, change a function signature and investigate its consumers, or inspect configuration and service relationships. You can also index a repository, query impact, and verify existing changes without running inference.

For example, in a repository with these paths:

le task create \
  --title "Check login and refresh-token handling for bugs. Fix the identified issue, add a regression test, and verify the authentication flow." \
  --scope "internal/auth/**,internal/handler/auth.go" \
  --verify standard
le task run <task-id> --diff

The request is an example of a task, not a published success result. Narrowing a large audit to one demonstrable defect usually gives a clearer completion criterion.

Go has compiler-backed analysis. TypeScript adds compiler relationships through a Node sidecar; Python can add SCIP indexing. Rust tree-sitter support, SQL, protobuf/Avro, deployment manifests, Terraform, and git history extend the repository view with different levels of evidence. Language coverage and limits.

The 8 GB stack

Component Job Resource placement
Ternary Bonsai 2 27B — PTQ1_0 Localization, planning, and a fresh-context review Local llama-server; every layer resident on the GPU, 32,768-token context, Q8 KV cache
Qwen3-Coder-30B-A3B — Q4_K_M Editing only (the coding role) Same endpoint, swapped in for EDIT; 18.6 GB does not fit 8 GiB, so most layers run on the CPU at -ngl 14
Deterministic Go subsystems Indexing, scope enforcement, workflow state, verification, evidence CPU, system RAM, SQLite, repository toolchains
TypeSafe Jev — jev-1.13.0 (optional) Typed relevance and workflow judgments Hosted API; off by default; no local model allocation
Qwen3-Embedding-0.6B — Q8_0 (experimental) Embedding-cosine evaluation control CPU-only reference service; not used by ordinary task retrieval

Bonsai's language-model file is 5.95 GB on disk. That is not its total runtime VRAM requirement: KV cache, compute buffers, runtime overhead, and your desktop also need memory. PTQ1_0 uses the Prism runtime's ternary kernels; the stock llama.cpp binary in the shipped CUDA image is not the documented Bonsai runtime.

The card holds one generator at a time, so both are managed providers sharing a single process slot: a request for the model that is not resident stops the resident one and starts the other. Editing therefore costs a model swap and runs at roughly 7 tokens/s against Bonsai's 27 — accepted deliberately, because in a seeded replay Bonsai drove the edit loop to zero edits while Qwen3-Coder edited and verified. Neither solved that task; the observation is about tool-loop behaviour, not correctness. What was measured, and its limits.

The local workflow needs no hosted inference account. Enabling Jev explicitly sends permitted repository-derived information to TypeSafe. The code and vendor call it Jev, not GEV. It returns typed probabilities; it neither writes the patch nor supplies a passing test result. Exact models, roles, and evidence · Jev's integration.

How a task works

flowchart TD
    A["Request + operator scope"] --> B["INTAKE: freeze checks, inspect baseline"]
    B --> C["LOCALIZE: repository map, symbols, targeted bodies"]
    C --> D["IMPACT: consumers and obligations"]
    D --> E["PLAN: validate exact file grants and checks"]
    E --> F["EDIT: local model + mediated tools"]
    F --> G["VERIFY: sandboxed commands + candidate-bound evidence"]
    G -->|failed checks| F
    G -->|checks satisfied| H["REVIEW: fresh-context model review"]
    H -->|findings| F
    H --> I["FINALIZE: human gate, then task-branch commit"]

Other bounded transitions can re-localize or re-plan. Exhausted budgets, unavailable prerequisites, and uncertain recovery stop the task with an inspectable state.

The model's done call cannot accept its own work. The supervisor checks verification results, scope, and candidate identity. Model review is an additional fallible gate: it can request repairs; it cannot turn failed checks into passes. Final approval commits on the task branch. Applying that commit to your branch is a separate git operation. Verification contract.

Get started

The reference path is Linux x86-64 + NVIDIA CUDA, with host inference and the native le CLI. Install Go 1.26.8, a C compiler, git, and ripgrep first.

git clone https://github.com/akynte/local-engineer.git
cd local-engineer
make build
export PATH="$PWD/bin:$PATH"
export LE_DATA="$HOME/.local/share/local-engineer"
le config init

Then follow the 8 GB installation guide for the pinned Prism runtime, exact GGUF download, checksum, and two configuration files. Setup currently includes a runtime build and model download; it is not a one-command installation. Host mode also has a narrower isolation boundary than a container.

Once the model server is running, use a clean, committed repository with its dependencies already available:

cd /path/to/your/repository
le workspace init
le index
le models health
le doctor
le task create --title "Fix the failing parser test without changing its expected behavior" \
  --scope "internal/parser/**" --verify standard
le task run <task-id> --diff

Replace the paths and task with ones that exist in your repository. Read le doctor warnings; exit codes are 0 for clean, 1 for warnings, and 2 for failures. If work reaches a gate, inspect it with le gate list and le gate show <gate-id>, approve explicitly, then le task retry <task-id>.

For a self-contained example, use the first coding task tutorial. For editor integration, see OpenCode and MCP; editor-driven sessions have a different working-tree boundary.

Hardware and measured performance

Reference observation, 2026-09-21 Value
GPU RTX 4060 Laptop, 8,188 MiB
Host Intel i7-13620H, 64 GB installed RAM
Model / server Bonsai PTQ1_0 / Prism llama.cpp 1a07bfa5
Context / concurrent server slots 32,768 / 1
Prompt processing / generation 264.4 / 27.7 tokens/s
Highest post-request whole-device memory sample 7,691 MiB

Three synthetic requests; approximately 2K prompt tokens and a 256-token output cap, with thinking disabled. These are server throughput observations, not coding task timings, continuous peak-memory measurements, or a success rate. Raw data, flags, caveats, reproduction.

The 8 GB runtime guide explains RAM, disk, context budgets, caching, process ownership, and untested hardware. The benchmark index keeps older Qwen/MoE task results separate from the current Bonsai measurement.

When a task stops

A task stops for reasons unrelated to the code it was changing: a wall-clock budget expires, an operator interrupts, a deadline fires. Three things have to be true at once, and the obvious implementation of the first breaks the second.

Work stops. The task's context reaches the subprocesses an evaluation runs — git clone, docker run, docker exec, the Python interpreter — through exec.CommandContext, rather than leaving a clone cloning and a container sleeping while only the Go code gives up.

Cleanup still runs. If that same context reached docker stop, every cancelled run would leak the container it started. Cleanup detaches from the cancellation and keeps a 30-second ceiling of its own, so stopping the work does not mean abandoning it.

The evidence survives. The record explaining why a task stopped is most useful at exactly the moment the budget kills everything else, so the final write detaches too — under a bound matching the ledger's, because a diagnostic must never be able to hang the thing it is observing. Budget exhaustion now says so by name instead of surfacing as whatever call happened to be in flight.

Evaluation writes that leave the tool's own directory are resolved through every symlink and refused if they land outside the run root. That is a check on those writes, not a general filesystem sandbox. How cancellation, cleanup and evidence fit together.

Safety and limits

Native edits happen in a separate task worktree, with path and policy checks. Verification runs repository code under the available sandbox. Evidence is stored by content hash; verification itself runs on a writable worktree, not an immutable snapshot.

Container mounts, Landlock, and optional bubblewrap provide different boundaries. Landlock alone is not complete network isolation. The HTTP API has no built-in authentication and should remain on loopback. Treat the supervisor, runtime, toolchains, and verification configuration as trusted. Security boundaries · Report a vulnerability.

The current limits include multi-minute reasoning calls, incomplete language relationships, manual setup, and no representative success-rate result for Bonsai. GPU serialization is local to a le process; it cannot stop another program consuming VRAM. Full limitations.

Contribute

The most useful contributions improve this coherent 8 GB system: reproducible hardware reports, real regression tasks, analyzer correctness, verification coverage, and installation reliability. Development and contribution guide.

Star the repository to follow the runtime work and upcoming reproducible end-to-end evaluations. If you try it on an 8 GB GPU, a report with the exact runtime, checks, timings, and failure cases is especially valuable.

License and acknowledgements

Apache-2.0. Built with Go, SQLite, llama.cpp, tree-sitter, compiler tooling, Linux sandboxing, and Docker. The reference models come from Prism ML, Qwen, and, for optional hosted judgments, TypeSafe.

Directories

Path Synopsis
cmd
le command
Command le is the local-engineer supervisor and CLI.
Command le is the local-engineer supervisor and CLI.
internal
acp
Package acp is the ACP-over-TCP bridge of design v3 §4.3 and §4.1.
Package acp is the ACP-over-TCP bridge of design v3 §4.3 and §4.1.
analyzers/architecture
Package architecture reads the layer annotations §3.2 names as a source of truth: "layer annotations from ARCHITECTURE.md | resolved plus declared".
Package architecture reads the layer annotations §3.2 names as a source of truth: "layer annotations from ARCHITECTURE.md | resolved plus declared".
analyzers/deploy
Package deploy contributes the deployment, build and infrastructure rows of design v3 §3.2: compose and Kubernetes manifests, Dockerfiles and Makefiles.
Package deploy contributes the deployment, build and infrastructure rows of design v3 §3.2: compose and Kubernetes manifests, Dockerfiles and Makefiles.
analyzers/gitlog
Package gitlog contributes the commit-history row of design v3 §3.2: "commit to file and symbol | git log -L, blame | observed".
Package gitlog contributes the commit-history row of design v3 §3.2: "commit to file and symbol | git log -L, blame | observed".
analyzers/golang
Package golang is the Go language analyzer (design v3 §3.2).
Package golang is the Go language analyzer (design v3 §3.2).
analyzers/protoavro
Package protoavro contributes the proto and Avro half of design v3 §3.2's "schema to application code" row.
Package protoavro contributes the proto and Avro half of design v3 §3.2's "schema to application code" row.
analyzers/python
Package python gives a Python repository the same kind of graph a Go one gets: modules, classes, functions, methods, definitions, references, imports and inheritance, with real source ranges and cross-file edges.
Package python gives a Python repository the same kind of graph a Go one gets: modules, classes, functions, methods, definitions, references, imports and inheritance, with real source ranges and cross-file edges.
analyzers/sql
Package sql contributes the schema row of design v3 §3.2: "schema to application code | pg_query_go on migrations and embedded SQL | resolved for parsed SQL, inferred for dynamic SQL".
Package sql contributes the schema row of design v3 §3.2: "schema to application code | pg_query_go on migrations and embedded SQL | resolved for parsed SQL, inferred for dynamic SQL".
analyzers/terraform
Package terraform contributes the infrastructure row of design v3 §3.2: "infrastructure resource to application component | Terraform (HCL parser) and manifests linked by names and env references | declared plus inferred".
Package terraform contributes the infrastructure row of design v3 §3.2: "infrastructure resource to application component | Terraform (HCL parser) and manifests linked by names and env references | declared plus inferred".
analyzers/typescript
Package typescript contributes the TypeScript row of design v3 §3.2.
Package typescript contributes the TypeScript row of design v3 §3.2.
api
Package api serves the supervisor HTTP surface of design v3 §4.3, child 3: the supervisor API, the dashboard and the ACP bridge.
Package api serves the supervisor HTTP surface of design v3 §4.3, child 3: the supervisor API, the dashboard and the ACP bridge.
artifacts
Package artifacts is the content-addressed artifact store of design v3 §2.2: test output, diffs and screenshots under `workspaces/<id>/artifacts/<sha256>`.
Package artifacts is the content-addressed artifact store of design v3 §2.2: test output, diffs and screenshots under `workspaces/<id>/artifacts/<sha256>`.
broker
Package broker implements the human gates of design v3 §3.3: the points where a decision leaves the system and waits for a person.
Package broker implements the human gates of design v3 §3.3: the points where a decision leaves the system and waits for a person.
cache
Package cache implements the per-workspace cache of design v3 §2.2: "Keyed by workspace and content manifest; never shared."
Package cache implements the per-workspace cache of design v3 §2.2: "Keyed by workspace and content manifest; never shared."
config
Package config loads the operator-facing configuration of design v3 §5.2: le.yaml, providers.yaml and the hardware profiles.
Package config loads the operator-facing configuration of design v3 §5.2: le.yaml, providers.yaml and the hardware profiles.
contextpack
Package contextpack assembles every model request as a frozen prefix, an append-only log and a small tail (architecture review §7).
Package contextpack assembles every model request as a frozen prefix, an append-only log and a small tail (architecture review §7).
critic
Package critic holds the three model calls that happen outside the editing conversation (design v3 §10.1).
Package critic holds the three model calls that happen outside the editing conversation (design v3 §10.1).
doctor
Package doctor implements `le doctor` (design v3 §3.4, §4.4, §5.4, §6.1, §9.2).
Package doctor implements `le doctor` (design v3 §3.4, §4.4, §5.4, §6.1, §9.2).
engine
Package engine is the adapter contract for whatever actually edits code (design v3 DR-5).
Package engine is the adapter contract for whatever actually edits code (design v3 DR-5).
engine/native
Package native is the engine that turns a retrieved packet into edits, driving a tool loop against the provider boundary of design v3 §9.1.
Package native is the engine that turns a retrieved packet into edits, driving a tool loop against the provider boundary of design v3 §9.1.
eval
Package eval is the evaluation harness of design v3 §10.2.
Package eval is the evaluation harness of design v3 §10.2.
evidence
Package evidence is the Standard Evidence Suite v1 orchestrator.
Package evidence is the Standard Evidence Suite v1 orchestrator.
graph
Package graph is the typed code-relationship graph of design v3 §3.
Package graph is the typed code-relationship graph of design v3 §3.
index
Package index builds the source index, symbol index, graph and chunks for a workspace (design v3 §2.4, §3.2).
Package index builds the source index, symbol index, graph and chunks for a workspace (design v3 §2.4, §3.2).
judgeval
Package judgeval is the Judgment Validation Campaign.
Package judgeval is the Judgment Validation Campaign.
judgment
Package judgment is the boundary between this system and an external model that answers typed questions rather than generating text.
Package judgment is the boundary between this system and an external model that answers typed questions rather than generating text.
ledger
Package ledger implements the execution journal and recovery procedure of design v3 §7.
Package ledger implements the execution journal and recovery procedure of design v3 §7.
llm
Package llm is the provider boundary of design v3 §9.1 and DR-4.
Package llm is the provider boundary of design v3 §9.1 and DR-4.
lsp
Package lsp is a small Language Server Protocol client, written rather than taken as a dependency (architecture review §16).
Package lsp is a small Language Server Protocol client, written rather than taken as a dependency (architecture review §16).
mcp
Package mcp exposes Local Engineer to an MCP client such as OpenCode.
Package mcp exposes Local Engineer to an MCP client such as OpenCode.
memory
Package memory is the durable external memory of design v3 §8.2, split into intent, observation and advice.
Package memory is the durable external memory of design v3 §8.2, split into intent, observation and advice.
models
Package models implements `le models bench` (design v3 §9.2): it measures a provider on this machine and turns the measurement into a hardware profile.
Package models implements `le models bench` (design v3 §9.2): it measures a provider on this machine and turns the measurement into a hardware profile.
opencode
Package opencode wires Local Engineer into an OpenCode session without the developer having to think about it.
Package opencode wires Local Engineer into an OpenCode session without the developer having to think about it.
policy
Package policy loads the operator's repository-wide rules (design v3 §1.2, §5.2, §6.2).
Package policy loads the operator's repository-wide rules (design v3 §1.2, §5.2, §6.2).
procman
Package procman supervises the long-lived children of the single container (design v3 §4.3).
Package procman supervises the long-lived children of the single container (design v3 §4.3).
proxy
Package proxy is the allowlisting egress proxy of design v3 §6.1.
Package proxy is the allowlisting egress proxy of design v3 §6.1.
recipe
Package recipe runs the deterministic verification loops of design v3 §10.1: "Compiler, vet, lint, test, race feedback loops | most first-attempt errors | seconds per loop | adopted; the core."
Package recipe runs the deterministic verification loops of design v3 §10.1: "Compiler, vet, lint, test, race feedback loops | most first-attempt errors | seconds per loop | adopted; the core."
retrieval
Package retrieval implements the lexical-anchors-then-graph-expansion order of design v3 §8.2 and the slice provenance contract of §2.3.
Package retrieval implements the lexical-anchors-then-graph-expansion order of design v3 §8.2 and the slice provenance contract of §2.3.
sandbox
Package sandbox implements the layered isolation of design v3 §6 and DR-3.
Package sandbox implements the layered isolation of design v3 §6 and DR-3.
sandbox/bwrap
Package bwrap implements the optional bubblewrap layer of design v3 §6.1, layer 3, and DR-3.
Package bwrap implements the optional bubblewrap layer of design v3 §6.1, layer 3, and DR-3.
sandbox/container
Package container runs a command inside a pinned container image.
Package container runs a command inside a pinned container image.
sandbox/landlock
Package landlock implements the per-task Landlock layer of design v3 §6.1, layer 2, and DR-3.
Package landlock implements the per-task Landlock layer of design v3 §6.1, layer 2, and DR-3.
scipindex
Package scipindex imports compiler-produced SCIP cross references into the workspace index.
Package scipindex imports compiler-produced SCIP cross references into the workspace index.
session
Package session binds a caller to one workspace's storage.
Package session binds a caller to one workspace's storage.
store
Package store is the single entry point for all persistence (design v3 §13).
Package store is the single entry point for all persistence (design v3 §13).
supervisor
Package supervisor assembles the task runner that governs a piece of work.
Package supervisor assembles the task runner that governs a piece of work.
task
Package task implements the task lifecycle and the completion contract.
Package task implements the task lifecycle and the completion contract.
telemetry
Package telemetry records counters and timings for one workspace (design v3 §5.2).
Package telemetry records counters and timings for one workspace (design v3 §5.2).
treesitter
Package treesitter is the language-agnostic structure layer of the architecture review's §4 diagram and §6.1 item 2.
Package treesitter is the language-agnostic structure layer of the architecture review's §4 diagram and §6.1 item 2.
trust
Package trust separates the instructions the supervisor issues from the repository content it shows the model.
Package trust separates the instructions the supervisor issues from the repository content it shows the model.
version
Package version carries build identity stamped in at link time.
Package version carries build identity stamped in at link time.
workflow
Package workflow defines the persisted architecture-review phase contract.
Package workflow defines the persisted architecture-review phase contract.
workspace
Package workspace implements the unit of isolation (design v3 §2).
Package workspace implements the unit of isolation (design v3 §2).
worktree
Package worktree manages the per-task checkouts a task edits in.
Package worktree manages the per-task checkouts a task edits in.
Package profiles embeds the shipped hardware profiles (design v3 §9.2) into the binary.
Package profiles embeds the shipped hardware profiles (design v3 §9.2) into the binary.
Package prompts embeds the prompts that decide how the engine behaves (design v3 §1.2).
Package prompts embeds the prompts that decide how the engine behaves (design v3 §1.2).
tools
analyzers/storescope
Package storescope implements the custom go/analysis analyzer required by design v3 §2.3:
Package storescope implements the custom go/analysis analyzer required by design v3 §2.3:
analyzers/storescope/cmd/storescope command
Command storescope runs the storescope analyzer as a standalone vet tool.
Command storescope runs the storescope analyzer as a standalone vet tool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL