Skip to main content

Local AI coding agent — auto-installs, auto-serves, zero config. Works with Gemma 4, Qwen 3.5, and any model via llama.cpp or Ollama.

Project description

localcoder

The local coding CLI that does the obvious things nobody else does.

pipx install localcoder

I wanted to paste a screenshot into my coding assistant and see it inline. No tool did that locally. So I built one.

Cost: $1.30/month vs $110/month

Running local saves 85-141x compared to cloud APIs:

Usage Claude Sonnet Claude Opus Local (US) Local (India)
4h/day $55/mo $91/mo $0.65/mo $0.29/mo
8h/day $110/mo $183/mo $1.30/mo $0.58/mo
10h/day $137/mo $228/mo $1.62/mo $0.72/mo

Based on: Gemma 4 26B at 47 tok/s, 30% active generation, M4 Pro 30W. Electricity: worldpopulationreview.com. API: anthropic.com.

Annual savings: ~$1,300-$2,700 depending on usage and API choice.

What's Actually Different

Feature localcoder aider OpenCode Claude Code
Paste image, see it inline Ctrl+V → shows in terminal no no cloud only
Voice input (local) Ctrl+R → Whisper, no cloud no no no
See GPU memory while coding /gpu → live stats no no no
Computer use (screenshot + click) built-in no no cloud only
Free GPU when it's slow /clean → before/after no no n/a
Browse HuggingFace models built-in model browser no no n/a
Works offline 100% partial partial no
Cost $0.00 API costs API costs $20/mo+

Demo

❯ localcoder

  localcoder  ·  local AI coding agent  ·  $0.00 forever

  ┌──────────────────────────────────────────────────┐
  │  LOCAL CODER                                     │
  └──────────────────────────────────────────────────┘

  ● Gemma 4 26B Q3_K_XL  ·  llama.cpp  ·  128K  ·  ● GPU  ·  47 tok/s
  ✓ offline  ·  no API keys  ·  no data sent

  ctrl+r voice  ctrl+v image  /gpu stats  /clean free  /models switch

❯ /gpu
  GPU  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  12/16GB  3GB free
  Swap 3GB  Pressure normal
  Model Gemma 4 26B Q3_K_XL  GPU  ctx 128K  footprint 2311MB

Benchmark — M4 Pro 24GB

Real tests, real hardware, no synthetic benchmarks:

Model Size tok/s Notes
Gemma 4 26B Q3_K_XL 12.0GB 47 Best overall — vision + tool calling
Qwen3.5-35B MoE Q2_K_XL 11.3GB 46 Best coding quality
Qwen3.5-4B Q4_K_XL 2.7GB 46 Quick tasks
Gemma 4 E4B Q4_K_M 5.0GB 56 Fastest — good for 16GB Macs
Qwen3.5-27B Dense 13.4GB 7 Swap thrashing — don't use on 24GB

Install

# macOS (Apple Silicon)
pipx install localcoder

# First run — auto-detects hardware, shows what fits, starts model
localcoder

Needs llama.cpp or Ollama. First run wizard handles this.

Commands

localcoder                           # interactive coding
localcoder -p "build a react app"    # one-shot
localcoder --yolo                    # auto-approve tools

While Coding

Command What
Ctrl+V Paste + display image from clipboard
Ctrl+R Toggle voice input (local Whisper)
/gpu GPU memory, swap, model status
/clean Free GPU memory with before/after
/models Switch model (includes HuggingFace trending)
/clear Clear conversation

Also works with Claude Code

Don't want localcoder's agent? Use Claude Code with your local model instead:

pip install localfit
localfit --launch claude --model gemma4-26b

One command: starts model → configures Claude Code → launches with --bare flag. See localfit for details.

GPU Toolkit (localfit inside)

localcoder --simulate               # will this model fit my GPU?
localcoder --fetch unsloth/...      # check all quants from HuggingFace
localcoder --bench                  # benchmark models on YOUR hardware
localcoder --health                 # GPU health dashboard
localcoder --config opencode        # auto-configure OpenCode for local models
localcoder --config aider           # auto-configure aider

Also available standalone: pipx install localfit

Hardware

Mac RAM Best Model Speed
Air M2 8 GB Qwen 3.5 4B 50 tok/s
Air M3 16 GB Gemma 4 E4B 57 tok/s
Pro M4 24 GB Gemma 4 26B Q3_K_XL 47 tok/s

License

Apache-2.0

Security

Sandbox mode is ON by default. Protects against destructive model outputs:

Blocked Examples
Destructive commands rm -rf, sudo, kill, mkfs
Pipe to shell curl ... | bash, wget ... | sh
Protected paths ~/.ssh, ~/.aws, ~/.env, /etc/
Path traversal ../../etc/passwd
Computer use Disabled in sandbox
localcoder                    # sandboxed (default)
localcoder --yolo             # auto-approve but sandbox ON
localcoder --unrestricted     # sandbox OFF (shows warning)

Approved tools are remembered across sessions (~/.localcoder/approved_tools.json).

Tests

pip install pytest
pytest tests/ -v      # 19 tests

Project details


Download files

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

Source Distribution

localcoder-0.1.0.tar.gz (55.7 kB view details)

Uploaded Source

Built Distribution

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

localcoder-0.1.0-py3-none-any.whl (59.6 kB view details)

Uploaded Python 3

File details

Details for the file localcoder-0.1.0.tar.gz.

File metadata

  • Download URL: localcoder-0.1.0.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for localcoder-0.1.0.tar.gz
Algorithm Hash digest
SHA256 201a88a507b29a4ae3fbb509850248b481731963fdd31a07cd616160af8187e7
MD5 6b2e8fe811c5eb8d1e08505a1dd95ffe
BLAKE2b-256 0f3e1eb94f88503bc64e9869b124d942478a67c4f01fd1806b8db4111f6b004a

See more details on using hashes here.

File details

Details for the file localcoder-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: localcoder-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 59.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for localcoder-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1938b771ed74d793a08b743fe67128ab9d1b3def509281be1ffca7b6ecf5a1ea
MD5 4384d9c2549cd392e1420b717261b3be
BLAKE2b-256 1b9e19feb5b8a4c3aa79eb46cf3c8f0ffa1a484e1bfaf7a4e710c5fdc73a0638

See more details on using hashes here.

Supported by

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