pi-custom-model
Register custom Pi Agent model slugs so saved OpenRouter variants resolve correctly.
它会碰到什么
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
Pi custom / variant model
When to Use
Pi's saved default only loads if the exact provider/id exists in its model registry. Pi ships a static bundled list per provider — so OpenRouter routing-shortcut variants (:nitro = sort by throughput, :floor = cheapest, :exacto = quality tool-use) and any brand-new slug are NOT in it. When the default doesn't resolve, Pi silently falls through to its built-in per-provider default (for openrouter that's moonshotai/kimi-k2.6) — looking like Pi "reset" your model. Fix = register the slug as a custom model so find(provider, id) matches.
Files (global)
~/.pi/agent/settings.json—defaultProvider,defaultModel,defaultThinkingLevel~/.pi/agent/models.json— custom models, keyed by provider~/.pi/agent/auth.json— provider credentials (check the provider key exists)
Steps
- Confirm the slug is real before adding it (e.g. check the OpenRouter model/variant exists). A typo'd id also silently falls back.
- Confirm auth. The provider must have a key in
auth.json(or an env var likeOPENROUTER_API_KEY). No auth → the model is registered but unavailable → still falls back. - Add the model to
models.jsonunderproviders.<provider>.models. For a built-in provider (openrouter, anthropic, etc.) you only supply metadata —api,baseUrl, and auth are inherited from the bundled defaults. Example:
{
"providers": {
"openrouter": {
"models": [
{
"id": "z-ai/glm-5.2:nitro",
"name": "Z.ai: GLM 5.2 (nitro)",
"reasoning": true,
"thinkingLevelMap": { "xhigh": "xhigh" },
"input": ["text"],
"cost": { "input": 0.95, "output": 3, "cacheRead": 0.18, "cacheWrite": 0 },
"contextWindow": 1048576,
"maxTokens": 32768,
"compat": { "supportsDeveloperRole": false, "thinkingFormat": "openrouter" }
}
]
}
}
}
Copy cost/contextWindow/compat from the base model (the variant shares them) — find the bundled entry in <pi-pkg>/node_modules/@earendil-works/pi-ai/dist/providers/<provider>.models.js. Don't hardcode generic 128k/16k if the real model is bigger.
- Set the default in
settings.json:defaultProvider+defaultModel= the exact id. LeavedefaultThinkingLevelas the user has it. - Verify:
pi --list-models | grep <id>shows it, and JSON parses. Optionally smoke-test:pi --provider <p> --model "<id>" "which model are you?".
Quirks
- Exact match only.
find()is exactprovider+id— no fuzzy/colon-stripping for the saved default path. The slug insettings.jsonandmodels.jsonmust be byte-identical. - Silent fallback. Pi prints no error when the default doesn't resolve; it just shows a different model in the footer. That's the tell.
- Don't edit
settings.jsonalone. SettingdefaultModelto an unregistered slug does nothing —models.jsonis the actual fix. enabledModels(optional) pins the model picker so Ctrl+P cycling can't drift back:"enabledModels": ["<provider>/<id>:<thinking>"].- Project override. A repo's
.pi/settings.jsonoverrides global. If a default reverts only inside one project, check that file first. - Restart Pi fully — the registry loads at startup.
Example
User request:
> Register custom Pi Agent model slugs so saved OpenRouter variants resolve correctly.
Limitations
- Adapted from
davidondrej/skills; verify local paths, tools, credentials, and agent features before acting. - For commands, remote access, scheduling, browser automation, or file-changing workflows, get explicit user approval and confirm the target environment first.
想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。
同名技能的其他版本
有 3 个不同仓库或目录里都有叫 pi-custom-model 的技能。它们内容并不相同,别混用:
- sickn33/agentic-awesome-skills — Register custom Pi Agent model slugs so saved OpenRouter variants resolve correctly.
- sickn33/agentic-awesome-skills — Register custom Pi Agent model slugs so saved OpenRouter variants resolve correctly.