Agent skill

Knowledge Model And Provider Runtime

by echoVic in echoVic/blade-code

覆盖 Blade 的模型目录、Provider 通道、pi-ai 请求适配以及恢复、准入和观测运行链. An agent skill from echoVic/blade-code.

MITAuto-check passedAgent Workflows

Install Knowledge Model And Provider Runtime

skills CLI
$ npx skills add echoVic/blade-code --skill knowledge-model-and-provider-runtime -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install echoVic/blade-code knowledge-model-and-provider-runtime --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/echoVic/blade-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.trae/knowledges/model-and-provider-runtime .claude/skills/knowledge-model-and-provider-runtime && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
knowledge-model-and-provider-runtime
GitHub stars
180
Token cost
~1.2k tokens
SKILL.md length
240 words
Files
1
Skills in repo
38
Repo updated
First seen
Licence
MIT

At a glance

覆盖 Blade 的模型目录、Provider 通道、pi-ai 请求适配以及恢复、准入和观测运行链. An agent skill from echoVic/blade-code.

  • Tasks that involve Session handoff
  • SKILL.md covers Module Structure, Gotchas, Architecture and Decisions, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Knowledge Model And Provider Runtime is an agent skill from echoVic/blade-code. 覆盖 Blade 的模型目录、Provider 通道、pi-ai 请求适配以及恢复、准入和观测运行链。 Navigate when: 新增或切换模型与 Provider、调试请求负载或流事件、排查 fallback、重试、 熔断、排队、Prompt Cache 或费用问题。Excludes: Session 模型资源快照与 Workspace Trust(见 workspace-policy-and-shared-foundations/),Agent 轮次消费与压缩策略(见 agent-execution-and-orchestration/ 和 session-state-and-context/)。Keywords: PiAIChatService, PiModelCatalog, resolveModelConfig, provider retry, circuit breaker, admission, fallback, prompt cache, pricing.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Session handoff. The repository describes itself as: AI-powered CLI coding agent with 20+ built-in tools, MCP support, and multi-model providers. The licence is MIT.

When your agent uses it

  • Tasks that involve Session handoff

Example prompts

  • “/knowledge-model-and-provider-runtime”

What it can do on your machine

Read from SKILL.md and the folder at commit 30f8684. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Knowledge Model And Provider Runtime loads about 1.2k tokens when it runs. Until then it costs about 121 tokens; SKILL.md has 240 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~121
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from echoVic/blade-code at commit 30f8684, republished under its MIT licence (© echoVic). 240 words, ~1,156 tokens.

Download SKILL.mdSave it as .claude/skills/knowledge-model-and-provider-runtime/SKILL.md (or your agent's skills folder).
name
knowledge-model-and-provider-runtime
description
覆盖 Blade 的模型目录、Provider 通道、pi-ai 请求适配以及恢复、准入和观测运行链。 Navigate when: 新增或切换模型与 Provider、调试请求负载或流事件、排查 fallback、重试、 熔断、排队、Prompt Cache 或费用问题。Excludes: Session 模型资源快照与 Workspace Trust(见 workspace-policy-and-shared-foundations/),Agent 轮次消费与压缩策略(见 agent-execution-and-orchestration/ 和 session-state-and-context/)。Keywords: PiAIChatService, PiModelCatalog, resolveModelConfig, provider retry, circuit breaker, admission, fallback, prompt cache, pricing.

Module Structure

该域把用户配置解析为 Session 绑定的 pi-ai 模型,将 Blade 消息与工具契约适配为 Provider 请求,并在物理流外围统一实施故障恢复、容量保护和运行态观测。

Directory Layout
  • packages/cli/src/services/ChatServiceInterface.ts — Blade 内部消息、请求、响应和 Provider 生命周期事件契约
  • packages/cli/src/services/PiAIChatService.ts — 统一聊天服务、fallback 与物理请求编排
  • packages/cli/src/services/PiCatalogService.ts — Provider/模型目录查询门面
  • packages/cli/src/services/pi/ — pi-ai 目录、上下文、请求、流、重试、熔断、准入和缓存适配
  • packages/cli/src/config/modelIds.ts — 可读模型配置 ID 生成与旧 ID 迁移
  • packages/cli/src/config/modelProviders.ts — 自定义 Provider 通道验证
  • packages/cli/src/config/providerCircuitBreaker.ts — 熔断配置边界
  • packages/cli/src/config/providerRequestAdmission.ts — Provider 准入配置边界
  • packages/cli/src/config/foregroundProviderRecovery.ts — 前台恢复预算边界
Key Entry Points
  • resolveModelConfig() in packages/cli/src/services/pi/resolveModelConfig.ts — 将模型记录、全局配置和能力选择冻结为运行时配置
  • createChatServiceAsync() in packages/cli/src/services/ChatServiceInterface.ts — 合并 Provider 默认请求头并创建唯一聊天实现
  • PiAIChatService.streamChat() in packages/cli/src/services/PiAIChatService.ts — 编排上下文转换、准入、熔断、物理流、重试与 fallback
  • PiModelCatalog in packages/cli/src/services/pi/PiModelCatalog.ts — 维护内置、兼容和自定义 Provider 的模型视图

Gotchas

  • ChatConfig 同时携带可序列化设置和 modelCatalog、providerCircuitRegistry、providerRequestAdmissionScheduler 三个运行时对象;后者明确禁止进入配置、事件或会话持久化 (packages/cli/src/services/ChatServiceInterface.ts)
  • Session 的模型目录是不可变工作区快照而熔断器和启用后的准入器是进程共享协调器;把三者统一成全局单例会串扰项目 endpoint,把三者都改成 Session 私有又会失去跨 Session 故障与容量协调 (packages/cli/src/agent/resources/WorkspaceModelResources.ts, packages/cli/src/services/PiAIChatService.ts)
  • 跨 Provider fallback 不继承主通道的 API key、base URL、headers、service tier 或 verbosity;只有同 Provider 且 fallback 未解析出独立 channel 时才继承主通道字段 (packages/cli/src/services/PiAIChatService.ts)

Architecture

  • 配置链固定为 ModelConfig → resolveModelConfig() → ChatConfig → createChatServiceAsync() → PiAIChatService;模型能力先由 catalog 校验,再由请求适配器映射为各 wire API 的参数 (packages/cli/src/services/pi/resolveModelConfig.ts, packages/cli/src/services/ChatServiceInterface.ts, packages/cli/src/services/pi/requestOptions.ts)
  • chat() 不是另一套非流式实现,而是消费 streamChat() 并聚合正文、reasoning、工具调用、usage 与 finish reason,因此恢复和重放边界只需在流式路径维护 (packages/cli/src/services/PiAIChatService.ts)
  • 物理请求顺序是 circuit preflight → 可选 admission → 原子 circuit check/probe claim → Provider iterator → circuit outcome → permit/token 释放;重试等待和 fallback 选择发生在 permit 外 (packages/cli/src/services/PiAIChatService.ts, docs/reference/model-transport-recovery.md)

Decisions

  • 2026-08-05 的破坏性迁移将 Vercel AI SDK 替换为唯一的 pi-ai 运行时,并把模型能力、上下文窗口和价格的权威来源移到 catalog;旧模型记录中的凭据和能力字段不再兼容 (packages/cli/src/services/pi/PiModelCatalog.ts, packages/cli/src/config/types.ts, git:311ba368)
  • Blade 将底层 pi-ai 的 maxRetries 固定为 0 并在 PiAIChatService 集中拥有重试、fallback 和生命周期事件,避免 SDK 与 Agent 双重重试放大物理请求或暗中重放流 (packages/cli/src/services/pi/requestOptions.ts, packages/cli/src/services/PiAIChatService.ts, git:2aa2b22b)

Patterns

  • Provider 运行态事件先作为 StreamChunk 控制字段进入 Agent loop,再由 TUI、Web SSE、Headless JSONL 和 ACP 各自投影;这些事件不混入 assistant 正文或 durable transcript (packages/cli/src/services/ChatServiceInterface.ts, packages/cli/src/agent/loop/executeLoopGenerator.ts, packages/cli/src/server/routes/session.ts)
  • PiAIChatService.updateConfig() 会重新解析模型并重建可选 admission scheduler;修改 Provider、模型或并发配置不能只替换字段而保留旧运行时对象 (packages/cli/src/services/PiAIChatService.ts)

Dependencies

  • @earendil-works/pi-ai 提供 Provider、模型目录、凭据协议、模型能力和流事件;本域负责把这些能力收敛为 Blade 的单一运行时契约 (packages/cli/package.json, packages/cli/src/services/pi/PiModelCatalog.ts)

Child Knowledge Nodes

  • ./model-catalog-configuration-and-credentials/SKILL.md — Navigate when: 新增模型或自定义 Provider、解析 fallback channel、迁移模型 ID、处理凭据与目录元数据
  • ./provider-transport-and-context-adaptation/SKILL.md — Navigate when: 修改 Message/Tool 到 pi-ai 的映射、Provider 参数、图片与 thinking 能力、流 watchdog 或响应归一化
  • ./provider-resilience-admission-and-observability/SKILL.md — Navigate when: 调试重试、前台恢复、熔断、容量排队、Prompt Cache 断裂、费用或跨表面 Provider 状态

© echoVic, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .trae/knowledges/model-and-provider-runtime of echoVic/blade-code.

Open the folder on GitHubat commit 30f8684

Compare with similar skills

Knowledge Model And Provider Runtime next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Knowledge Model And Provider Runtime compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Knowledge Model And Provider Runtime this skillechoVic/blade-code180—~1.2kAutomated safety check: PassMIT
Orca CLIstablyai/orca87k2 repos~593Automated safety check: PassMIT
Beads Task Memorygastownhall/beads28k—~1.2kAutomated safety check: PassMIT
Session History Searchslopus/happy24k—~3.1kAutomated safety check: PassMIT
Paseo Agent Handoffgetpaseo/paseo20k1 repos~606Automated safety check: PassCustom licence
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: NotesCustom licence

Similar skills

  • Orca CLI

    stablyai/orca

    Operate Orca-managed worktrees, folder contexts, terminals, repos, automations, artifacts, skill sharing, worktree comments, and Orca's embedded browser…

    87k GitHub starsUsed in 2 repos~593 tokens
    Agent WorkflowsAuto-check passed
  • Beads Task Memory

    gastownhall/beads

    Tracks multi-session work with dependencies in the bd issue tracker so the agent can find ready tasks and recover its context after conversation compaction.

    28k GitHub stars~1.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Searches past Claude Code, Codex and Cursor sessions and summarizes what was worked on, tried or decided, using extraction scripts instead of reading raw logs.

    24k GitHub stars~3.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Paseo Agent Handoff

    getpaseo/paseo

    Hands off the current task, including context, decisions and failed attempts, to a fresh agent through Paseo by writing a self-contained briefing prompt and launching that agent.

    20k GitHub starsUsed in 1 repo~606 tokens
    Agent WorkflowsAuto-check passed
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.

    17k GitHub stars~2k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check: notes
  • Beads

    liwp/again

    A skill your agent uses when working in a repository that uses bd or Beads for durable project task tracking, issue dependencies, blocker management, multi-session handoff, or shared work memory.

    118 GitHub starsUsed in 6 repos~537 tokens
    Agent WorkflowsAuto-check passed

More from echoVic/blade-code

All 38 skills in this repo
  • Base64 Parser

    echoVic/blade-code

    Base64 编解码工具,支持编码/解码文本、JSON、二进制文件,自动检测格式,支持批量处理. An agent skill from echoVic/blade-code.

    180 GitHub stars~545 tokensUpdated 10 days ago
    Auto-check: notes
  • Code Review

    echoVic/blade-code

    Review frontend code for best practices, bugs, and improvements.

    180 GitHub stars~377 tokensUpdated 10 days ago
    Auto-check: notes
  • GitHub Explorer

    echoVic/blade-code

    Explore and summarize popular GitHub projects. An agent skill from echoVic/blade-code.

    180 GitHub stars~434 tokensUpdated 10 days ago
    Auto-check passed
  • 覆盖 Session 级 LSP 配置快照、stdio 进程、文档同步、语义查询、诊断回注、崩溃恢复 和子 Session 继承。进入条件:新增语言服务器、修改 LSP 工具、排查诊断缺失/重复、 处理 worktree 或 ACP 差异、修复进程泄漏或 transport 代际问题。不包含:VS Code 扩展桥接(见…

    180 GitHub stars~1.9k tokensUpdated 10 days ago
    Auto-check passed
  • 覆盖 SkillRegistry、SKILL.md 延迟加载、自定义命令 Markdown 解析、来源覆盖、插件 命名空间、Session 快照和模型/用户调用入口。进入条件:新增 Skill 或命令字段、调整 发现优先级、调试 /command 或 Skill 工具、修改 Prompt 元数据或消费者集成。不包含: 插件安装生命周期(见…

    180 GitHub stars~2.1k tokensUpdated 10 days ago
    Auto-check passed
  • Covers 领域能力如何包装成内置工具、getBuiltinTools 的 Session 依赖注入、ToolSearch 延迟激活,以及 Goal/Task/Team/Plan/Skill/LSP/MCP/Web/Config/Worktree 适配边界。

    180 GitHub stars~2.1k tokensUpdated 10 days ago
    Auto-check passed

Categories

Questions about Knowledge Model And Provider Runtime

What does Knowledge Model And Provider Runtime do?

覆盖 Blade 的模型目录、Provider 通道、pi-ai 请求适配以及恢复、准入和观测运行链. An agent skill from echoVic/blade-code. Knowledge Model And Provider Runtime is an agent skill from echoVic/blade-code. 覆盖 Blade 的模型目录、Provider 通道、pi-ai 请求适配以及恢复、准入和观测运行链。 Navigate when: 新增或切换模型与 Provider、调试请求负载或流事件、排查 fallback、重试、 熔断、排队、Prompt Cache 或费用问题。Excludes: Session 模型资源快照与 Workspace Trust(见 workspace-policy-and-shared-foundations/),Agent 轮次消费与压缩策略(见 agent-execution-and-orchestration/ 和 session-state-and-context/)。Keywords: PiAIChatService, PiModelCatalog, resolveModelConfig, provider retry, circuit breaker, admission, fallback, prompt cache, pricing.

When should I use Knowledge Model And Provider Runtime?

Knowledge Model And Provider Runtime fits situations like: tasks that involve Session handoff.

How do I install Knowledge Model And Provider Runtime in Claude Code?

Run `npx skills add echoVic/blade-code --skill knowledge-model-and-provider-runtime -a claude-code`. Or copy the skill folder (.trae/knowledges/model-and-provider-runtime in echoVic/blade-code) into .claude/skills/knowledge-model-and-provider-runtime in your project. Claude Code loads it when a task matches its description.

How do I install Knowledge Model And Provider Runtime in Codex?

Run `npx skills add echoVic/blade-code --skill knowledge-model-and-provider-runtime -a codex`. Or copy the skill folder (.trae/knowledges/model-and-provider-runtime in echoVic/blade-code) into .agents/skills/knowledge-model-and-provider-runtime in your project. Codex loads it when a task matches its description.

Can I use Knowledge Model And Provider Runtime in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add echoVic/blade-code --skill knowledge-model-and-provider-runtime -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/knowledge-model-and-provider-runtime, .gemini/skills/knowledge-model-and-provider-runtime, .github/skills/knowledge-model-and-provider-runtime and .opencode/skills/knowledge-model-and-provider-runtime in your project.

What does Knowledge Model And Provider Runtime need to run?

SKILL.md names no scripts, command-line tools or credentials: Knowledge Model And Provider Runtime is instructions for the agent only.

Does Knowledge Model And Provider Runtime access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Knowledge Model And Provider Runtime safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Knowledge Model And Provider Runtime use?

Knowledge Model And Provider Runtime is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Knowledge Model And Provider Runtime use?

About 1.2k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Knowledge Model And Provider Runtime?

Skills that share tags, products or a category with Knowledge Model And Provider Runtime: Orca CLI (stablyai/orca, 87k stars), Beads Task Memory (gastownhall/beads, 28k stars), Session History Search (slopus/happy, 24k stars) and Paseo Agent Handoff (getpaseo/paseo, 20k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Knowledge Model And Provider Runtime?

echoVic (a GitHub user) maintains it in echoVic/blade-code, which has 180 GitHub stars. The repository holds 38 skills in this directory. The repository was last updated on September 27, 2026.

Source: echoVic/blade-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.