@zigai/pi-model-filter

Pi package that hides configured models from Pi model selection and lookup.

Packages

Package details

extension

Install @zigai/pi-model-filter from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@zigai/pi-model-filter
Package
@zigai/pi-model-filter
Version
0.1.6
Published
Jun 14, 2026
Downloads
362/mo · 362/wk
Author
zigai
License
MIT
Types
extension
Size
15.1 KB
Dependencies
1 dependency · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

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

README

Pi Model Filter

npm version npm downloads license

This Pi extension filters visible models.

Install

pi install npm:@zigai/pi-model-filter

Example ~/.pi/agent/model-filters.json:

{
  "$schema": "https://raw.githubusercontent.com/zigai/pi-tweaks/main/packages/pi-model-filter/model-filters.schema.json",
  "include": [
    {
      "provider": "openai-codex",
      "models": ["gpt-5.3*", "gpt-5.4*", "gpt-5.5*"]
    }
  ],
  "exclude": [
    {
      "provider": "openrouter",
      "models": ["openai/gpt-oss-20b:free", "qwen/*", "*:free"]
    },
    {
      "provider": "*",
      "models": ["*-preview", "*-experimental"]
    }
  ]
}

Rules

  • provider and models match provider/model ids.
  • Exact strings and glob patterns are supported.
  • * matches any number of characters; ? matches one character.
  • include allowlists models for matching providers.
  • exclude hides matching models and always wins over include.
  • Providers without include rules stay visible unless excluded.

How is this different from /scoped-models?

Pi has a built-in /scoped-models command. It shows an interactive checklist that lets you enable or disable individual models for Ctrl+P cycling. Changes are session-only until you press Ctrl+S to persist them.

pi-model-filter works differently:

/scoped-models pi-model-filter
How you configure it Interactive checklist JSON config file with glob patterns
What it affects Ctrl+P model cycling only /model, Ctrl+L, Ctrl+P cycling, and modelRegistry.*() lookups
Persistence Optional (save with Ctrl+S) Always loaded from ~/.pi/agent/model-filters.json
Use case Quickly narrow the active cycle list Permanently hide noisy/unwanted models everywhere

Behavior

This extension filters models from Pi's model registry views, including:

  • /model
  • model cycling
  • modelRegistry.getAll()
  • modelRegistry.getAvailable()
  • modelRegistry.find()

It does not delete provider definitions, model definitions, or credentials.

License

MIT