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 |
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
Metadata
Release files for localcoder 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| localcoder-0.4.0.tar.gz | 179.2 kB | Without provenance | Details for localcoder-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| localcoder-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for localcoder-0.4.0-py3-none-any.whl |
Total release size: 370.0 kB
Release files / localcoder-0.4.0.tar.gz
| Download URL | localcoder-0.4.0.tar.gz |
|---|---|
| Size | 179.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81a58ac25ad9201460024f1a04345daa8da8eb90c4892076b410d760bfa5e4da
|
|
BLAKE2b-256 checksum How to use checksums |
20cf598522ebeb29fef5634f3602ce8b24cb15e4b7a39160e65c6a86bf85d62b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Release files / localcoder-0.4.0-py3-none-any.whl
| Download URL | localcoder-0.4.0-py3-none-any.whl |
|---|---|
| Size | 190.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d98390f53fa61b24750dd4cc0e0c62d0171fe5e07ec17da66e96f7a10ce8ed0
|
|
BLAKE2b-256 checksum How to use checksums |
31180adf69c24b61841941089a89e9e18a3cb3753951a10c889300682a866a55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.14
|
Security for localcoder 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.