[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69A8ENKJFF4N6K7K495MFVQ":3,"skill-same:01M69A8ENKJFF4N6K7K495MFVQ":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":17,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M69A8ENKJFF4N6K7K495MFVQ","cost-latency-analysis","模型时延与成本分析","How to compute model latency and estimated $ cost from PilotSwarm\ndata. Read this before calling a model \"slow\" or \"expensive\": most\nslowness is orchestration overhead, and a cost is a guess unless it\ncites a published price card.","如何根据 PilotSwarm 数据计算模型时延和预估美元($)成本。在判定某个模型“慢”或“贵”之前请先阅读本文:大多数延迟源于编排开销,而除非引用公开的价格表(price card),否则成本只是猜测。","microsoft\u002FPilotSwarm","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69A6RNK492A5JSNBTXANKX5",16,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fmgmt\u002Fskills\u002Fcost-latency-analysis\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BZTWSXAPNKVKA1N0JGMJK2","AI 模型评估与基准测试","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"cost latency analysis","analysis","cost","latency","orchestration","data","how","model","read","calling","compute","how to","price","card","it","overhead","2026-11-10 10:12:30",false,"---\nname: cost-latency-analysis\ndescription: |\n  How to compute model latency and estimated $ cost from PilotSwarm\n  data. Read this before calling a model \"slow\" or \"expensive\": most\n  slowness is orchestration overhead, and a cost is a guess unless it\n  cites a published price card.\n---\n\n# Cost & Latency Analysis\n\nYou are the **agent-manager**. When investigating reliability, cost, or\nperformance, follow this skill.\n\n## Latency: prefer `assistant.usage.duration`\n\nPilotSwarm records two different \"durations\" per turn. Do not confuse\nthem:\n\n| Source                                    | What it measures                                                                                       | When to use                                                                                                                    |\n| ----------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |\n| `runTurn` activity span (execution history) | Total wall-clock time the activity ran, including dehydrate, hydrate, snapshot, blob I\u002FO, scheduling. | Operator-facing \"how long did this turn take end-to-end\". Useful for orchestration-overhead investigations.                    |\n| `assistant.usage.duration` (assistant event)  | Time spent **inside the model call itself** as reported by the LLM provider.                          | **Model-latency comparisons.** The only fair number to use when comparing models, providers, or context sizes.                 |\n\n`runTurn` spans can materially overstate model latency — sometimes\n2–5× — because they include dehydrate\u002Fhydrate, snapshot serialization,\nblob storage round-trips, retry backoff, and tool-execution time.\n\n**Rule of thumb:**\n\n- Comparing \"is gpt-5.4 slower than gpt-5.4-mini?\" → use\n  `assistant.usage.duration`.\n- Investigating \"why does this turn take 30 seconds?\" when the model\n  number is small → look at the `runTurn` span and compare to the\n  assistant span. The delta is the orchestration overhead.\n\n### Where to read it from\n\n- Per-turn: `read_agent_events` filtered to `event_types: [\"assistant\"]`,\n  then read `usage.duration` (often in milliseconds — confirm units in\n  the actual payload, do not assume).\n- For roll-ups, request a derived field on the management surface and\n  expose it as a tool (see the **Observability Surface for the Agent\n  Tuner** rule in `.github\u002Fcopilot-instructions.md`). Do not summarize\n  latency by averaging `runTurn` spans — it will mislead.\n\n## Cost: estimate, do not guess\n\nToken counts come from `read_session_metric_summary` \u002F\n`read_fleet_stats` and are reliable. **Per-token prices change\nconstantly** and do not live in PilotSwarm. Always derive cost from a\n**linked, dated snapshot** of each provider's price card.\n\nDefault approach:\n\n1. Read the model name from the metric summary (or from the assistant\n   event's `model` field for per-turn cost).\n2. Look up the per-million-token input + output price from the\n   provider's published page (links below). Note the date you looked\n   it up.\n3. Cost = (`tokens_input` × $\u002FM-input + `tokens_output` × $\u002FM-output)\n   ÷ 1,000,000.\n4. If the model offers prompt caching (Claude, GPT-5.4 family), apply\n   the discounted cache-read rate to `tokens_cache_read`. Cache writes\n   are often billed at standard input rate.\n5. Report the price source and date alongside the dollar figure.\n\n### Stable price-card sources\n\nThese are the canonical pages to consult. Do not invent or memoize\nnumbers — re-fetch on each report.\n\n- **OpenAI (direct API):**\n  https:\u002F\u002Fopenai.com\u002Fapi\u002Fpricing\u002F\n- **Azure OpenAI Service (per-region pricing):**\n  https:\u002F\u002Fazure.microsoft.com\u002Fen-us\u002Fpricing\u002Fdetails\u002Fcognitive-services\u002Fopenai-service\u002F\n  (Azure OpenAI prices follow OpenAI list prices closely but are\n  region-specific and may differ for provisioned-throughput SKUs.)\n- **Azure AI Foundry \u002F model catalog (third-party models on Azure):**\n  https:\u002F\u002Fazure.microsoft.com\u002Fen-us\u002Fpricing\u002Fdetails\u002Fphi-3\u002F\n  https:\u002F\u002Fai.azure.com\u002Fexplore\u002Fmodels — open the specific model page\n  for its price card. Foundry-hosted models (FW-GLM-5, Kimi-K2.5, etc.)\n  use the per-deployment price shown on their model card.\n- **Anthropic (direct API):**\n  https:\u002F\u002Fwww.anthropic.com\u002Fpricing#api\n- **GitHub Copilot:** Copilot does not bill per token to the end user;\n  it bills per seat (Copilot Business \u002F Enterprise) and surfaces a\n  **premium-request quota** for premium models (Opus, GPT-5 class).\n  Do not report per-token dollar cost for `github-copilot:*` sessions.\n  Report **premium requests consumed** when known and link to the\n  current quota page:\n  https:\u002F\u002Fdocs.github.com\u002Fen\u002Fcopilot\u002Fmanaging-copilot\u002Fmanaging-copilot-as-an-individual-subscriber\u002Fabout-billing-for-github-copilot\n\n### Example\n\n```\nsession: 22013ffb\nmodel:   azure-openai:gpt-5.4\ntokens:  input 28,634   output 4,224   cache_read 16,700\nreport:\n  - input cost:       28634 × $X\u002FM = $...\n  - output cost:      4224  × $Y\u002FM = $...\n  - cache-read cost:  16700 × $Z\u002FM = $...\n  total ≈ $0.0XX  (price source: openai.com\u002Fapi\u002Fpricing, fetched \u003Cdate>)\n```\n\n## What to never do\n\n- Never quote a per-token dollar cost without naming the price source\n  and the date you fetched it.\n- Never compare model latency using `runTurn` spans alone.\n- Never claim Copilot per-token cost in dollars — Copilot pricing is\n  not per token.\n- Never average across mixed providers without tagging each row by\n  model and provider — you will average $30\u002FM-token Opus calls with\n  $0.10\u002FM-token nano calls and report a number that is meaningless.\n","# Cost & Latency Analysis\n\nYou are the **agent-manager**. When investigating reliability, cost, or\nperformance, follow this skill.\n\n## Latency: prefer `assistant.usage.duration`\n\nPilotSwarm records two different \"durations\" per turn. Do not confuse\nthem:\n\n| Source                                    | What it measures                                                                                       | When to use                                                                                                                    |\n| ----------------------------------------- | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |\n| `runTurn` activity span (execution history) | Total wall-clock time the activity ran, including dehydrate, hydrate, snapshot, blob I\u002FO, scheduling. | Operator-facing \"how long did this turn take end-to-end\". Useful for orchestration-overhead investigations.                    |\n| `assistant.usage.duration` (assistant event)  | Time spent **inside the model call itself** as reported by the LLM provider.                          | **Model-latency comparisons.** The only fair number to use when comparing models, providers, or context sizes.                 |\n\n`runTurn` spans can materially overstate model latency — sometimes\n2–5× — because they include dehydrate\u002Fhydrate, snapshot serialization,\nblob storage round-trips, retry backoff, and tool-execution time.\n\n**Rule of thumb:**\n\n- Comparing \"is gpt-5.4 slower than gpt-5.4-mini?\" → use\n  `assistant.usage.duration`.\n- Investigating \"why does this turn take 30 seconds?\" when the model\n  number is small → look at the `runTurn` span and compare to the\n  assistant span. The delta is the orchestration overhead.\n\n### Where to read it from\n\n- Per-turn: `read_agent_events` filtered to `event_types: [\"assistant\"]`,\n  then read `usage.duration` (often in milliseconds — confirm units in\n  the actual payload, do not assume).\n- For roll-ups, request a derived field on the management surface and\n  expose it as a tool (see the **Observability Surface for the Agent\n  Tuner** rule in `.github\u002Fcopilot-instructions.md`). Do not summarize\n  latency by averaging `runTurn` spans — it will mislead.\n\n## Cost: estimate, do not guess\n\nToken counts come from `read_session_metric_summary` \u002F\n`read_fleet_stats` and are reliable. **Per-token prices change\nconstantly** and do not live in PilotSwarm. Always derive cost from a\n**linked, dated snapshot** of each provider's price card.\n\nDefault approach:\n\n1. Read the model name from the metric summary (or from the assistant\n   event's `model` field for per-turn cost).\n2. Look up the per-million-token input + output price from the\n   provider's published page (links below). Note the date you looked\n   it up.\n3. Cost = (`tokens_input` × $\u002FM-input + `tokens_output` × $\u002FM-output)\n   ÷ 1,000,000.\n4. If the model offers prompt caching (Claude, GPT-5.4 family), apply\n   the discounted cache-read rate to `tokens_cache_read`. Cache writes\n   are often billed at standard input rate.\n5. Report the price source and date alongside the dollar figure.\n\n### Stable price-card sources\n\nThese are the canonical pages to consult. Do not invent or memoize\nnumbers — re-fetch on each report.\n\n- **OpenAI (direct API):**\n  https:\u002F\u002Fopenai.com\u002Fapi\u002Fpricing\u002F\n- **Azure OpenAI Service (per-region pricing):**\n  https:\u002F\u002Fazure.microsoft.com\u002Fen-us\u002Fpricing\u002Fdetails\u002Fcognitive-services\u002Fopenai-service\u002F\n  (Azure OpenAI prices follow OpenAI list prices closely but are\n  region-specific and may differ for provisioned-throughput SKUs.)\n- **Azure AI Foundry \u002F model catalog (third-party models on Azure):**\n  https:\u002F\u002Fazure.microsoft.com\u002Fen-us\u002Fpricing\u002Fdetails\u002Fphi-3\u002F\n  https:\u002F\u002Fai.azure.com\u002Fexplore\u002Fmodels — open the specific model page\n  for its price card. Foundry-hosted models (FW-GLM-5, Kimi-K2.5, etc.)\n  use the per-deployment price shown on their model card.\n- **Anthropic (direct API):**\n  https:\u002F\u002Fwww.anthropic.com\u002Fpricing#api\n- **GitHub Copilot:** Copilot does not bill per token to the end user;\n  it bills per seat (Copilot Business \u002F Enterprise) and surfaces a\n  **premium-request quota** for premium models (Opus, GPT-5 class).\n  Do not report per-token dollar cost for `github-copilot:*` sessions.\n  Report **premium requests consumed** when known and link to the\n  current quota page:\n  https:\u002F\u002Fdocs.github.com\u002Fen\u002Fcopilot\u002Fmanaging-copilot\u002Fmanaging-copilot-as-an-individual-subscriber\u002Fabout-billing-for-github-copilot\n\n### Example\n\n```\nsession: 22013ffb\nmodel:   azure-openai:gpt-5.4\ntokens:  input 28,634   output 4,224   cache_read 16,700\nreport:\n  - input cost:       28634 × $X\u002FM = $...\n  - output cost:      4224  × $Y\u002FM = $...\n  - cache-read cost:  16700 × $Z\u002FM = $...\n  total ≈ $0.0XX  (price source: openai.com\u002Fapi\u002Fpricing, fetched \u003Cdate>)\n```\n\n## What to never do\n\n- Never quote a per-token dollar cost without naming the price source\n  and the date you fetched it.\n- Never compare model latency using `runTurn` spans alone.\n- Never claim Copilot per-token cost in dollars — Copilot pricing is\n  not per token.\n- Never average across mixed providers without tagging each row by\n  model and provider — you will average $30\u002FM-token Opus calls with\n  $0.10\u002FM-token nano calls and report a number that is meaningless.\n",{"name":5,"description":7},"main","cecafe1ca7a9f2778a6166abdd12f6165d99f777","packages\u002Fsdk\u002Fplugins\u002Fmgmt\u002Fskills\u002Fcost-latency-analysis",10,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-15 00:36:04",{"source":9,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add microsoft\u002FPilotSwarm --skill cost-latency-analysis",{"tool":67,"command":68},"bunx","bunx skills add microsoft\u002FPilotSwarm --skill cost-latency-analysis",{"tool":70,"command":71},"pnpm","pnpm dlx skills add microsoft\u002FPilotSwarm --skill cost-latency-analysis","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fmgmt\u002Fskills\u002Fcost-latency-analysis\u002FSKILL.md",true,[75],{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"template.html","REFERENCE","参考文档",15680,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fplaywright\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fapi-review\u002Ftemplate.html",[82,90,97,104,111,118],{"skillNo":83,"name":84,"nameZh":17,"description":85,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":89},"01M760N7TCZBTY635MYZQ8YAB0","workflow-testing","Load before you test a Workflow with mocked effects — the test, test_respond and test_advance operations, fixtures, interception ids, valid answers, the virtual clock, test evidence and what a test run does not prove.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Ftest-mode-skills\u002Fworkflow-testing\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":91,"name":92,"nameZh":17,"description":93,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":89},"01M760N4RKD6BMYPGHD490SNN2","workflow-tools","Every argument of the Workflow tools, testing a revision, package definitions and the refusals you can fix. Load when a Workflow tool's short description is not enough.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-tools\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":17,"description":100,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":89},"01M760N1P2VTGVE6C4N5WF3FVR","workflow-reference","Field reference for Workflow YAML (root keys, every state type, bindings, outputs, runtime error codes), what the engine guarantees, and a review fan-out example. For design, call load_skill with name workflow-authoring.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-reference\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":17,"description":107,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":89},"01M760MZ5CFSAX4FYMEXZJBGM2","workflow-patterns","Load when one Workflow must run different nodes in its branches at the same time (a different prompt or model for each branch), or loops back to a state (a polling loop). Named branches, the router pattern, examples that compile.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-patterns\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":17,"description":114,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":89},"01M760MWKBDJFEECRFAF3BAVQ2","workflow-authoring","Load before you create, edit, publish or run a Workflow (pilotswarm.dev\u002Fv1) — choosing states, bounded graphs, bindings, typed contracts, agent and parallel states, the lifecycle and failure diagnosis.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-authoring\u002FSKILL.md",[],[],{"skillNo":119,"name":120,"nameZh":17,"description":121,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":89},"01M760MN4Y9199ARAY85DWD08X","tla-formal-validation","Required for any change to the core orchestrations (the durable session orchestration, session hydration and dehydration, and the Workflow controller and store). Teaches how to model the change in TLA+, update the existing models, run TLC with the repo runner, read the results, turn a counterexample into a fix and a regression test, and record the binding to the code.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftla-formal-validation\u002FSKILL.md",[],[]]