pi-subagent-model-selection
v0.1.4
Published
Shared deterministic model-selection policy for pi subagent extensions
Readme
pi-subagent-model-selection
Shared model-selection policy for pi subagent extensions.
Installation
npm install pi-subagent-model-selectionUsage
import { getSmallModelFromProvider } from "pi-subagent-model-selection";
const selection = getSmallModelFromProvider(ctx.modelRegistry, ctx.model);
if (!selection) {
// no suitable model available
}The return value includes:
model(provider,id)thinkingLevel- selection diagnostics:
authMode,authSource,reason
Model selection policy
Selection uses modelRegistry.getAvailable() and current-model auth context.
If current model uses OAuth credentials:
openai-codex/gpt-5.3-codex-spark(thinkingLevel: high)google-antigravity/gemini-3-flash- Fallback strategy
If current model uses API key credentials:
google-vertexGemini 3 Flash (gemini-3-flash*)googleGemini 3 Flash (gemini-3-flash*)- Fallback strategy
Fallback strategy:
- Gemini 3 Flash on current provider
- Claude Haiku 4.5 on current provider
- Current model with
thinkingLevel: low
If no current model is available, defaults to API-key policy and sets diagnostics accordingly.
Development
npm test
npm run pack:checkLicense
Apache-2.0
