Coding with Pi
Pi is a minimal terminal coding agent (MIT). It reads and edits files and runs
commands in the directory you start it in, so it belongs in a terminal next to the code, not in
Open WebUI (the Code preset there is for snippets and review).
Set it up
Section titled “Set it up”npm install -g --ignore-scripts @earendil-works/pi-coding-agent # installs `pi`novak pi config > ~/.pi/agent/models.json # the Novak router as a providerexport ROUTER_API_KEY=... # `novak secret show ROUTER_API_KEY`pi --append-system-prompt "$(novak pi hint)" --model novak/codemodels.json holds no key: it says $ROUTER_API_KEY and Pi reads the environment. On a machine
that is not Spire, run novak pi config on Spire and copy the output, or pass --url. Hosted
providers (Anthropic, OpenAI and others) can be added to the same file for work that should not
use the local models. That is a decision about where your code goes, not a Novak setting.
What to expect from the local models
Section titled “What to expect from the local models”The first measurements below were taken on 2026-10-23 against the 14B chat model at an 8,192-token window.
The default is now code, a local Qwen2.5-Coder 14B (decision #76). It has only been checked against a single
coding prompt, at 13 tokens a second cold and 32 warm, so how it behaves in a long Pi session is VERIFY.
- A small task (create a file and run it) took 4 seconds.
- A rename across a 150-line file looped for minutes with no help: Pi’s
edittool needs the old text to match in exactly one place, the model kept sending text that matched twenty, and it never switched tosed. With the four lines inprompts/novak-pi.mdthe same task took 4 seconds. That is whynovak pi hintexists. Expect to add a rule when you see a loop like this. - The window is the real limit: every file Pi reads stays in it. Keep tasks small, and use a
hosted model for work that spans many files. The larger
deepmodel needs most of the GPU, so loading it for a coding session evicts the small model Home Assistant voice uses, and the next spoken request waits for it to load again.
Decision #73 has the reasoning.
See also
Section titled “See also”| Read | For |
|---|---|
| engines.md | How a router role such as code maps to a model |
| ollama-settings.md | Context size, keep-alive and what fits in the GPU |
| cli.md | novak pi config and novak pi hint |
| decisions.md | Why Pi runs in the terminal and why Code is offline by default |