LocalForge
A local chat and coding workspace built around a difficult boundary: letting a model propose useful work while keeping changes reviewable.
View on GitHub
The engineering problem
LocalForge connects local Ollama models to a desktop workspace. The challenge is turning a model’s output into predictable actions: inspecting files, proposing edits, handling failures, and keeping a clear record of what actually happened.
Handling different model capabilities
Models do not all support tools in the same way. LocalForge checks runtime capability metadata rather than assuming behavior from a model’s name. It uses native tool calls when supported and a strict JSON fallback otherwise. Two malformed fallback responses disable agent mode for that model for the session while leaving chat available. Arbitrary prose is never executed.
An approval has to match the actual change
Each proposed edit shows a before-and-after diff. Proposals are stored in the native layer, tied to the selected workspace, and checked against the file again before applying. If another program changes the file after review, the proposal becomes invalid. Accept All covers only the proposals currently visible; it does not approve future edits.
Working within a context budget
Large files and tool results can overwhelm a local model’s context window. LocalForge bounds outgoing context, marks excerpts, and keeps tool calls paired with their results. Older completed edits can become historical records with their actual outcomes, while executable arguments and approved changes remain intact. This avoids treating an incomplete exchange as completed work.
Keeping chat and project actions separate
Chat mode has no workspace file or terminal tools, even with a project selected. Code Agent mode explicitly exposes those tools. File tools stay within the selected canonical workspace and reject traversal and symlinks. Terminal programs run with the user’s macOS permissions, so command approval remains a separate boundary rather than a claim of operating-system isolation.
Verification and its limits
The repository documents deterministic agent tests, native tests using temporary files, and live Ollama verification. Test doubles exercise retries and protocol failures; they do not prove a model can solve a task. The live verification separately exercised a disposable broken project. Read the verification report ↗.