mcpField
A
add-model-price

add-model-price

github.com/langfuseDevelopment36.7k99 installsUpdated today
Repository

About add-model-price

add-model-price is a repository skill for developers maintaining model pricing and selectable-model definitions in worker/ and packages/shared/. It provides task-specific references, validation scripts, and workflows for adding, updating, auditing, or retiring models.

Key features

  1. 01Guidance for adding model pricing
  2. 02Provider price and usage-key references
  3. 03Model matching pattern guidance
  4. 04Selectable-model lifecycle workflow
  5. 05Pricing and regex validation scripts

Use cases

  1. 01Add a newly priced model
  2. 02Update provider prices or pricing tiers
  3. 03Audit stale or missing default prices
  4. 04Remove retired models from selectable lists

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/langfuse/langfuse --skill add-model-price

After installing, type/add-model-pricein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
automated-audit.md
match-patterns.md
model-audit-memory.md
provider-sources-and-price-keys.md
provider-usage-key-matrix.md
schema-and-tiers.md
workflow-and-validation.md
scripts/
test-match-pattern.mjs
validate-pricing-file.mjs
validate-pricing-file.test.mjs

Details

From the project README

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

TopicRead this whenFile
Schema and tier rulesYou need the entry shape or pricing-tier invariantsreferences/schema-and-tiers.md
Provider sources and price keysYou need official pricing URLs, per-token conversion, or provider-specific usage keysreferences/provider-sources-and-price-keys.md
Provider usage-key matrixYou are adding or changing OpenAI, Gemini, Anthropic, or Bedrock usage keysreferences/provider-usage-key-matrix.md
Match patternsYou are editing matchPattern regexes or provider coveragereferences/match-patterns.md
Workflow and validationYou are applying the end-to-end edit process or checking common mistakesreferences/workflow-and-validation.md
Automated audit modeYou are running a scheduled/default-price audit and need CI-safe edit rulesreferences/automated-audit.md
Audit memoryYou need optional per-model context retained from a useful prior automated auditreferences/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

Comments

Markdown supported