Agent Skills › langfuse/langfuse › add-model-price

add-model-price

GitHub

管理LLM模型定价与类型配置,涵盖新增、更新及下线模型。涉及价格JSON编辑、TypeScript类型同步、正则匹配及官方文档审计,确保计费准确与数据一致性。

.agents/skills/add-model-price/SKILL.md langfuse/langfuse

Trigger Scenarios

新增或更新LLM模型定价 修改模型类型定义文件 下线已停用的模型 审计并修正过时的价格数据

Install

npx skills add langfuse/langfuse --skill add-model-price -g -y
More Options

Non-standard path

npx skills add https://github.com/langfuse/langfuse/tree/main/.agents/skills/add-model-price -g -y

Use without installing

npx skills use langfuse/langfuse@add-model-price

指定 Agent (Claude Code)

npx skills add langfuse/langfuse --skill add-model-price -a claude-code -g -y

安装 repo 全部 skill

npx skills add langfuse/langfuse --all -g -y

预览 repo 内 skill

npx skills add langfuse/langfuse --list

SKILL.md

Frontmatter
{
    "name": "add-model-price",
    "description": "Use when editing worker\/src\/constants\/default-model-prices.json, packages\/shared\/src\/server\/llm\/types.ts, pricing tiers, tokenizer IDs, or matchPattern regexes for OpenAI, Anthropic, Bedrock, Vertex, Azure, or Gemini model pricing."
}

Add Model Price

Use this skill for model pricing changes in worker/ and shared LLM type updates in packages/shared/.

When to Apply

  • Editing worker/src/constants/default-model-prices.json
  • Editing packages/shared/src/server/llm/types.ts
  • Adding a new priced model
  • Updating provider prices, cache pricing, or tier conditions
  • Expanding regex coverage for Bedrock, Vertex, Azure, or provider-prefixed model names
  • Auditing default model prices for stale, missing, or unmatched provider pricing
  • Auditing official provider docs for newly released major models that should receive default pricing and, when appropriate, selectable-model coverage
  • Removing retired or shut-down models from the selectable model lists

How to Read This Skill

  • Use this SKILL.md as the high-level workflow and helper index.
  • Open only the specific reference file that matches the task.

Quick Start Checklist

Adding a New Model

  • Gather official pricing from the provider documentation.
  • Generate a lowercase UUID for the model entry.
  • Create a matchPattern that covers supported provider formats.
  • Add at least one default pricing tier.
  • Write every per-token price as <USD per MTok>e-6 (0.1e-6, not 1e-7).
  • Map every supported semantic usage bucket to the provider aliases Langfuse may persist.
  • Insert the pricing entry into worker/src/constants/default-model-prices.json.
  • Update packages/shared/src/server/llm/types.ts if the model should be selectable in playground or evaluation flows.
  • Validate the JSON after editing.

Retiring a Selectable Model

  • Confirm the shutdown or retirement on the provider's official lifecycle page.
  • Remove the model from the selectable arrays in packages/shared/src/server/llm/types.ts so the model picker stops offering it.
  • Keep its entry in default-model-prices.json for historical cost lookups.
  • Do not reorder the arrays; if the first (default) entry retires, the next entry becomes the default.

Updating an Existing Model

  • Update the relevant prices, keys, tiers, or regexes.
  • Refresh updatedAt to today's ISO-8601 timestamp.
  • Validate the JSON after editing.

Reference Map

Topic Read this when File
Schema and tier rules You need the entry shape or pricing-tier invariants references/schema-and-tiers.md
Provider sources and price keys You need official pricing URLs, per-token conversion, or provider-specific usage keys references/provider-sources-and-price-keys.md
Provider usage-key matrix You are adding or changing OpenAI, Gemini, Anthropic, or Bedrock usage keys references/provider-usage-key-matrix.md
Match patterns You are editing matchPattern regexes or provider coverage references/match-patterns.md
Workflow and validation You are applying the end-to-end edit process or checking common mistakes references/workflow-and-validation.md
Automated audit mode You are running a scheduled/default-price audit and need CI-safe edit rules references/automated-audit.md
Audit memory You need optional per-model context retained from a useful prior automated audit references/model-audit-memory.md

Deterministic Helpers

  • Pricing file validator: node .agents/skills/add-model-price/scripts/validate-pricing-file.mjs
  • Match-pattern tester: node .agents/skills/add-model-price/scripts/test-match-pattern.mjs --model <modelName> --accept <sample...> --reject <sample...>
  • Direct regex tester: node .agents/skills/add-model-price/scripts/test-match-pattern.mjs --pattern '(?i)^(openai/)?(gpt-4o)$' --accept gpt-4o openai/gpt-4o --reject gpt-4o-mini

Version History

  • bde3073 Current 2026-10-20 05:13

    新增下线可选模型的处理流程;明确价格格式为USD/MTok的e-6标准;修复无动态正则时定位价格条目的逻辑。

  • f7e3c26 2026-08-20 17:46

Same Skill Collection

.agents/skills/add-to-dependabot-csv/SKILL.md
.agents/skills/agent-setup-maintenance/SKILL.md
.agents/skills/analyze-cloud-costs/SKILL.md
.agents/skills/backend-dev-guidelines/SKILL.md
.agents/skills/changelog-writing/SKILL.md
.agents/skills/clickhouse-best-practices/SKILL.md
.agents/skills/code-review/SKILL.md
.agents/skills/create-repo-agent/SKILL.md
.agents/skills/cursor-agents-workflow/SKILL.md
.agents/skills/datadog-query-recipes/SKILL.md
.agents/skills/debug-issue-with-datadog/SKILL.md
.agents/skills/frontend-browser-review/SKILL.md
.agents/skills/frontend-large-feature-architecture/SKILL.md
.agents/skills/git-workflow/SKILL.md
.agents/skills/grill-me/SKILL.md
.agents/skills/housekeeping/SKILL.md
.agents/skills/incident-alert-tickets/SKILL.md
.agents/skills/infra-scaling/SKILL.md
.agents/skills/langfuse-codebase-navigator/SKILL.md
.agents/skills/langfuse-previews/SKILL.md
.agents/skills/linear-agent-writes/SKILL.md
.agents/skills/linear-bug-triage/SKILL.md
.agents/skills/linear-context-handover/SKILL.md
.agents/skills/pnpm-upgrade-package/SKILL.md
.agents/skills/posthog-instrumentation/SKILL.md
.agents/skills/react-component-cleaner/SKILL.md
.agents/skills/react-component-guidelines/SKILL.md
.agents/skills/refactor-react-effects/SKILL.md
.agents/skills/security-review/SKILL.md
.agents/skills/seed-test-data/SKILL.md
.agents/skills/sentry-instrumentation/SKILL.md
.agents/skills/skill-creator/SKILL.md
.agents/skills/turborepo/SKILL.md
.agents/skills/weekly-production-review/SKILL.md
web/.agents/skills/vercel-composition-patterns/SKILL.md
web/.agents/skills/vercel-react-best-practices/SKILL.md
.agents/skills/linear-work-rhythm/SKILL.md
.agents/skills/storybook/SKILL.md

Metadata

Files
0
Version
bde3073
Hash
a8b52e67
Indexed
2026-08-20 17:46

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-21 15:42
浙ICP备14020137号-1