sigmap 7.0.1 → 7.2.0

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.
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * SigMap pricing table — input-token $/Mtok assumptions for the `gain` dashboard.
5
+ *
6
+ * These are ASSUMPTIONS used only to translate "tokens saved" into an estimated
7
+ * dollar figure. They are deliberately conservative and configurable via
8
+ * --model <name> or config.pricingModel
9
+ * The `gain` views always print the model + rate inline so the $ is never
10
+ * presented as exact. Zero npm dependencies.
11
+ */
12
+
13
+ // USD per 1,000,000 input tokens.
14
+ const PRICES = {
15
+ 'claude-sonnet': 3.0,
16
+ 'claude-opus': 15.0,
17
+ 'claude-haiku': 0.8,
18
+ 'gpt-4o': 2.5,
19
+ 'gpt-4o-mini': 0.15,
20
+ 'gemini-1.5-pro': 1.25,
21
+ 'gemini-1.5-flash': 0.075,
22
+ };
23
+
24
+ const DEFAULT_MODEL = 'claude-sonnet';
25
+
26
+ /**
27
+ * Resolve a price (USD per token) for a model name.
28
+ * @param {string} [model]
29
+ * @returns {{ model: string, perMtok: number, perToken: number }}
30
+ */
31
+ function resolvePrice(model) {
32
+ const key = (model || DEFAULT_MODEL).toLowerCase();
33
+ const perMtok = PRICES[key] != null ? PRICES[key] : PRICES[DEFAULT_MODEL];
34
+ const resolved = PRICES[key] != null ? key : DEFAULT_MODEL;
35
+ return { model: resolved, perMtok, perToken: perMtok / 1_000_000 };
36
+ }
37
+
38
+ /** @returns {string[]} known model keys */
39
+ function listModels() {
40
+ return Object.keys(PRICES);
41
+ }
42
+
43
+ module.exports = { PRICES, DEFAULT_MODEL, resolvePrice, listModels };