pi-custom-model – skill Agent & Tự động hóa cho agent AI
Đăng ký slug model tùy chỉnh cho Pi Agent để các biến thể OpenRouter đã lưu được nhận diện đúng.
Cài skill pi-custom-model bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/pi-custom-model-098c0.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /pi-custom-model – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/pi-custom-model-098c0.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $pi-custom-model – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/pi-custom-model-098c0.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /pi-custom-model – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/pi-custom-model-098c0.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /pi-custom-model – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Pi custom / variant model
When to Use
Use when a requested provider/model ID is unavailable or a saved selection resolves unexpectedly. Verify the installed Pi version and catalog first: current Pi can overlay its bundled catalog with newer data, and pi update --models refreshes it. Do not assume a particular fallback model or that every variant needs manual registration. Check the provider's actual supported ID and routing options.
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
Preserve existing provider entries, keep a backup, and never print credential values or copy auth.json into reports.
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 OPENROUTER_API_KEY). 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:
{
"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" }
}
]
}
}
}
The JSON above is illustrative, not a verified model advertisement. Replace the ID and every capability/limit/cost field with verified provider metadata and the installed Pi schema; variant routing can change pricing. Prefer a minimal entry when overrides are unnecessary. See [Pi model configuration](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/models.md).
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. An authorized smoke test may incur provider charges; verify the selected model through client/provider metadata, not the model's self-identification.
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. - Resolution behavior varies by version. Inspect the selected provider/model and diagnostics rather than assuming silent fallback.
- 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. - Current Pi reloads
models.jsonwhen opening/model; verify behavior for the installed version. Restart only if needed.
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.
Skill liên quan
- pi-web-search – Cung cấp cho Pi Agent quy trình tìm kiếm và lấy nội dung web an toàn bằng gói…
- pilot-protocol – Cấp cho AI agent một địa chỉ mạng cố định, nhắn tin P2P mã hóa và kho ứng dụng có thể…
- pipecat-friday-agent – Xây dựng trợ lý giọng nói chiến thuật độ trễ thấp lấy cảm hứng từ Iron Man…
- pipedrive-automation – Tự động hóa vận hành CRM Pipedrive gồm deal, liên hệ, tổ chức, hoạt động, ghi chú và…
- pixeltable – Xây dựng ứng dụng Pixeltable trong app.py với bảng, cột tính toán, tìm kiếm embedding và…
- playwright-skill – Viết và chạy tự động hóa trình duyệt Playwright trong phạm vi giới hạn, kiểm tra…
- polis-protocol – Điều phối nhiều AI agent từ nhiều nhà cung cấp như một nhóm tự cải tiến: bộ định tuyến…
- polis-protocol-a-self-optimizing-city-of-agents – Polis Protocol: Thành phố agent tự tối ưu hóa