diff --git a/skills_library/pipelines/platform_general/common/auto-api-pricing-config/SKILL.md b/skills_library/pipelines/platform_general/common/auto-api-pricing-config/SKILL.md index 60a1361..395df98 100644 --- a/skills_library/pipelines/platform_general/common/auto-api-pricing-config/SKILL.md +++ b/skills_library/pipelines/platform_general/common/auto-api-pricing-config/SKILL.md @@ -51,7 +51,8 @@ tools: [fetch_model_doc, extract_llm_api_spec, apply_llm_config, platform_llm_st 文档「元/百万tokens」直接落数值,「元/千tokens」×1000 换算 - **区间下界含 0 必须用 `=~`**(`0 =~ 128000`);`~=` 会排除 0 值导致计费为 0 - 键名是 `pricings`(复数);`unit_values` 只放实际用到的单位 -- 缓存价:阿里云系缓存命中 = 输入价 × 0.2(以文档为准);拆 `uncache_tokens`/`cached_tokens` 两个因子 +- 缓存价:**只有定价文档明确列出缓存命中价才配置**(拆 `uncache_tokens`/`cached_tokens` 两因子); + 文档没列缓存价就**不拆分**,全部输入按普通价计——禁止从输入价推导缓存价 - 模型名映射:API 返回带点版本号(`doubao-seedance-2.0`)而定价用连字符(`doubao-seedance-2-0`)时, 必须在 `model_mappings` 加映射,否则静默匹配失败 - YAML 布尔陷阱:过滤值 `no/yes/true/false` 必须加引号(`"no"`) diff --git a/skills_library/pipelines/platform_general/common/auto-api-pricing-config/references/pricing-patterns.md b/skills_library/pipelines/platform_general/common/auto-api-pricing-config/references/pricing-patterns.md index e32a34c..64e16b4 100644 --- a/skills_library/pipelines/platform_general/common/auto-api-pricing-config/references/pricing-patterns.md +++ b/skills_library/pipelines/platform_general/common/auto-api-pricing-config/references/pricing-patterns.md @@ -32,9 +32,11 @@ pricing_item(旧表,参考) spec_value / pricing_unit / pricing_amount / cost_a **禁止** `6e-06` 这种科学计数法——引擎会二次除法算错。 -## 模板 1:文本模型 token 计价(含缓存拆分) +## 模板 1:文本模型 token 计价(缓存拆分仅当文档明确列出缓存价) -阿里云系缓存命中 = 输入价 × 0.2(以文档为准)。真实样例(qwen3.7-max,限时5折后): +**缓存拆分不是默认行为**:只有定价文档明确给出缓存命中价时才拆 `uncache_tokens`/`cached_tokens` +两个因子;文档没提缓存价,全部输入按普通价计(单一 `prompt_tokens` 因子),禁止推导。 +真实样例(qwen3.7-max,文档明确列了三档价:输入/缓存命中/输出,限时5折后): ```yaml unit_values: @@ -59,7 +61,7 @@ pricings: unit: 百万 filters: [{model: qwen3.7-max}] - price_factors: cached_tokens - unit_prices: 1.2 # 缓存 = 6 × 0.2 + unit_prices: 1.2 # 缓存命中价——来自文档原文,非推导 unit: 百万 filters: [{model: qwen3.7-max}] - price_factors: completion_tokens diff --git a/skills_library/pipelines/platform_general/common/model-auto-config/SKILL.md b/skills_library/pipelines/platform_general/common/model-auto-config/SKILL.md index 5599157..1cdff38 100644 --- a/skills_library/pipelines/platform_general/common/model-auto-config/SKILL.md +++ b/skills_library/pipelines/platform_general/common/model-auto-config/SKILL.md @@ -26,7 +26,7 @@ tools: [fetch_model_doc, extract_llm_api_spec, apply_llm_config, platform_llm_st - **定价真实性**:文档没写价格的模型 → 价格填 `null` 并在 description 注明,绝不编数字。 - **单位换算**:元/百万tokens ÷ 1000 = 元/千tokens。 -- **缓存价**:支持 context caching 的,缓存价约 = 输入价 × 0.2(以文档为准)。 +- **缓存价**:仅当定价文档明确列出缓存命中价时记录;未列就不配置,禁止从输入价推导缓存价。 - **thinking 模式**:开源模型思考/非思考输出价不同且平台计费时无法区分 → 取较高(思考)价兜底,并在 description 注明。 - **协议限制**:非 `openai_compat` 的模型,模板会存档但运行时暂不可被产线调用, `apply` 返回的 `runtime_note` 必须如实转告用户。