Skip to content

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).

Terminal window
npm install -g --ignore-scripts @earendil-works/pi-coding-agent # installs `pi`
novak pi config > ~/.pi/agent/models.json # the Novak router as a provider
export ROUTER_API_KEY=... # `novak secret show ROUTER_API_KEY`
pi --append-system-prompt "$(novak pi hint)" --model novak/code

models.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.

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 edit tool needs the old text to match in exactly one place, the model kept sending text that matched twenty, and it never switched to sed. With the four lines in prompts/novak-pi.md the same task took 4 seconds. That is why novak pi hint exists. 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 deep model 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.

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