# localcode

> An open-source coding agent that runs local models on Apple Silicon Macs with no API key.

localcode is an open-source agentic coding tool that bundles a local model server and a coding agent into one command for Apple Silicon Macs. It reads and edits files in a project, runs the repo's own checks, and needs no API key or account. The project is published under Apache 2.0 and is described by its homepage as alpha software under active development.

## What It Is

localcode is a terminal-based coding agent that runs models locally. After installing with pip and running `localcode` inside a repository, it checks the Mac's unified memory, lists the models that fit, and recommends the most capable one. It downloads the chosen quant from Hugging Face, starts llama-server on 127.0.0.1, sets context and KV cache sizes for the machine, and shuts the server down when the session ends.

## What the Agent Does

The agent reads and edits project files, runs tests, builds, Git and shell commands inside the project, and asks before touching anything outside it. It can search code by name, content or structure, scaffold and launch apps and check that they respond, and remember the task across messages. A plan panel keeps a task list, and stuck detection nudges a model that makes no progress or keeps failing the same check.

## Model Choice and Local Tuning

The README lists 11 models, including Gemma 4, Qwen 3.6 and 3.8, Inkling 2 Mini, North-Mini-Code, Flint, Muse Glimmer, Kolibri 1 and DeepSeek V4 Flash, each in several quant sizes. The range runs from a 12B dense model for 16 GB Macs up to a 284B MoE model for 128 GB Macs. `/models` switches models at any time. Documented optimisations include speculative drafting, copy drafting for file rewrites, prompt cache reuse, precompiled GPU kernels, flash attention and an 8-bit KV cache by default.

## Network and Remote Use

Inference is local. The network is used only for model downloads, the `web_search` and `web_fetch` tools, and any MCP servers the user adds. `localcode api` exposes an OpenAI-compatible endpoint for other local apps. An experimental `/remote` feature lets an iPhone control the session over Tailscale, with pairing approved on the Mac.

## Features
- Runs local models on Apple Silicon with no API key
- Automatic llama-server setup and shutdown
- Model picker that recommends the most capable model fitting your Mac's memory
- Reads and edits project files
- Runs tests, builds, Git and shell commands
- Code search by name, content or structure
- Scaffolds and launches apps and checks they respond
- Plan panel and stuck detection
- Speculative and copy drafting for faster replies
- OpenAI-compatible local API endpoint
- MCP server support
- Experimental iPhone remote control over Tailscale

## Integrations
Hugging Face, llama-server, Tailscale, MCP servers

## Platforms
MACOS, IOS, WEB, API, CLI

## Pricing
Open Source

## Version
v0.5.43

## Links
- Website: https://mjwsolo.github.io/localcode/
- Documentation: https://mjwsolo.github.io/localcode/start-here/first-change
- Repository: https://github.com/mjwsolo/localcode
- EveryDev.ai: https://www.everydev.ai/tools/localcode
