pi-custom-model
Skill11 starsChanged 4 months agoMITView on GitHub
Register a custom or variant model (e.g. an OpenRouter ":nitro" / ":floor" / ":exacto" slug) in the Pi Agent so it can be set as the global default. Use when Pi silently falls back to a different model (e.g. moonshotai/kimi-k2.6) after setting defaultModel, or when a model slug isn't in Pi's bundled list. Triggers on "Pi reset my model", "Pi won't use this model", "add a model to Pi", "Pi default keeps reverting".
- Reads credentials
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Confirm the slug is real: before adding it (e.g. check the OpenRouter model/variant exists).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
Copy{ "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" } } ] } } }cost/contextWindow/compatfrom 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.
In this repository26 other files it gives its agents.
- agent-self-schedulingSkill
- cmuxSkill
- codex-subagentSkill
- fable-safe-promptSkill
- goal-loopSkill
- handoffSkill
- markdown-renderingSkill
- run-deep-sweSkill
- anti-sleepSkill
- setup-helpSkill
- browser-harnessSkill
- deepapiSkill
- deep-researchSkill
- pi-web-searchSkill
- research-promptSkill
- youtube-transcriptSkill
- distribute-skill-to-all-agentsSkill
- effective-agent-skillsSkill
- folder-specific-claude-and-agents-mdSkill
- push-skill-to-githubSkill
- brain-to-docsSkill
- grill-meSkill
- interview-style-doc-buildingSkill
- read-all-adrsSkill
- shortSkill
- teachSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

