@paean-ai/harness-model-pricing 0.1.1-rc.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,46 @@
1
+ # Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
2
+ # section, a hash of its English and Chinese blocks outside code blocks and generated regions.
3
+ # After editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/paean/paean-model-pricing/README.md
5
+ /:
6
+ en: c775da8db172e8b4
7
+ zh: b51435667350d152
8
+ /paean-ai-harness-model-pricing:
9
+ en: 9d3cfe36aa5e3bf5
10
+ zh: c2566ebfe63c4b6d
11
+ /paean-ai-harness-model-pricing/summary:
12
+ en: 83f4f5040172b47c
13
+ zh: 2d9fa46665c02094
14
+ /paean-ai-harness-model-pricing/table-of-contents:
15
+ en: d152484eb41ac6b4
16
+ zh: 5b6bd00fce5371c3
17
+ /paean-ai-harness-model-pricing/use-this-package:
18
+ en: be02677b0b49def4
19
+ zh: 2f20e08350c5a0f5
20
+ /paean-ai-harness-model-pricing/use-this-package/when-to-choose-it:
21
+ en: eb98be763aa00326
22
+ zh: 2e52a91942262c45
23
+ /paean-ai-harness-model-pricing/use-this-package/minimal-configuration:
24
+ en: 6800e9ebb9109e09
25
+ zh: 7895c09c0897767f
26
+ /paean-ai-harness-model-pricing/use-this-package/default-market-prices:
27
+ en: 2257a68f22989c40
28
+ zh: c0f522b96a0f5493
29
+ /paean-ai-harness-model-pricing/understand-the-implementation:
30
+ en: 44951beb70440097
31
+ zh: 323b5aae5164000c
32
+ /paean-ai-harness-model-pricing/further-exploration:
33
+ en: cfa5e5b7d63961f6
34
+ zh: 19628d153da06493
35
+ /paean-ai-harness-model-pricing/model-experience:
36
+ en: 081f7b44f20df2e3
37
+ zh: 9bf9d69a93088c54
38
+ /paean-ai-harness-model-pricing/model-experience/kv-cache-effect:
39
+ en: f22f328f192145b0
40
+ zh: 63680de74364bb19
41
+ /paean-ai-harness-model-pricing/known-limitations-and-deferred-work:
42
+ en: bf945a9570ee8cc6
43
+ zh: 08202e32d8972b28
44
+ /paean-ai-harness-model-pricing/known-limitations-and-deferred-work/dev-note:
45
+ en: e67f633dc6fe7773
46
+ zh: 6c5f9788c6536776
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ ---
2
+ description: "Compare protocol-specific Praxis market prices and estimate measured session costs in USD."
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @paean-ai/harness-model-pricing
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ Read a compact session-cost estimate beside token statistics and open its floating request-cost breakdown. Settings → Model prices shows protocol-specific Praxis rates and the verification date without underlying model identities. Estimates use provider-reported usage, including recorded retry attempts and successful LLM compactions. Every account uses the trial mapping for estimation; server access permissions remain authoritative. Public market-price estimates do not represent a Paean invoice.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ The Paean bundle places the estimate on the same compact composer strip as token statistics and live progress. Hover or keyboard focus explains the estimate; click opens a viewport-contained cost breakdown without moving the composer. Escape or Close returns focus to the estimate, and an outside click dismisses the panel. Partial estimates carry an asterisk and identify requests missing usage or prices. Before any request is recorded, the estimate occupies no space. Settings → Model prices contains the complete price table, even without a session or credential.
29
+
30
+ ### When to choose it
31
+
32
+ Use these estimates to compare model experiments and cache savings. Keep the provider invoice or Paean account allowance as the authority for billed charges and available credits.
33
+
34
+ ### Minimal configuration
35
+
36
+ The Host composition needs the existing Settings and Session Projection services. Mount this plugin with its stable entry id so its browser half can read the standard configuration form.
37
+
38
+ ```yaml
39
+ - id: paean-model-pricing
40
+ name: '@paean-ai/harness-model-pricing'
41
+ ```
42
+
43
+ | Field | Default | Meaning |
44
+ |---|---|---|
45
+ | `sheet` | [Bundled price sheet](src/defaults.ts) | Live verification date, USD tariffs and provider/model mappings. |
46
+
47
+ The generated [configuration catalog](../../../docs/config-catalog.md) owns the accepted schema. Override `sheet` through standard plugin settings or the profile patch. A sheet edit revalues the existing measured usage without changing inference routing, permissions, or session messages. For GPT-6.1 Sol availability, change the OpenAI `praxis-flash` route's `card` from `gpt-6-sol` to `gpt-6.1-sol` when the backend route changes.
48
+
49
+ ### Default market prices
50
+
51
+ Prices were checked on 2026-10-02. Amounts below are USD per million tokens; GPT requests above 272,000 prompt tokens use the configured long-context rates for the complete request, including output.
52
+
53
+ | Tariff | Input | Cache read | Cache write | Output |
54
+ |---|---|---|---|---|
55
+ | DeepSeek V4.1 Flash | 0.30 | 0.006 | 0.30 | 1.20 |
56
+ | GPT-6 Sol | 2.00 | 0.20 | 2.50 | 10.00 |
57
+ | GPT-6.1 Sol | 2.00 | 0.10 | 2.50 | 10.00 |
58
+ | GPT-6 Astra | 10.00 | 1.00 | 12.50 | 50.00 |
59
+ | Claude Sonnet 5.5 | 2.00 | 0.20 | 2.50 | 10.00 |
60
+ | Claude Opus 5.5 | 4.00 | 0.20 | 5.00 | 20.00 |
61
+
62
+ Sources: [DeepSeek](https://api-docs.deepseek.com/quick_start/pricing/), [GPT-6 Sol](https://developers.openai.com/api/docs/models/gpt-6-sol), [GPT-6.1 Sol](https://developers.openai.com/api/docs/models/gpt-6.1-sol), [GPT-6 Astra](https://developers.openai.com/api/docs/models/gpt-6-astra), and [Vertex Claude](https://cloud.google.com/vertex-ai/generative-ai/pricing#claude_models).
63
+
64
+ DeepSeek uses peak public prices for both protocol routes, including the Ark route; its cache-write bucket uses the input rate. Claude uses Vertex global prices and five-minute cache writes. GPT uses Standard processing prices. The table does not apply off-peak discounts, regional premiums, private provider contracts, taxes or tool fees. The price sheet includes GPT-6.1 Sol for a later route update; the default OpenAI Flash estimate currently uses GPT-6 Sol.
65
+
66
+ -----
67
+
68
+ <a id="understand-the-implementation"></a>
69
+ ## Understand the implementation
70
+
71
+ <details>
72
+ <summary>Implementation internals — click to expand</summary>
73
+
74
+ The Host registers `paeanPricingUsage` through the existing Session Projection registry. The fold retains compact, request-attributed measured buckets from the whole session log, so paging and compaction do not remove previous costs. Each Assistant settlement represents one request, including surface-recovery retries that carry no provider retry event. The browser prices those facts with the current Settings form and contributes existing composer and Settings slots. The [decision note](../../../.agents/notes/implemented/feature/2026-10-02-paean-market-price-estimates.md) explains why prices stay outside durable usage and account authorization.
75
+
76
+ | Source | Responsibility |
77
+ |---|---|
78
+ | [defaults.ts](src/defaults.ts) | Public prices, sources and protocol mappings. |
79
+ | [projection.ts](src/projection.ts) | Measured request facts, including retry settlements. |
80
+ | [calculate.ts](src/calculate.ts) | Disjoint token-bucket pricing and long-context bands. |
81
+ | [client/index.ts](src/client/index.ts) | Localized, lifecycle-owned composer and Settings contributions. |
82
+
83
+ The estimate adds input, output, cache reads and cache writes once each. Reasoning tokens already belong to output. Unmapped routes, ambiguous mappings and absent or inconsistent usage increase the displayed unpriced count. Projection checkpoints contain measured request facts, not monetary prices; updating a tariff therefore requires no historical money migration.
84
+
85
+ </details>
86
+
87
+ -----
88
+
89
+ <a id="further-exploration"></a>
90
+ ## Further Exploration
91
+
92
+ - [Paean package map](../README.md) — edition composition.
93
+ - [Session Projection](../../session/session-projection/README.md) — whole-log delivery and cache lifecycle.
94
+ - [Settings](../../settings/settings/README.md) — validated live configuration.
95
+ - [Token meter](../../llm/token-meter/README.md) — provider usage and context occupancy.
96
+
97
+ <a id="model-experience"></a>
98
+ ## Model Experience
99
+
100
+ None, as this package derives human-visible price estimates from recorded usage and does not add model context.
101
+
102
+ #### KV Cache effect
103
+
104
+ None; price-sheet edits and rendering do not change provider requests or their cache prefixes.
105
+
106
+ ## Known Limitations and Deferred Work
107
+
108
+ <a id="known-limitations-and-deferred-work"></a>
109
+
110
+ The estimate has the following billing boundaries.
111
+
112
+ - **Market assumptions** — all accounts use the trial mappings even when the server routes ordinary users to DeepSeek. This comparison is intentional and does not grant trial access.
113
+ - **Usage coverage** — only settled requests recorded in this session contribute. Child sessions and failed compactions without reported usage are excluded. Missing usage or mappings produce a partial estimate.
114
+ - **Cache lifetime** — normalized usage does not distinguish five-minute and one-hour cache writes. The default Claude tariff assumes five minutes; deployments using one-hour caching must update the write rate.
115
+ - **Price freshness and size** — tariffs are maintained in plugin configuration, not fetched automatically. Historical usage is revalued at current prices. The compact request projection grows with the number of settled requests.
116
+
117
+ **Runtime invariant:** No companion is published. The Session Projection registry owns replay and cache consistency; this plugin has no independently mutable monetary ledger to reconcile.
118
+
119
+ <a id="dev-note"></a>
120
+ ### Dev Note
121
+
122
+ <details>
123
+ <summary>Working context for maintainers — click to expand</summary>
124
+
125
+ None.
126
+
127
+ </details>
package/README.zh.md ADDED
@@ -0,0 +1,127 @@
1
+ ---
2
+ description: "比较不同协议的 Praxis 市场价格,并按已计量用量估算会话美元成本。"
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @paean-ai/harness-model-pricing
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ 在 token 统计旁查看紧凑的会话成本估算,并打开浮层查看按请求汇总的费用。「设置 → 模型价格」展示不同协议的 Praxis 单价及核对日期,不显示底层模型身份。估算采用 provider 报告的用量,包括已记录的重试及成功的 LLM 压缩请求。所有账号统一按试验模型映射估算;实际访问权限仍由服务端决定。公开市场价格估算不代表 Paean 账单。
13
+
14
+ ## 目录
15
+
16
+ - [使用此包](#use-this-package)
17
+ - [理解实现](#understand-the-implementation)
18
+ - [延伸阅读](#further-exploration)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与后续工作](#known-limitations-and-deferred-work)
21
+ - [开发备注](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## 使用此包
27
+
28
+ Paean bundle 将估算金额、token 统计及实时进度放在同一条紧凑的输入框状态栏中。悬浮或键盘聚焦可查看估算说明;点击打开限制在窗口内的费用明细浮层,不改变输入框位置。Escape 或「关闭」将焦点返回估算按钮,点击外部关闭浮层。部分估算以星号标记,并说明缺少用量或价格的请求数。没有已记录请求时,估算不占空间。「设置 → 模型价格」保留完整价目表,无需先创建会话或配置凭证。
29
+
30
+ ### 何时选择
31
+
32
+ 使用估算比较模型试验成本和缓存节省。实际扣费及可用 credits 以 provider 账单或 Paean 账号额度为准。
33
+
34
+ ### 最小配置
35
+
36
+ Host 组合需包含现有 Settings 和 Session Projection 服务。使用固定入口 id 挂载插件,使浏览器端能够读取标准配置表单。
37
+
38
+ ```yaml
39
+ - id: paean-model-pricing
40
+ name: '@paean-ai/harness-model-pricing'
41
+ ```
42
+
43
+ | 字段 | 默认值 | 含义 |
44
+ |---|---|---|
45
+ | `sheet` | [随包价目表](src/defaults.ts) | 可实时更新的核对日期、美元价格和 provider/model 映射。 |
46
+
47
+ 生成的[配置目录](../../../docs/config-catalog.zh.md)定义接受的 schema。通过标准插件设置或 profile patch 覆盖 `sheet`。修改价目表会重新估算已有计量用量,不会改变推理路由、权限或会话消息。后端支持 GPT-6.1 Sol 并修改路由时,将 OpenAI `praxis-flash` 的 `card` 从 `gpt-6-sol` 改为 `gpt-6.1-sol`。
48
+
49
+ ### 默认市场价格
50
+
51
+ 价格核对日期为 2026-10-02。以下单位为美元 / 百万 token;GPT 单次请求的 prompt 超过 272,000 token 时,对整次请求应用配置中的长上下文价格,包括输出。
52
+
53
+ | 价目 | 输入 | 缓存读取 | 缓存写入 | 输出 |
54
+ |---|---|---|---|---|
55
+ | DeepSeek V4.1 Flash | 0.30 | 0.006 | 0.30 | 1.20 |
56
+ | GPT-6 Sol | 2.00 | 0.20 | 2.50 | 10.00 |
57
+ | GPT-6.1 Sol | 2.00 | 0.10 | 2.50 | 10.00 |
58
+ | GPT-6 Astra | 10.00 | 1.00 | 12.50 | 50.00 |
59
+ | Claude Sonnet 5.5 | 2.00 | 0.20 | 2.50 | 10.00 |
60
+ | Claude Opus 5.5 | 4.00 | 0.20 | 5.00 | 20.00 |
61
+
62
+ 来源:[DeepSeek](https://api-docs.deepseek.com/quick_start/pricing/)、[GPT-6 Sol](https://developers.openai.com/api/docs/models/gpt-6-sol)、[GPT-6.1 Sol](https://developers.openai.com/api/docs/models/gpt-6.1-sol)、[GPT-6 Astra](https://developers.openai.com/api/docs/models/gpt-6-astra) 和 [Vertex Claude](https://cloud.google.com/vertex-ai/generative-ai/pricing#claude_models)。
63
+
64
+ DeepSeek 两条协议路由均使用公开峰时价,包括 Ark 路由;缓存写入桶采用输入价。Claude 使用 Vertex global 价格及五分钟缓存写入价。GPT 使用 Standard 价格。价目表不计低峰优惠、区域溢价、provider 私有合同、税费或工具费用。价目表包含 GPT-6.1 Sol,供后续路由更新使用;当前 OpenAI Flash 默认按 GPT-6 Sol 估算。
65
+
66
+ -----
67
+
68
+ <a id="understand-the-implementation"></a>
69
+ ## 理解实现
70
+
71
+ <details>
72
+ <summary>实现内部机制 — 点击展开</summary>
73
+
74
+ Host 通过现有 Session Projection registry 注册 `paeanPricingUsage`。fold 保存完整会话日志中按请求归属的精简计量桶,因此历史分页和压缩不会移除此前成本。每次 Assistant 结算代表一次请求,包括不产生 provider 重试事件的上下文恢复重试。浏览器使用当前 Settings 表单计算金额,并占用现有输入框及 Settings slot。[决策记录](../../../.agents/notes/implemented/feature/2026-10-02-paean-market-price-estimates.zh.md)说明价格为何独立于持久化用量及账号授权。
75
+
76
+ | 来源 | 职责 |
77
+ |---|---|
78
+ | [defaults.ts](src/defaults.ts) | 公开价格、来源和协议映射。 |
79
+ | [projection.ts](src/projection.ts) | 已计量请求事实,包括重试结算。 |
80
+ | [calculate.ts](src/calculate.ts) | 独立 token 桶计价和长上下文档位。 |
81
+ | [client/index.ts](src/client/index.ts) | 本地化且随生命周期回收的输入框及 Settings 扩展。 |
82
+
83
+ 估算分别累计输入、输出、缓存读取及缓存写入,每个桶仅计算一次。推理 token 已包含在输出中。未映射路由、重复映射以及缺失或不一致的用量会增加界面的未计价请求数。Projection checkpoint 保存请求计量事实,不保存价格金额;更新价格无需迁移历史金额。
84
+
85
+ </details>
86
+
87
+ -----
88
+
89
+ <a id="further-exploration"></a>
90
+ ## 延伸阅读
91
+
92
+ - [Paean 包目录](../README.zh.md) — 发行版组合。
93
+ - [Session Projection](../../session/session-projection/README.zh.md) — 完整日志交付与缓存生命周期。
94
+ - [Settings](../../settings/settings/README.zh.md) — 经校验的实时配置。
95
+ - [Token meter](../../llm/token-meter/README.zh.md) — provider 用量和上下文占用。
96
+
97
+ <a id="model-experience"></a>
98
+ ## 模型体验
99
+
100
+ 无,因为此包从已记录用量派生供用户查看的价格估算,不添加模型上下文。
101
+
102
+ #### KV Cache 影响
103
+
104
+ 无;价目表更新和界面渲染不会改变 provider 请求或其缓存前缀。
105
+
106
+ ## 已知限制与后续工作
107
+
108
+ <a id="known-limitations-and-deferred-work"></a>
109
+
110
+ 估算具有以下计费边界。
111
+
112
+ - **市场假设** — 所有账号使用试验模型映射,即使服务端实际将普通用户路由至 DeepSeek。这是有意保留的比较方式,不会授予试验权限。
113
+ - **用量覆盖** — 仅统计本会话中已记录的结算请求。不含子会话,以及未报告用量的失败压缩。用量或映射缺失时显示部分估算。
114
+ - **缓存时长** — 标准化用量不区分五分钟和一小时缓存写入。Claude 默认按五分钟计价;使用一小时缓存的部署需更新写入单价。
115
+ - **价格时效和规模** — 价格由插件配置维护,不自动抓取。历史用量按当前价格重新估算。精简请求 projection 随结算请求数增长。
116
+
117
+ **运行时不变量:** 不发布 companion。Session Projection registry 负责回放和缓存一致性;此插件没有需要独立核对的可变金额账本。
118
+
119
+ <a id="dev-note"></a>
120
+ ### 开发备注
121
+
122
+ <details>
123
+ <summary>维护者工作背景 — 点击展开</summary>
124
+
125
+ 无。
126
+
127
+ </details>