Pi Subagents Guide
This guide describes the Pi-native inference setup.
Pi is a minimal terminal coding harness extended through packages, skills, prompt templates, and settings. Project settings live in .pi/settings.json, and pi-subagents reads project agents from .pi/agents/.
Checked-In Pi Assets
.pi/settings.jsonProject Pi settings. It declaresnpm:pi-subagents, loads the local skills, loads project prompt templates, and keeps sessions under.runtime/..pi/APPEND_SYSTEM.mdParent-session inference coordinator guidance appended to Pi's default prompt..pi/agents/optimizer.mdRead-only speed candidate proposer..pi/agents/benchmarker.mdLocal benchmark runner and result recorder..pi/prompts/inference-lab.mdReusable/inference-labkickoff prompt.
Setup
Install Pi once if it is not already available:
npm install -g @mariozechner/pi-coding-agentFrom inference/, start Pi:
piPi should load npm:pi-subagents from .pi/settings.json. If you prefer to install the package explicitly, run:
pi install npm:pi-subagents -lAuthenticate a provider with /login, or start Pi with the provider API key in the environment.
Parent Session
Run the project prompt template:
/inference-lab "<owner/repo> or local endpoint on :8080" 3Useful direct commands:
/run benchmarker "Measure the current local endpoint baseline and append the result."
/run optimizer "Propose one safe speed candidate against the latest baseline."
/run benchmarker "Benchmark this candidate command against the baseline."Workflow
- Resolve a target GGUF with
scripts/resolve_hf_gguf.py. - Use
benchmarkerto record a baseline inresearch/results.tsv. - Use
optimizerto propose one speed variable to change. - Use
benchmarkerto repeat the same benchmark. - Record the fastest reproducible command and any quality tradeoff.
Keep comparisons controlled: same model, exact GGUF, prompt, max_tokens, context, and llama.cpp build unless the experiment is explicitly changing one of those variables.
References
https://pi.dev/docs/latesthttps://pi.dev/docs/latest/settingshttps://pi.dev/packages/pi-subagentshttps://huggingface.co/learn/context-course/unit0/introduction?tool=Pi