Loci
Loci — a local, offline coding agent Loci is a fully offline coding agent built on Gemma 4 (E2B).
Core trick
Runs generated single-file apps in headless Selenium, feeds errors back to local Gemma for rewrites, and stops after two failed attempts.
Tags
Description
Loci — a local, offline coding agent
Loci is a fully offline coding agent built on Gemma 4 (E2B). Describe an app you want — say, tic-tac-toe — and Loci asks the minimum clarifying questions needed, then writes a complete, working single-file app.
Unlike a typical code-generation chatbot, Loci closes the loop itself: it runs the generated code in a real headless browser, checks for errors, and if something's broken, feeds the failure back into the model and rewrites it — no user intervention required. If it can't resolve an issue after two attempts, it stops and explicitly hands the decision back to the user (simplify the feature, or inspect the code directly) rather than looping indefinitely.
Every part of this — generation, execution, testing, and retry — runs entirely on-device, with zero network calls at any point. That makes Loci viable in offline environments, on unreliable connections, or wherever sending code or data to a cloud service isn't acceptable.
Built with Flask, vanilla JS, Selenium for self-testing, and Ollama running Gemma 4 E2B locally, leveraging the model's native speculative decoding for faster on-device inference.
README excerpt
# Loci — Local AI Coding Agent > **An autonomous coding agent that understands, modifies, tests, and improves software projects — locally.** Loci is a **local-first AI coding agent** built to bring autonomous software development directly to the developer's machine. Instead of only generating code or suggesting fixes, Loci follows a complete development loop: **Understand → Code → Run → Test → Analyze → Improve** The core intelligence runs locally using **Gemma 4 through Ollama**, while a **Flask-based agent backend** orchestrates project interaction and **Selenium** validates the application through real browser workflows. --- ## Why Loci? Most AI coding assistants depend heavily on cloud-based models and external services. Loci explores a different approach: ### **What if an AI coding agent could reason and operate primarily on the developer's own machine?** Loci is designed around three key principles: - **Local AI** — Run the coding intelligence locally. - **Autonomous Execution** — Move beyond chat and actually work with the project. - **Real Verification** — Test the application instead of assuming generated code works. --- ## What Loci Does Loci is designed to take a developer's task and turn it into an executable development workflow. ### Core Capabilities - 🧠 **Understand** developer requirements and existing project context - 🔍 **Analyze** project structure and source code - 💻 **Generate & modify** project code - ▶️ **Run** the application - 🧪 **Tes