@tryinget/pi-model-selection

Shared Pi model selection and auth resolution primitives.

Packages

Package details

prompt

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

$ pi install npm:@tryinget/pi-model-selection
Package
@tryinget/pi-model-selection
Version
0.2.0
Published
Jul 13, 2026
Downloads
220/mo · 185/wk
Author
tryinget
License
SEE LICENSE IN LICENSE
Types
prompt
Size
17.3 KB
Dependencies
0 dependencies · 0 peers

Security note

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

README


summary: "@tryinget/pi-model-selection package overview." read_when:

  • "Orienting to this package or directory before changing its behavior."

@tryinget/pi-model-selection

Shared Pi model-selection and auth-resolution primitives.

This is a top-level support package at packages/pi-model-selection, not a pi-interaction subpackage. Consumers should depend on @tryinget/pi-model-selection directly rather than depending on @tryinget/pi-interaction for model-selection helpers.

This package owns prompt-template-model-compatible model resolver semantics that are needed by more than one extension:

  • exact modelId
  • exact provider/modelId
  • comma-separated fallback lists
  • current-model preservation when the active model matches any candidate
  • provider-priority ordering for ambiguous bare model IDs:
    1. openai-codex
    2. anthropic
    3. github-copilot
    4. openrouter
  • auth-aware selection via getAvailable(), isUsingOAuth(), getApiKey(), and getApiKeyAndHeaders()
  • preservation of model-level headers

It intentionally does not own prompt-template slash-command registration, compaction preset parsing, loops/workflows, or subagent execution.

Template baseline

This package was reconciled through ../pi-extensions-template in simple-package mode, then intentionally adapted as a root-managed support library. It keeps template lineage and baseline files such as .copier-answers.yml, biome.jsonc, policy/engineering-lane.json, and docs/engineering.local.md, but it deliberately omits package.json#pi.extensions and package.json#pi.prompts so it cannot register slash commands or package prompts by accident.