pi-model-selector
v1.0.1
Published
A Pi coding agent extension that enhances model selection with pricing and cumulative usage information.
Maintainers
Readme
Pi Model Selector
A Pi coding agent extension that enhances model selection with pricing and cumulative usage information.

Features
/modelscommand — Lists all available models with detailed metrics (leaves built-in/modeluntouched).- Pricing Display — Shows Input and Output price per million tokens (
In($/M),Out($/M)). - Cumulative Usage Tracking — Parses your actual Pi session logs (
.jsonl) to show exactly how many tokens you've used and how much it cost you per model (Total($),Total(tok)). - Scope Toggling — By default, shows usage for the current session. Press
Shift+Ctrl+Ato toggle and calculate usage across all sessions in the current month. - Smart Sorting & Filtering —
- Sort by input price (
Shift+Ctrl+I) - Sort by output price (
Shift+Ctrl+O) - Filter by provider (
Shift+Ctrl+P)
- Sort by input price (
- Favorites — Mark your favorite models with
Space. Favorites get a star (★) and are always pinned to the top of the list (to prevent jumping, sorting takes effect when you re-open the list or filter). PressShift+Ctrl+Fto filter and show only your favorites. - Auto-Calculated Costs — For providers that only report token usage but no costs (like local models or
cursor-agent), the extension automatically calculates the true cost based on the model's pricing.
Installation
You can install this extension directly via Pi's package manager:
pi install npm:pi-model-selector(Alternatively, you can manually place pi-model-selector.ts in your ~/.pi/agent/extensions/ directory.)
Usage
Once installed, use /models in any Pi session to browse available models.
Shortcuts in the UI:
↑↓— Navigate listEnter— Select modelEscorCtrl+C— CancelShift+Ctrl+I— Sort by Input PriceShift+Ctrl+O— Sort by Output PriceShift+Ctrl+P— Cycle through ProvidersShift+Ctrl+A— Toggle usage scope (Current Session ↔ All Sessions this Month)Space— Toggle Favorite status for the selected modelShift+Ctrl+F— Toggle "Favorites Only" view
Tech Stack
- TypeScript
- Pi Extension API (
@mariozechner/pi-coding-agent) - Pi AI types (
@mariozechner/pi-ai) - Pi TUI components (
@mariozechner/pi-tui)
