Skip to main content

LocalCode

PyPI License Python Platform

High-performance AI coding on consumer hardware.
No cloud, no API keys, no data leaving your machine.

⚠️ Alpha software. Active development; expect rough edges, breaking changes between versions, and bugs. Issues and feedback welcome.

Install

pip install localcode      # or: uv pip install localcode

Run

cd your-project
localcode

Docs

Docs are published at mjwsolo.github.io/localcode.

What it does

  • Reads and edits files — understands your codebase, makes surgical edits, refuses destructive overwrites
  • Runs commands — tests, builds, git, shell; auto-detects long-running servers and backgrounds them
  • Searches code — by filename pattern, content (grep), or directory structure
  • Builds and launches apps — detects package.json / pyproject.toml / static, picks a free port, starts and verifies the process
  • Tracks tasks across turns — task state, stage (scaffolding → implementing → verifying), and goal carry between user messages
  • Adaptive thinking — uses reasoning for planning and debugging, skips it for routine codegen
  • Uses tools automatically — the model picks its own tools
> build me a Flask app for studying music theory with quizzes

LocalCode infers the goal, scaffolds the project, writes the files, runs pip install, launches the server, opens it in your browser, and verifies it responds — all locally.

Why local?

We are building for a world of truly democratized AI — where everyone has access to powerful, personalized AI on any device, in any location. True local-first AI. LocalCode is the first step toward that vision.

Requirements

  • Mac with Apple Silicon
  • 16 GB RAM minimum
  • Python 3.10+
  • ~12 GB free disk (10 GB model + server)

Tested hardware

LocalCode is early software. Hardware support is expected to broaden, but only the configuration below has been tested by the maintainers so far.

Mac Memory Status Notes
M5 Apple Silicon up to 128 GB Tested Primary development machine (M5 Max)
M4 MacBook 16 GB Tested Validated at the 16 GB floor
M1/M2/M3 Apple Silicon 16 GB+ Not yet tested Expected to work, but needs validation
M4 Apple Silicon 24 GB+ Not yet tested Expected to support larger contexts, but needs validation

Linux installs and runs in CI for development, but Apple Silicon is the supported target — the Metal-accelerated inference path is Mac-only.

Models

On launch, LocalCode recommends the best model for your Mac's RAM — there's no fixed default. You can pick any of these (or a different quant) in the model picker.

Model Size (quant) Active params Min RAM Architecture
Gemma 4 12B 7.4 GB (Q4) 12B (dense) 16 GB gemma4-iswa
Gemma 4 26B-A4B 11.2 GB (Q3) 3.8B (8/128 experts) 24 GB gemma4-iswa
Qwen 3.6 35B-A3B 10.7 GB (Q2) 3.0B (8+1/256) 24 GB qwen35moe
Qwen 3.8 27B 17.9 GB (Q4) 27B (dense) 32 GB qwen35
DiffusionGemma 26B-A4B † 15.7 GB (Q4) 4B (diffusion MoE) 32 GB diffusion_gemma
North-Mini-Code 30B-A3B † 17.9 GB (Q4) 3B (30B MoE) 36 GB cohere2_moe
Gemma 4 12B (full) 23.8 GB (BF16) 12B (dense) 48 GB gemma4-iswa
Gemma 4 26B-A4B 28 GB (Q8) 3.8B (8/128 experts) 64 GB gemma4-iswa
Qwen 3.6 35B-A3B 38.5 GB (Q8) 3.0B (8+1/256) 96 GB qwen35moe

Min RAM is the threshold for auto-recommendation (weights ≤ ~55% of unified memory, leaving room for KV cache + OS); you can still pick a heavier model manually. experimental — pickable but not auto-recommended (DiffusionGemma needs a separate runner; cohere2_moe is unvalidated on this stack).

How LocalCode works

LocalCode runs a custom llama.cpp fork with TurboQuant KV cache compression — a technique from Google's ICLR 2026 paper that we patched into llama.cpp for Apple Silicon. This compresses the KV cache 3.8× — fitting 32K context in 355 MiB on a 16 GB MacBook.

LocalCode picks a model based on your Mac's RAM — there's no fixed default. It scales from Gemma 4 12B on 16 GB up to Qwen 3.6 35B-A3B on 64 GB+. The recommended models are Mixture-of-Experts — only ~3.8 B parameters active per token — which is what makes ~27 tok/s possible on a laptop.

Under the hood:

  • TurboQuant KV cache — asymmetric q8_0-K + turbo4-V quantization, 3.8× compression vs. f16
  • Multi-region mmap patch — fixes a Metal OOM crash where llama.cpp's loader spanned the entire GGUF file into one Metal buffer
  • GPU memory unlock — auto-prompts to raise iogpu.wired_limit_mb for full Metal offload
  • Agent loop — goal-typed routing (build / edit / run / chat) with task state, evidence-driven completion, and recovery modes for small-model failure patterns

Sponsors

If you'd like to sponsor LocalCode, reach out.

Contributing

See CONTRIBUTING.md.

License

Apache 2.0 — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localcode-0.3.42.tar.gz (10.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

localcode-0.3.42-py3-none-any.whl (6.0 MB view details)

Uploaded Python 3

File details

Details for the file localcode-0.3.42.tar.gz.

File metadata

  • Download URL: localcode-0.3.42.tar.gz
  • Upload date:
  • Size: 10.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for localcode-0.3.42.tar.gz
Algorithm Hash digest
SHA256 de888e9d85a7d3d19599f97040e9fd9fc018076664c18da2a88d36af35b43ee8
MD5 a5cc00155bdaa422a7a827beba7e3ac3
BLAKE2b-256 079b1aee0da30319c3e6fd135eb371406b588a51468c662aee919d7f5d460d19

See more details on using hashes here.

Provenance

The following attestation bundles were made for localcode-0.3.42.tar.gz:

Publisher: publish.yml on mjwsolo/localcode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file localcode-0.3.42-py3-none-any.whl.

File metadata

  • Download URL: localcode-0.3.42-py3-none-any.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for localcode-0.3.42-py3-none-any.whl
Algorithm Hash digest
SHA256 78dd8ea21af4ab5de02784b4ced1a576818f6bf5c0fd83ab7d621e45a4f2cc1e
MD5 6e3494730270fc38359a9ab0ff411bd3
BLAKE2b-256 b2ac16195f64b4b412b234d24a7a4b13a86668d1054a57919ce197f2da551d46

See more details on using hashes here.

Provenance

The following attestation bundles were made for localcode-0.3.42-py3-none-any.whl:

Publisher: publish.yml on mjwsolo/localcode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page