pi-model-switch

Model switching extension for pi coding agent

Package details

extension

Install pi-model-switch from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-model-switch
Package
pi-model-switch
Version
0.1.4
Published
Apr 14, 2026
Downloads
642/mo · 78/wk
Author
nicopreme
License
MIT
Types
extension
Size
12.9 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-model-switch

A Pi coding agent extension for direct model switching.

It provides one tool, switch_model, for model listing, search, and direct switching.

Foreground orchestration now lives in pi-orchestrate.

Installation

pi install npm:pi-model-switch

Restart Pi to load the extension.

Tool

switch_model

Parameters:

  • action: list | search | switch
  • search?: query for search and switch
  • provider?: provider filter

Behavior:

  • list: shows available authenticated models
  • search: filters by provider, id, or name
  • switch: resolves aliases first, then does exact or partial model matching

Aliases

Define aliases in:

~/.pi/agent/extensions/model-switch/aliases.json
{
  "cheap": "google/gemini-2.5-flash",
  "coding": "anthropic/claude-opus-4-5",
  "budget": ["openai/gpt-5-mini", "google/gemini-2.5-flash"]
}

Rules:

  • top-level value must be an object
  • alias names must be non-empty strings
  • each target must be provider/modelId
  • string alias: one exact model target
  • array alias: fallback chain; first available authenticated target wins

License

MIT