Install
Install with PiG
pig install npm:pi-profile-cyclerInstall with Pi
pi install npm:pi-profile-cyclerPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./pi-profile-cycler.ts"
]
}README
Written by the package's publisher, shown as published in version 1.2.0 (README.md). PiG does not review it.
Pi Profile Cycler
One keystroke to switch the model behind your orchestrator and every subagent.
A Pi extension for pi-subagents

Out of quota on one provider? Want Opus for planning and Haiku for everything else? Instead of editing agent files or restarting Pi, save your setups as profiles and flip between them mid-conversation.
Alt+M balanced → claude → codex → balanced …
✨ Features
| (blank) | (blank) |
|---|---|
| ⚡ One key | Alt+M cycles profiles; the parent model, its thinking and the routes for new subagents change together. |
| 🛠️ Built-in editor | /hprofile manage creates, edits and deletes profiles without touching JSON. |
| 🔎 Fuzzy model search | Type opu and only the Opus models are left. Only thinking levels the model supports are offered. |
| 🧭 Per-role routing | implementer on Sonnet, reviewer on Gemini, everything else on one default. |
| 🤖 Knows your subagents | Finds the agents pi-subagents sees: built-in, ~/.pi/agent/agents, ~/.agents, and your trusted project's .agents and .pi/agents. |
| 🗣️ You still decide | Ask the orchestrator for a specific model and it wins over the profile. |
| 🌳 Session-aware | Each conversation branch remembers its own profile across resume, fork and /tree. |
| 🛡️ Safe by design | Models are validated before switching or saving; failures roll back; saves are atomic with a .bak. Your agent files are never modified. |
🚀 Quick start
Requirements: Pi 1.5.x (the only line this release is verified against), pi-subagents (verified against 0.87.0) and Node.js 24 or newer. Pi supplies its own SDK packages to extensions, so nothing else needs to be installed. Upgrading from 1.1 or earlier? Support for mavam/pi-agents was removed in 1.2.0; your profile-cycler.json keeps working unchanged.
1. Install
Recommended, from npm:
pi install npm:pi-profile-cycler
The npm package page and npm installation become available after the first publication; if unavailable, use GitHub below. See the official Pi package system for installation scopes and discovery.
Alternatively, from GitHub:
pi install git:github.com/nanonoir/pi-profile-cycler
Update, list and remove (use the same source you installed from):
pi list
pi update npm:pi-profile-cycler # or: pi update --extensions (all packages)
pi remove npm:pi-profile-cycler
pi update without a target updates Pi itself, not packages. A version-pinned source such as npm:pi-profile-cycler@1.2.0 or a git tag stays pinned across updates. Removing the package does not delete your profile-cycler.json.
2. Create your first profile: open Pi and run /hprofile manage → + New profile → pick a default model → Save. It is activated right away.
3. Switch: add more profiles the same way and press Alt+M.
Until you create a profile nothing changes: subagents keep pi-subagents' own routing.
Or start from the example profiles
Skip this if you already have a profile-cycler.json. Then adjust the models in /hprofile manage.
macOS / Linux:
curl -fsSL -o ~/.pi/agent/profile-cycler.json https://raw.githubusercontent.com/nanonoir/pi-profile-cycler/main/examples/profile-cycler.json
Windows (PowerShell):
Invoke-WebRequest https://raw.githubusercontent.com/nanonoir/pi-profile-cycler/main/examples/profile-cycler.json -OutFile "$HOME\.pi\agent\profile-cycler.json"
⌨️ Commands
| Command | What it does |
|---|---|
Alt+M · /hprofile next | Next profile |
/hprofile | Pick a profile from a menu |
/hprofile <name> | Activate a profile |
/hprofile manage | Create, edit, delete and activate profiles |
/hprofile status | Active profile, real parent model and where each subagent route comes from |
/hprofile reload | Apply hand edits to the JSON; on error the previous config stays |
If Pi is busy, a switch is queued and applied as soon as the current run settles.
🛠️ Managing profiles
/hprofile manage opens a menu: arrows to move, Enter to choose, Esc to go back.
- New profile: pick a default model, then fine-tune the orchestrator or any subagent.
- Edit: every subagent shows what it uses today: its own route,
default, or thenativesetting from pi-subagents (the agent's ownmodel). - Save: validates the models you changed, keeps
profile-cycler.json.bakand applies the profile. - Delete and Set as default ask for confirmation and save right away.
If the file changes on disk while you edit, nothing is overwritten; just reopen the editor.
⚙️ How a subagent gets its model
model you ask for → role in the profile → profile default → pi-subagents' own resolution
The orchestrator uses the profile's main, or its default when there is no main. Routes are injected into the subagent launch as provider/id:thinking, because pi-subagents has no separate thinking field. If you ask for a model (with or without a :level suffix), it is left untouched and no thinking is added.
The role is the agent name you launch, matched by its name, local name, alias or package-qualified name. Agents that run an external CLI (Claude Code, Codex, Cursor adapters) take a CLI alias instead of a Pi model: they never get the default, and a profile route for one blocks its launch.
Prefer JSON? ~/.pi/agent/profile-cycler.json
{
"version": 2,
"defaultProfile": "balanced",
"order": ["balanced", "fast"],
"profiles": {
"balanced": {
"main": { "model": "openai/gpt-6.1-sol", "thinking": "medium" },
"agents": {
"implementer": { "model": "claude-code/claude-sonnet-5-5", "thinking": "medium" },
"reviewer": { "model": "antigravity/gemini-3-8-flash", "thinking": "high" }
}
},
"fast": {
"default": { "model": "claude-code/claude-haiku-5-5", "thinking": "high" }
}
}
}
mainis the orchestrator;agentsmaps any pi-subagents agent name to a model.defaultcovers the orchestrator (when there is nomain) and every subagent without its own route.- Each profile needs
mainordefault. Run/hprofile reloadafter editing.
⚠️ Good to know
- Only new launches are routed; agents already running keep their model.
tasks/chainlaunches are routed only when pi-subagents disablesworkflow-scripts; otherwise only directagentlaunches are routed. - Workflow scripts, management actions and RPC/event launches keep pi-subagents' native model resolution.
- If pi-subagents' builtin agents directory cannot be found,
/hprofile statussays so: builtin agents that run an external CLI may then receive the profiledefault, because their runner is unknown. - A route set here takes the place of the per-run model, so it overrides
agentOverridesand the agent's ownmodelfor routed roles. - The extension is loaded inside pi-subagents' child processes but registers nothing there, so an async child keeps the model it was launched with. Nested subagents therefore use pi-subagents' own routing.
- A routed model outside pi-subagents'
modelScopeor above itsmaxThinkingfails the launch visibly; the profile check covers only Pi's registry and supported thinking. - On Windows Pi reserves
Alt+P, which is why the shortcut isAlt+M.
🧑💻 Development
npm ci && npm test && npm run typecheck
Architecture · Compatibility · Manual testing · Publishing · PRD