Agent skill · operations · sickn33

pi-custom-model

Register custom Pi Agent model slugs so saved OpenRouter variants resolve correctly.

Why this skill is useful

Adds specific procedures for registering custom models in Pi Agent that the AI wouldn't reliably generate on its own.

What it needs

About 2k tokens when loaded. Last updated 2026-08-07. 44,571 stars on the source repository.

What this skill does

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 1. Confirm the slug is real before adding it (e.g. check the OpenRouter model/variant exists). A typo'd id also silently falls back. 2. Confirm auth. The provider must have a key in auth.json (or an env var like OPENROUTERAPIKEY). No auth → the model is registered but unavailable → still falls back. 3. Add the model to models.json under providers.<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 cost/contextWindow/compat from the base model (the variant shares them) — find the bundled entry in <pi-pkg>/nodemodules/@earendil-works/pi-ai/dist/providers/<provider>.models.js. Don't hardcode generic 128k/16k if the real model is bigger. 4. Set the default in settings.json: defaultProvider + defaultModel = the exact id. Leave defaultThinkingLevel as the user has it. 5. 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 exact provider+id — no fuzzy/colon-stripping for the saved default path. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills sickn33/pi-custom-model--b8fc69

View the source on GitHub

Browse the @skills marketplace