add-model-price
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAdd Model Price
添加模型定价
Purpose
目的
Guide for adding new LLM model pricing entries to Langfuse's default model prices configuration. This enables accurate cost tracking across different model providers and deployment platforms.
本指南介绍如何向Langfuse的默认模型价格配置中添加新的LLM模型定价条目,以便在不同模型供应商和部署平台之间实现精准的成本追踪。
When to Use This Skill
何时使用本技能
Automatically activates when:
- Adding a new model to the pricing database
- Updating model pricing information
- Working with
default-model-prices.json - Creating model matchPattern regex
- Configuring pricingTiers or tiered pricing
- Adding prices for Claude, OpenAI, Anthropic, Google, Gemini, AWS Bedrock, Azure, or Vertex AI models
在以下场景下自动启用:
- 向定价数据库添加新模型
- 更新模型定价信息
- 操作文件
default-model-prices.json - 创建模型matchPattern正则表达式
- 配置pricingTiers或分层定价
- 添加Claude、OpenAI、Anthropic、Google、Gemini、AWS Bedrock、Azure或Vertex AI模型的定价
Quick Start Checklist
快速入门检查清单
- Gather model info: Fetch official pricing from provider documentation URL
- Generate UUID: Run for the model entry ID (use lowercase)
uuidgen - Create matchPattern: Regex covering all provider formats
- Define pricingTiers: At minimum, one default tier with standard prices
- Add pricing entry: Insert into
/worker/src/constants/default-model-prices.json - Add to LLM types: Add model to (for playground/LLM-as-judge)
/packages/shared/src/server/llm/types.ts - Validate JSON: Run to verify syntax
jq . default-model-prices.json
- 收集模型信息:从供应商官方文档URL获取官方定价
- 生成UUID:运行命令生成模型条目ID(使用小写格式)
uuidgen - 创建matchPattern:编写覆盖所有供应商格式的正则表达式
- 定义pricingTiers:至少包含一个带有标准价格的默认层级
- 添加定价条目:将条目插入到文件中
/worker/src/constants/default-model-prices.json - 添加到LLM类型定义:将模型添加到(供Playground和LLM-as-judge使用)
/packages/shared/src/server/llm/types.ts - 验证JSON格式:运行命令验证语法正确性
jq . default-model-prices.json
File Location
文件位置
Target File:
/worker/src/constants/default-model-prices.jsonThis JSON file contains an array of model pricing definitions used for cost calculation.
目标文件:
/worker/src/constants/default-model-prices.json该JSON文件包含一组用于成本计算的模型定价定义。
Data Structure
数据结构
Complete Model Entry Schema
完整模型条目 Schema
json
{
"id": "uuid-generated-with-uuidgen",
"modelName": "model-name-identifier",
"matchPattern": "(?i)^regex-pattern$",
"createdAt": "ISO-8601-timestamp",
"updatedAt": "ISO-8601-timestamp",
"tokenizerConfig": null,
"tokenizerId": "claude|openai|null",
"pricingTiers": [
{
"id": "model-uuid_tier_default",
"name": "Standard",
"isDefault": true,
"priority": 0,
"conditions": [],
"prices": {
"input": 0.000005,
"output": 0.000025
}
}
]
}json
{
"id": "uuid-generated-with-uuidgen",
"modelName": "model-name-identifier",
"matchPattern": "(?i)^regex-pattern$",
"createdAt": "ISO-8601-timestamp",
"updatedAt": "ISO-8601-timestamp",
"tokenizerConfig": null,
"tokenizerId": "claude|openai|null",
"pricingTiers": [
{
"id": "model-uuid_tier_default",
"name": "Standard",
"isDefault": true,
"priority": 0,
"conditions": [],
"prices": {
"input": 0.000005,
"output": 0.000025
}
}
]
}Required Fields
必填字段
| Field | Type | Description |
|---|---|---|
| string | Unique UUID (use |
| string | Primary model identifier |
| string | Regex for matching model names |
| string | ISO-8601 timestamp |
| string | ISO-8601 timestamp |
| array | At least one pricing tier |
| 字段 | 类型 | 描述 |
|---|---|---|
| string | 唯一UUID(使用 |
| string | 主要模型标识符 |
| string | 用于匹配模型名称的正则表达式 |
| string | ISO-8601格式时间戳 |
| string | ISO-8601格式时间戳 |
| array | 至少包含一个定价层级 |
Optional Fields
可选字段
| Field | Type | Default | Description |
|---|---|---|---|
| string | null | "claude", "openai", or null |
| object | null | Custom tokenizer settings |
| 字段 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| string | null | 可选值为"claude"、"openai"或null |
| object | null | 自定义分词器设置 |
Pricing Tier Structure
定价层级结构
Default Tier (Required)
默认层级(必填)
Every model must have exactly one default tier:
json
{
"id": "{model-id}_tier_default",
"name": "Standard",
"isDefault": true,
"priority": 0,
"conditions": [],
"prices": { }
}Rules for Default Tier:
- : Must be
isDefaulttrue - : Must be
priority0 - : Must be empty array
conditions[]
每个模型必须恰好有一个默认层级:
json
{
"id": "{model-id}_tier_default",
"name": "Standard",
"isDefault": true,
"priority": 0,
"conditions": [],
"prices": { }
}默认层级规则:
- :必须设置为
isDefaulttrue - :必须设置为
priority0 - :必须为空数组
conditions[]
Additional Tiers (Optional)
附加层级(可选)
For usage-based pricing (e.g., large context pricing):
json
{
"id": "uuid-for-tier",
"name": "Large Context (>200K)",
"isDefault": false,
"priority": 1,
"conditions": [
{
"usageDetailPattern": "(input|prompt|cached)",
"operator": "gt",
"value": 200000,
"caseSensitive": false
}
],
"prices": { }
}Condition Operators: , , , , ,
gtgteltlteeqneq针对基于使用量的定价(例如大上下文定价):
json
{
"id": "uuid-for-tier",
"name": "Large Context (>200K)",
"isDefault": false,
"priority": 1,
"conditions": [
{
"usageDetailPattern": "(input|prompt|cached)",
"operator": "gt",
"value": 200000,
"caseSensitive": false
}
],
"prices": { }
}条件运算符:、、、、、
gtgteltlteeqneqGathering Pricing Information
收集定价信息
IMPORTANT: Always fetch pricing from official provider documentation. Never use heuristics or assumptions.
重要提示:始终从供应商官方文档获取定价信息,切勿使用推测或假设的数据。
Official Pricing Sources
官方定价来源
| Provider | URL |
|---|---|
| Anthropic Claude | https://platform.claude.com/docs/en/about-claude/pricing |
| OpenAI | https://openai.com/api/pricing/ |
| Google Gemini | https://ai.google.dev/pricing |
| AWS Bedrock | https://aws.amazon.com/bedrock/pricing/ |
| Azure OpenAI | https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/ |
| 供应商 | URL |
|---|---|
| Anthropic Claude | https://platform.claude.com/docs/en/about-claude/pricing |
| OpenAI | https://openai.com/api/pricing/ |
| Google Gemini | https://ai.google.dev/pricing |
| AWS Bedrock | https://aws.amazon.com/bedrock/pricing/ |
| Azure OpenAI | https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/ |
Required Information to Gather
需要收集的信息
- Base input token price (per MTok)
- Output token price (per MTok)
- Cache write price (if caching supported)
- Cache read price (if caching supported)
- Long context pricing (if different tiers exist)
- Model ID formats for all platforms (API, Bedrock, Vertex)
- 基础输入令牌价格(每百万令牌)
- 输出令牌价格(每百万令牌)
- 缓存写入价格(如果支持缓存)
- 缓存读取价格(如果支持缓存)
- 长上下文定价(如果存在不同层级)
- 所有平台的模型ID格式(API、Bedrock、Vertex)
Price Conversion
价格转换
Prices in the JSON are per token, not per million tokens.
| Provider Pricing | JSON Value | Calculation |
|---|---|---|
| $5 / MTok | | $5 / 1,000,000 |
| $25 / MTok | | $25 / 1,000,000 |
| $0.50 / MTok | | $0.50 / 1,000,000 |
| $6.25 / MTok | | $6.25 / 1,000,000 |
Formula: or
price_per_token = price_per_mtok / 1_000_000price_per_mtok * 1e-6JSON文件中的价格是每个令牌的价格,而非每百万令牌的价格。
| 供应商定价 | JSON值 | 计算方式 |
|---|---|---|
| $5 / 百万令牌 | | $5 / 1,000,000 |
| $25 / 百万令牌 | | $25 / 1,000,000 |
| $0.50 / 百万令牌 | | $0.50 / 1,000,000 |
| $6.25 / 百万令牌 | | $6.25 / 1,000,000 |
计算公式: 或
price_per_token = price_per_mtok / 1_000_000price_per_mtok * 1e-6Common Price Keys by Provider
各供应商常见价格键
Anthropic Claude Models
Anthropic Claude 模型
json
{
"input": <base_input_price>,
"input_tokens": <base_input_price>,
"output": <output_price>,
"output_tokens": <output_price>,
"cache_creation_input_tokens": <cache_write_price>,
"input_cache_creation": <cache_write_price>,
"cache_read_input_tokens": <cache_read_price>,
"input_cache_read": <cache_read_price>
}json
{
"input": <base_input_price>,
"input_tokens": <base_input_price>,
"output": <output_price>,
"output_tokens": <output_price>,
"cache_creation_input_tokens": <cache_write_price>,
"input_cache_creation": <cache_write_price>,
"cache_read_input_tokens": <cache_read_price>,
"input_cache_read": <cache_read_price>
}OpenAI Models
OpenAI 模型
json
{
"input": <input_price>,
"input_cached_tokens": <cached_input_price>,
"input_cache_read": <cached_input_price>,
"output": <output_price>
}json
{
"input": <input_price>,
"input_cached_tokens": <cached_input_price>,
"input_cache_read": <cached_input_price>,
"output": <output_price>
}Google Gemini Models
Google Gemini 模型
json
{
"input": <input_price>,
"input_modality_1": <input_price>,
"prompt_token_count": <input_price>,
"promptTokenCount": <input_price>,
"input_cached_tokens": <cached_price>,
"cached_content_token_count": <cached_price>,
"output": <output_price>,
"output_modality_1": <output_price>,
"candidates_token_count": <output_price>,
"candidatesTokenCount": <output_price>
}json
{
"input": <input_price>,
"input_modality_1": <input_price>,
"prompt_token_count": <input_price>,
"promptTokenCount": <input_price>,
"input_cached_tokens": <cached_price>,
"cached_content_token_count": <cached_price>,
"output": <output_price>,
"output_modality_1": <output_price>,
"candidates_token_count": <output_price>,
"candidatesTokenCount": <output_price>
}Match Pattern Examples
匹配模式示例
Anthropic Claude (API + Bedrock + Vertex)
Anthropic Claude(API + Bedrock + Vertex)
regex
(?i)^(anthropic\/)?(claude-opus-4-6|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-6-v1(:0)?|claude-opus-4-6)$Matches:
- (direct API)
claude-opus-4-6 - (with prefix)
anthropic/claude-opus-4-6 - (AWS Bedrock)
anthropic.claude-opus-4-6-v1:0 - (regional Bedrock)
us.anthropic.claude-opus-4-6-v1:0 - (GCP Vertex)
claude-opus-4-6
regex
(?i)^(anthropic\/)?(claude-opus-4-6|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-6-v1(:0)?|claude-opus-4-6)$匹配以下内容:
- (直接API调用格式)
claude-opus-4-6 - (带前缀格式)
anthropic/claude-opus-4-6 - (AWS Bedrock格式)
anthropic.claude-opus-4-6-v1:0 - (区域化Bedrock格式)
us.anthropic.claude-opus-4-6-v1:0 - (GCP Vertex格式)
claude-opus-4-6
With Version Date
带版本日期的模式
regex
(?i)^(anthropic\/)?(claude-opus-4-5-20251101|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-5-20251101-v1:0|claude-opus-4-5@20251101)$regex
(?i)^(anthropic\/)?(claude-opus-4-5-20251101|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-5-20251101-v1:0|claude-opus-4-5@20251101)$OpenAI
OpenAI
regex
(?i)^(openai\/)?(gpt-4o)$regex
(?i)^(openai\/)?(gpt-4o)$Google Gemini
Google Gemini
regex
(?i)^(google\/)?(gemini-2.5-pro)$regex
(?i)^(google\/)?(gemini-2.5-pro)$Pattern Components
模式组成部分
| Component | Purpose | Example |
|---|---|---|
| Case insensitive | Matches GPT-4o and gpt-4o |
| Full string match | Prevents partial matches |
| Optional provider prefix | |
| `(eu\.\ | us\.\ | apac\.)?` |
| Optional version suffix | Bedrock model versions |
| Vertex AI format | |
| 组件 | 用途 | 示例 |
|---|---|---|
| 不区分大小写 | 匹配GPT-4o和gpt-4o |
| 全字符串匹配 | 防止部分匹配 |
| 可选的供应商前缀 | |
| `(eu\.\ | us\.\ | apac\.)?` |
| 可选的版本后缀 | Bedrock模型版本 |
| Vertex AI格式 | |
Step-by-Step: Adding a New Model
分步指南:添加新模型
Step 1: Fetch Official Pricing
步骤1:获取官方定价
Use WebFetch to get pricing from official documentation:
WebFetch URL: https://platform.claude.com/docs/en/about-claude/pricing
Prompt: Extract pricing for [model name] including input, output, cache write, cache read prices per MTok使用WebFetch工具从官方文档获取定价信息:
WebFetch URL: https://platform.claude.com/docs/en/about-claude/pricing
Prompt: Extract pricing for [model name] including input, output, cache write, cache read prices per MTokStep 2: Generate UUID
步骤2:生成UUID
bash
uuidgenbash
uuidgenOutput: 13458BC0-1C20-44C2-8753-172F54B67647
输出示例: 13458BC0-1C20-44C2-8753-172F54B67647
Convert to lowercase: 13458bc0-1c20-44c2-8753-172f54b67647
转换为小写: 13458bc0-1c20-44c2-8753-172f54b67647
undefinedundefinedStep 3: Create the Entry
步骤3:创建条目
Example for a model with $5 input, $25 output, $6.25 cache write, $0.50 cache read:
json
{
"id": "13458bc0-1c20-44c2-8753-172f54b67647",
"modelName": "claude-opus-4-6",
"matchPattern": "(?i)^(anthropic\/)?(claude-opus-4-6|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-6-v1(:0)?|claude-opus-4-6)$",
"createdAt": "2026-02-09T00:00:00.000Z",
"updatedAt": "2026-02-09T00:00:00.000Z",
"tokenizerConfig": null,
"tokenizerId": "claude",
"pricingTiers": [
{
"id": "13458bc0-1c20-44c2-8753-172f54b67647_tier_default",
"name": "Standard",
"isDefault": true,
"priority": 0,
"conditions": [],
"prices": {
"input": 5e-6,
"input_tokens": 5e-6,
"output": 25e-6,
"output_tokens": 25e-6,
"cache_creation_input_tokens": 6.25e-6,
"input_cache_creation": 6.25e-6,
"cache_read_input_tokens": 0.5e-6,
"input_cache_read": 0.5e-6
}
}
]
}以下是一个模型的示例,输入价格为$5/百万令牌,输出为$25/百万令牌,缓存写入为$6.25/百万令牌,缓存读取为$0.50/百万令牌:
json
{
"id": "13458bc0-1c20-44c2-8753-172f54b67647",
"modelName": "claude-opus-4-6",
"matchPattern": "(?i)^(anthropic\/)?(claude-opus-4-6|(eu\\.|us\\.|apac\\.)?anthropic\\.claude-opus-4-6-v1(:0)?|claude-opus-4-6)$",
"createdAt": "2026-02-09T00:00:00.000Z",
"updatedAt": "2026-02-09T00:00:00.000Z",
"tokenizerConfig": null,
"tokenizerId": "claude",
"pricingTiers": [
{
"id": "13458bc0-1c20-44c2-8753-172f54b67647_tier_default",
"name": "Standard",
"isDefault": true,
"priority": 0,
"conditions": [],
"prices": {
"input": 5e-6,
"input_tokens": 5e-6,
"output": 25e-6,
"output_tokens": 25e-6,
"cache_creation_input_tokens": 6.25e-6,
"input_cache_creation": 6.25e-6,
"cache_read_input_tokens": 0.5e-6,
"input_cache_read": 0.5e-6
}
}
]
}Step 4: Insert Entry
步骤4:插入条目
Add the entry to the JSON array in .
/worker/src/constants/default-model-prices.jsonPlacement: Insert near related models (e.g., other Claude models together).
将该条目添加到文件的JSON数组中。
/worker/src/constants/default-model-prices.json放置位置:将其插入到相关模型附近(例如,与其他Claude模型放在一起)。
Step 5: Add to LLM Types (for Playground & LLM-as-Judge)
步骤5:添加到LLM类型定义(供Playground和LLM-as-judge使用)
To make the model available in the Langfuse playground and for LLM-as-a-judge evaluations, add it to the appropriate model array in .
/packages/shared/src/server/llm/types.tsFile:
/packages/shared/src/server/llm/types.tsModel Arrays by Provider:
- - Anthropic Claude models
anthropicModels - - OpenAI GPT models
openAIModels - - Google Vertex AI models
vertexAIModels - - Google AI Studio models
googleAIStudioModels
IMPORTANT: Do NOT add new models as the first entry in the array. The first entry is used as the default model for test LLM API calls, and newer models may not be available to all users yet.
Example for Anthropic:
typescript
export const anthropicModels = [
"claude-sonnet-4-5-20250929", // Keep existing first entry
"claude-haiku-4-5-20251001",
"claude-opus-4-6", // Add new model here (not first!)
"claude-opus-4-5-20251101",
// ... rest of models
] as const;要使模型在Langfuse Playground和LLM-as-judge评估中可用,请将其添加到文件中对应的模型数组中。
/packages/shared/src/server/llm/types.ts文件路径:
/packages/shared/src/server/llm/types.ts按供应商划分的模型数组:
- - Anthropic Claude模型
anthropicModels - - OpenAI GPT模型
openAIModels - - Google Vertex AI模型
vertexAIModels - - Google AI Studio模型
googleAIStudioModels
重要提示:请勿将新模型添加为数组的第一个条目。第一个条目用作测试LLM API调用的默认模型,而较新的模型可能尚未对所有用户开放。
Anthropic模型示例:
typescript
export const anthropicModels = [
"claude-sonnet-4-5-20250929", // 保留现有第一个条目
"claude-haiku-4-5-20251001",
"claude-opus-4-6", // 在此处添加新模型(不要放在第一个位置!)
"claude-opus-4-5-20251101",
// ... 其他模型
] as const;Step 6: Validate
步骤6:验证
bash
undefinedbash
undefinedCheck JSON syntax
检查JSON语法
jq . /path/to/default-model-prices.json > /dev/null && echo "Valid JSON"
jq . /path/to/default-model-prices.json > /dev/null && echo "Valid JSON"
Verify entry exists
验证条目是否存在
jq '.[] | select(.modelName == "claude-opus-4-6")' /path/to/default-model-prices.json
---jq '.[] | select(.modelName == "claude-opus-4-6")' /path/to/default-model-prices.json
---Multi-Tier Pricing Example
多层级定价示例
For models with long context pricing (e.g., different rates above 200K tokens):
json
{
"id": "uuid-here",
"modelName": "model-name",
"matchPattern": "...",
"pricingTiers": [
{
"id": "uuid-here_tier_default",
"name": "Standard",
"isDefault": true,
"priority": 0,
"conditions": [],
"prices": {
"input": 5e-6,
"output": 25e-6
}
},
{
"id": "uuid-for-large-context-tier",
"name": "Large Context (>200K)",
"isDefault": false,
"priority": 1,
"conditions": [
{
"usageDetailPattern": "(input|prompt|cached)",
"operator": "gt",
"value": 200000,
"caseSensitive": false
}
],
"prices": {
"input": 10e-6,
"output": 37.5e-6
}
}
]
}对于具有长上下文定价的模型(例如,令牌数超过200K时使用不同费率):
json
{
"id": "uuid-here",
"modelName": "model-name",
"matchPattern": "...",
"pricingTiers": [
{
"id": "uuid-here_tier_default",
"name": "Standard",
"isDefault": true,
"priority": 0,
"conditions": [],
"prices": {
"input": 5e-6,
"output": 25e-6
}
},
{
"id": "uuid-for-large-context-tier",
"name": "Large Context (>200K)",
"isDefault": false,
"priority": 1,
"conditions": [
{
"usageDetailPattern": "(input|prompt|cached)",
"operator": "gt",
"value": 200000,
"caseSensitive": false
}
],
"prices": {
"input": 10e-6,
"output": 37.5e-6
}
}
]
}Validation Rules
验证规则
The system validates pricing tiers with these rules:
- Exactly one default tier with
isDefault: true - Default tier must have and empty
priority: 0conditions: [] - Non-default tiers must have and at least one condition
priority > 0 - All priorities must be unique within a model
- All tier names must be unique within a model
- Each tier must have at least one price
- All tiers must have identical usage type keys
- Regex patterns must be valid and safe (no catastrophic backtracking)
系统使用以下规则验证定价层级:
- 恰好有一个默认层级,且
isDefault: true - 默认层级必须设置和空
priority: 0conditions: [] - 非默认层级必须设置且至少包含一个条件
priority > 0 - 所有优先级在一个模型内必须唯一
- 所有层级名称在一个模型内必须唯一
- 每个层级必须至少包含一个价格
- 所有层级必须具有相同的使用类型键
- 正则表达式模式必须有效且安全(无灾难性回溯)
Common Mistakes
常见错误
Using heuristics instead of official pricing:
json
// Wrong - assuming cache is 1.25x input
"cache_creation_input_tokens": input_price * 1.25
// Correct - use exact value from official docs
"cache_creation_input_tokens": 6.25e-6Incorrect Price Format:
json
// Wrong - using MTok price directly
"input": 5
// Correct - price per token
"input": 5e-6Missing Tier ID Suffix:
json
// Wrong
"id": "some-uuid"
// Correct for default tier
"id": "model-uuid_tier_default"Invalid Regex Escaping:
json
// Wrong - unescaped dots
"matchPattern": "anthropic.claude"
// Correct - escaped dots
"matchPattern": "anthropic\\.claude"使用推测而非官方定价:
json
// 错误 - 假设缓存价格是输入价格的1.25倍
"cache_creation_input_tokens": input_price * 1.25
// 正确 - 使用官方文档中的精确值
"cache_creation_input_tokens": 6.25e-6价格格式错误:
json
// 错误 - 直接使用每百万令牌的价格
"input": 5
// 正确 - 使用每个令牌的价格
"input": 5e-6缺少层级ID后缀:
json
// 错误
"id": "some-uuid"
// 正确的默认层级ID
"id": "model-uuid_tier_default"正则表达式转义错误:
json
// 错误 - 未转义点号
"matchPattern": "anthropic.claude"
// 正确 - 转义点号
"matchPattern": "anthropic\\.claude"Testing Model Matching
测试模型匹配
After adding a model, test that the regex matches expected inputs:
javascript
const pattern = new RegExp(matchPattern);
console.log(pattern.test("claude-opus-4-6")); // true
console.log(pattern.test("anthropic/claude-opus-4-6")); // true
console.log(pattern.test("anthropic.claude-opus-4-6-v1:0")); // true
console.log(pattern.test("us.anthropic.claude-opus-4-6-v1:0")); // true添加模型后,测试正则表达式是否能匹配预期输入:
javascript
const pattern = new RegExp(matchPattern);
console.log(pattern.test("claude-opus-4-6")); // true
console.log(pattern.test("anthropic/claude-opus-4-6")); // true
console.log(pattern.test("anthropic.claude-opus-4-6-v1:0")); // true
console.log(pattern.test("us.anthropic.claude-opus-4-6-v1:0")); // trueReference: Existing Model Entries
参考:现有模型条目
Look at these existing entries as templates:
| Model Type | Example Entry | Notes |
|---|---|---|
| Anthropic Claude | | Full multi-provider pattern |
| OpenAI GPT | | Simple pattern |
| Google Gemini | | Multi-tier with large context |
可以参考以下现有条目作为模板:
| 模型类型 | 示例条目 | 说明 |
|---|---|---|
| Anthropic Claude | | 完整的多供应商匹配模式 |
| OpenAI GPT | | 简单匹配模式 |
| Google Gemini | | 带长上下文的多层级定价 |
Related Files
相关文件
- Pricing JSON:
/worker/src/constants/default-model-prices.json - LLM Types: (model arrays for playground/LLM-as-judge)
/packages/shared/src/server/llm/types.ts - Validation:
/packages/shared/src/server/pricing-tiers/validation.ts - Matcher:
/packages/shared/src/server/pricing-tiers/matcher.ts - Tests:
/web/src/__tests__/async/model-pricing-tiers.servertest.ts
Skill Status: COMPLETE
Line Count: ~340 lines
- 定价JSON:
/worker/src/constants/default-model-prices.json - LLM类型定义:(供Playground和LLM-as-judge使用的模型数组)
/packages/shared/src/server/llm/types.ts - 验证逻辑:
/packages/shared/src/server/pricing-tiers/validation.ts - 匹配器:
/packages/shared/src/server/pricing-tiers/matcher.ts - 测试用例:
/web/src/__tests__/async/model-pricing-tiers.servertest.ts
技能状态:已完成
行数统计:约340行