Chuyển đến nội dung
Skillpedia
Agent48k · #5441

pi-custom-model

Skill này làm gì

Công cụ này giúp Pi dùng các mô hình ngôn ngữ tùy chỉnh không có sẵn mặc định. Nó đảm bảo các cách gọi tắt mô hình đặc biệt (như bản nhanh hoặc rẻ hơn) hoạt động đúng.

Khi nào nên dùng

  • ✓Khi bạn dùng cách gọi tắt cho một mô hình cụ thể (ví dụ “:nitro” cho bản nhanh hơn).
  • ✓Khi một mô hình bạn thường dùng ngừng hoạt động với Pi.
  • ✓Khi bạn muốn đảm bảo Pi luôn dùng đúng phiên bản của một mô hình.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/pi-custom-model/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/pi-custom-model/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Đặt mô hình “openrouter/mistralai/mistral-7b-instruct:nitro” làm mặc định của tôi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn thêm tên chính xác của mô hình tùy chỉnh vào một tệp cấu hình của Pi. Điều này dạy Pi cách tìm và dùng mô hình cụ thể đó khi bạn gọi đến.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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 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" }
            }
          ]
        }
      }
    }
    
    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.
  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. The slug in settings.json and models.json must 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.json alone. Setting defaultModel to an unregistered slug does nothing — models.json is 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.json overrides 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.
Câu hỏi thường gặp

Điều gì xảy ra nếu tôi không dùng công cụ này?

Pi có thể dùng một mô hình khác với mong đợi của bạn, hoặc một mô hình mặc định kém hiệu quả hơn mà không cho bạn biết.

“Biến thể” như “:nitro” là gì?

Đây là các phiên bản đặc biệt của một mô hình chính, được tối ưu cho một mục đích cụ thể, như tốc độ (nitro), chi phí (floor) hoặc chất lượng (exact).

Tôi có cần sửa tệp trên máy tính không?

Có, công cụ này yêu cầu chỉnh sửa các tệp cấu hình Pi cụ thể trên máy của bạn để đăng ký mô hình.

Chi tiết

Mô tả gốc của tác giả

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

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5441
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự