{"slug": "humble-pi-local-agentic-coding-on-minimal-hardware", "title": "Humble Pi — local agentic coding on minimal hardware", "summary": "A developer released Pi, a coding agent that runs entirely on a local machine without API keys or cloud dependencies. Pi works with a local llama.cpp server hosting Google Gemma 4 models, enabling offline AI-assisted coding on modest hardware. The setup requires only a few commands to install and configure the agent with web search and fetch capabilities.", "body_md": "A coding agent that runs entirely on your own machine. No API keys, no cloud, works offline.\n\n[pi](https://www.npmjs.com/package/@earendil-works/pi-coding-agent) is the agent you talk to. It runs against a local [llama.cpp](https://github.com/ggml-org/llama.cpp) server hosting **Google Gemma 4** (the [unsloth](https://huggingface.co/unsloth) builds).\n\nPick a model by how much memory you have:\n\n| Model | unsloth repo | Download | VRAM | Start | Max |\n|---|---|---|---|---|---|\n| Gemma 4 E4B |\n`unsloth/gemma-4-E4B-it-GGUF` |\n\n`65536`\n\n(64k)`131072`\n\n(128k)`unsloth/gemma-4-12b-it-GGUF`\n\n`65536`\n\n(64k)`262144`\n\n(256k)This gives you the `llama`\n\nbinary; you start the server with `llama serve`\n\n. Check it installed with `llama version`\n\n.\n\n**macOS** — [Homebrew](https://formulae.brew.sh/formula/llama.cpp):\n\n```\nbrew install llama.cpp\n```\n\n**Linux (any distro)** — grab a prebuilt binary with [installama.sh](https://github.com/angt/installama.sh).\n\nThis script auto-detects your CPU and GPU (CUDA / ROCm / Vulkan) and drops `llama`\n\ninto `~/.local/bin`\n\n(it'll tell you if that's not on your PATH):\n\n```\ncurl -fsSL https://angt.github.io/installama.sh | sh\n```\n\nAdd an alias to start the server. It also saves the server's output to a timestamped log file, which helps if something goes wrong. Put this in your shell config — `~/.zshrc`\n\non macOS, `~/.bashrc`\n\non Linux:\n\n```\n# Gemma 4 E4B @ 64k for pi (f16 KV, flash-attn, :8080, vision on)\nalias llamagemma4b='mkdir -p ~/.llama-logs && llama serve -hf unsloth/gemma-4-E4B-it-GGUF:UD-Q4_K_XL -c 65536 -fa 1 --jinja --parallel 1 --cache-ram 0 --temp 1.0 --top-p 0.95 --top-k 64 --min-p 0 2>&1 | tee ~/.llama-logs/llama-$(date +%Y%m%d-%H%M%S).log'\n\n# Gemma 4 12B @ 64k for pi (needs ~12GB) — same flags, bigger model\nalias llamagemma12b='mkdir -p ~/.llama-logs && llama serve -hf unsloth/gemma-4-12b-it-GGUF:UD-Q4_K_XL -c 65536 -fa 1 --jinja --parallel 1 --cache-ram 0 --temp 1.0 --top-p 0.95 --top-k 64 --min-p 0 --reasoning on 2>&1 | tee ~/.llama-logs/llama-$(date +%Y%m%d-%H%M%S).log'\n```\n\nThen start it:\n\n```\nsource ~/.zshrc      # or ~/.bashrc\nllamagemma4b         # first run downloads the model (~5 GB), then serves on :8080\n```\n\n| flag | what it does |\n|---|---|\n`--cache-ram 0` |\nKeeps memory steady. Without it, llama.cpp piles up cached copies of the conversation that grow every time you `/new` . This keeps just one in place and reuses it. |\n`-c 65536` |\nThe context window — 64k tokens here. A good default; raise it if you have memory to spare (max 128k on E4B, 256k on the 12B). |\n`-fa 1` |\nFlash attention — faster, and uses less memory. |\n`--parallel 1` |\nOne conversation slot, which keeps the cache simple. |\n`--temp 1.0 --top-p 0.95 --top-k 64 --min-p 0` |\nGemma 4's recommended sampling settings. |\n`--reasoning on` |\nEnables reasoning. Only needed by 12b which has reasoning off by default. |\n\nGemma 4 can read images, that adds about 1.2 GB of memory; add `--no-mmproj`\n\nto the alias if you'd rather run text-only.\n\nYou don't need to set anything for thinking — Gemma 4 handles it, and pi controls it. Unlike some models, turning thinking on here doesn't slow things down.\n\n```\n# install pi\ncurl -fsSL https://pi.dev/install.sh | sh\n\n# install extension packages\npi install npm:pi-llama-cpp     # connects pi to the llama.cpp server\npi install npm:pi-smart-fetch   # lets the agent read web pages\npi install git:github.com/joematthews/pi-smart-web-search   # lets the agent search the web\n```\n\n— finds your local server automatically.`pi-llama-cpp`\n\n— lets the agent read web pages.`pi-smart-fetch`\n\n— lets it search the web, no API key needed.`pi-smart-web-search`\n\nTogether they let a small model look things up instead of guessing.\n\n```\n# terminal 1: start the model server\nsource ~/.zshrc && llamagemma4b\n\n# terminal 2: open your project and start coding\ncd ~/your-project\npi\n```\n\nThat's the whole setup — a private coding agent that runs on a modest laptop.\n\nGive it a spin. These all need up-to-date info from the web, which is exactly where a small local model needs a hand:\n\n```\nWhat's the latest version of Node.js, and what's new in it?\nCompare Bun and Deno for a new TypeScript API in 2026.\nScaffold a minimal Vite + React + TypeScript app in ./demo, then explain the structure.\nRead package.json and tell me which dependencies are out of date.\nFind the current recommended way to set up GitHub Actions for a Node project, then write the workflow file.\n```\n\nWatch what it does: it searches, opens the most useful results, reads them, and answers from what it read — instead of guessing from old training data.", "url": "https://wpnews.pro/news/humble-pi-local-agentic-coding-on-minimal-hardware", "canonical_source": "https://gist.github.com/joematthews/d02639bcbe0e0c1c404f5d3a64c3c06f", "published_at": "2026-06-16 03:11:22+00:00", "updated_at": "2026-06-21 19:03:25.677098+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "large-language-models", "ai-infrastructure"], "entities": ["Google Gemma 4", "llama.cpp", "unsloth", "Pi", "Homebrew", "npm", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/humble-pi-local-agentic-coding-on-minimal-hardware", "markdown": "https://wpnews.pro/news/humble-pi-local-agentic-coding-on-minimal-hardware.md", "text": "https://wpnews.pro/news/humble-pi-local-agentic-coding-on-minimal-hardware.txt", "jsonld": "https://wpnews.pro/news/humble-pi-local-agentic-coding-on-minimal-hardware.jsonld"}}