@trazum/core 1.73.1 → 1.75.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.
package/README.md CHANGED
@@ -147,6 +147,32 @@ this module wrote: every finding a sum cannot support is listed in
147
147
  payload becomes a named `PullGap`, never a default of zero. Pure and
148
148
  browser-safe — the fetch, the credentials and the pagination live in the CLI.
149
149
 
150
+ ## The bill, from what is already on disk
151
+
152
+ `claudeCodeRecords(text, { label })` converts a Claude Code transcript into
153
+ usage-log records — the token counts and the model cross, the words never do,
154
+ and that absence is asserted by test rather than promised.
155
+ `looksLikeClaudeCodeTranscript(text)` detects one, so a mixed folder routes
156
+ itself. `otelRecords(text)` does the same for an OpenTelemetry export's GenAI
157
+ spans, and returns what it skipped beside what it converted — "1 LLM span
158
+ priced, 1 other ignored" is a different sentence from a bare total. Both are
159
+ pure and browser-safe; the web app's Bill tab runs them on a dropped folder.
160
+
161
+ ## Should we switch models?
162
+
163
+ `switchAnalysis(report, targetId, { catalogue, on, migrationUsd, evalCases })`
164
+ prices the decision a what-if only gestures at: the saving on the same tokens
165
+ (the sign is proven in both directions — a switch that costs money says so),
166
+ the break-even of a **declared** migration cost as division over the measured
167
+ days — refused by name (`no-saving`, `no-clock`) rather than approximated —
168
+ and the cost of the evaluation itself, three provider calls per case. Quality
169
+ is never in the result: the analysis defers to `route`, every time.
170
+ `ownRate({ gpuUsdPerHour, tokensPerSecond, utilization })` derives a
171
+ self-hosted $/MTok from your declared numbers — the one price source here
172
+ that is neither published nor bundled: it is your own measurement, and the
173
+ function refuses rather than defaults when a number is missing or out of
174
+ range.
175
+
150
176
  ## The store
151
177
 
152
178
  `resolveStore(records)` collapses an append-only log into the current truth:
@@ -230,6 +256,12 @@ result.pricingSource; // says which models came from the overlay, and its date
230
256
  A catalogue is a **value**: applying an overlay returns a new one and mutates
231
257
  nothing, so your prices never leak into another caller's report.
232
258
 
259
+ `openrouterOverlay(payload, { knownIds, lastReviewed })` turns an OpenRouter
260
+ `/models` response into that same overlay shape — models you already price are
261
+ left alone, and anything unreadable comes back in `skipped` with a reason
262
+ rather than vanishing. It is pure, so the browser can run it on a pasted
263
+ response; the CLI's `--pricing-live` is this function behind a fetch.
264
+
233
265
  ## Two entry points
234
266
 
235
267
  `@trazum/core` imports **no Node builtins** — enforced by a test that walks the
package/dist/index.d.ts CHANGED
@@ -89,6 +89,8 @@ export type { RepeatedTurns, RepeatsOptions, RepeatsTracker } from './repeats.js
89
89
  export { contextPressure } from './context-pressure.js';
90
90
  export type { ContextPressure, ContextPressureOptions } from './context-pressure.js';
91
91
  export { priceTokensOn, repriceProfile } from './reprice.js';
92
+ export { ownRate, switchAnalysis } from './switch.js';
93
+ export type { BreakEvenRefusal, SwitchAnalysis, SwitchOptions } from './switch.js';
92
94
  export type { OverContextSlice, RepriceReport, RepricedSlice } from './reprice.js';
93
95
  export { createSessionLedgerTracker, singleTurnCacheWrites } from './session-ledger.js';
94
96
  export { createSessionCostTracker, sessionCostShapes } from './session-cost.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,WAAW,EACX,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,UAAU,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAGlF,OAAO,EAAE,SAAS,EAAE,SAAS,EA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ACR,KAAK,GACN,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,MAAM,EACN,OAAO,EACP,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,WAAW,EACX,OAAO,EACP,IAAI,GACL,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -66,6 +66,7 @@ export { createTruncationRetryTracker, truncationRetries } from './truncation-re
66
66
  // See context-pressure.ts.
67
67
  export { contextPressure } from './context-pressure.js';
68
68
  export { priceTokensOn, repriceProfile } from './reprice.js';
69
+ export { ownRate, switchAnalysis } from './switch.js';
69
70
  export { createSessionLedgerTracker, singleTurnCacheWrites } from './session-ledger.js';
70
71
  // What one conversation costs — median and p95, exact. See session-cost.ts.
71
72
  export { createSessionCostTracker, sessionCostShapes } from './session-cost.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,WAAW,EACX,cAAc,EACd,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,UAAU,EACV,cAAc,EACd,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,GACT,MAAM,YAAY,CAAC;AAWpB,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAClF,gFAAgF;AAChF,4EAA4E;AAC5E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEtF,2EAA2E;AAC3E,+EAA+E;AAC/E,8EAA8E;AAC9E,0EAA0E;AAC1E,yCAAyC;AACzC,4EAA4E;AAC5E,qDAAqD;AACrD,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACx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BAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,WAAW,EACX,WAAW,EACX,UAAU,GACX,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,QAAQ,EACR,SAAS,EACT,MAAM,EACN,cAAc,EACd,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,KAAK,GACN,MAAM,YAAY,CAAC"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * The switching decision, priced — the 1.74 arc's second chapter.
3
+ *
4
+ * Every what-if reader is really asking one question: *should we move this
5
+ * traffic, and when does moving pay?* The what-if answers the first half as
6
+ * arithmetic; this answers the second half the only way this product allows:
7
+ *
8
+ * - the delta rests on `repriceProfile` — the same slice-by-slice move that
9
+ * already refuses over-context slices and cache traffic the target could
10
+ * not grant, so nothing here re-derives pricing;
11
+ * - break-even is **division on the past**: a declared migration cost over
12
+ * the measured daily rate of the saving, with the denominator (how many
13
+ * days were measured) attached. No growth is assumed, nothing is
14
+ * forecast — if the log carries no timestamps there is no rate, and the
15
+ * answer is a stated refusal rather than an invented calendar;
16
+ * - the evaluation the switch requires is itself priced, because the cost
17
+ * of *knowing* the cheaper model can do the work is part of the cost of
18
+ * switching: `trazum route` spends three provider calls per case (two on
19
+ * the incumbent, one on the candidate), priced here at this log's own
20
+ * mean call — an assumption, and a stated one.
21
+ *
22
+ * **What this never says: anything about quality.** Whether the target can
23
+ * do the work is `trazum route`'s verdict to measure, and every rendering
24
+ * of this document is expected to end by pointing there.
25
+ */
26
+ import type { PricingCatalogue } from './pricing.js';
27
+ import type { RepriceReport } from './reprice.js';
28
+ import type { UsageProfileReport } from './usage.js';
29
+ /** Why a break-even could not be computed. Absence is never silent. */
30
+ export type BreakEvenRefusal =
31
+ /** The reprice shows no saving — there is nothing for migration to recover. */
32
+ 'no-saving'
33
+ /** No record carried a timestamp, so the log has no measured rate. */
34
+ | 'no-clock';
35
+ export interface SwitchAnalysis {
36
+ schemaVersion: 1;
37
+ /** The slice-by-slice move this analysis rests on, verbatim. */
38
+ reprice: RepriceReport;
39
+ /**
40
+ * `currentUsd - targetUsd` over the movable slices: **positive means the
41
+ * switch saves.** Stated with its own name because `reprice.deltaUsd`
42
+ * carries the opposite convention (`target - current`, negative is
43
+ * cheaper), and a sign read across that boundary is exactly the class of
44
+ * defect that ships a break-even for a switch that loses money.
45
+ */
46
+ savingUsd: number;
47
+ /**
48
+ * Days the measured window spans, from the log's own first and last
49
+ * timestamps. Null when no record carried one — and then nothing below
50
+ * that needs a rate exists either.
51
+ */
52
+ measuredDays: number | null;
53
+ /** The saving as a daily rate over that window. Null with the window. */
54
+ dailySavingUsd: number | null;
55
+ /**
56
+ * Declared migration cost over the measured daily saving. Present only
57
+ * when a migration cost was declared; `refused` names why the division
58
+ * could not be made rather than leaving a hole.
59
+ */
60
+ breakEven: {
61
+ migrationUsd: number;
62
+ days: number;
63
+ } | {
64
+ migrationUsd: number;
65
+ refused: BreakEvenRefusal;
66
+ } | null;
67
+ /**
68
+ * What `trazum route` would cost on this traffic: per case, two calls on
69
+ * the incumbent mix and one on the target, each priced at this log's own
70
+ * mean movable call. Present only when a case count was declared —
71
+ * defaulting one would be inventing the size of somebody's test set.
72
+ */
73
+ evalCost: {
74
+ cases: number;
75
+ meanCurrentCallUsd: number;
76
+ meanTargetCallUsd: number;
77
+ totalUsd: number;
78
+ } | null;
79
+ }
80
+ export interface SwitchOptions {
81
+ catalogue: PricingCatalogue;
82
+ on?: Date;
83
+ /** What the reader says the migration itself costs. Declared, never guessed. */
84
+ migrationUsd?: number;
85
+ /** How many evaluation cases the reader would run. Declared, never guessed. */
86
+ evalCases?: number;
87
+ }
88
+ /**
89
+ * Null when the catalogue does not know the target — the same contract as
90
+ * `repriceProfile`, and for the same reason: a comparison against a price
91
+ * nobody has is worse than no comparison.
92
+ */
93
+ export declare function switchAnalysis(report: UsageProfileReport, targetId: string, options: SwitchOptions): SwitchAnalysis | null;
94
+ /**
95
+ * A self-hosted model's dollars per million tokens, derived from the
96
+ * operator's own two numbers — the 1.74 arc's third chapter.
97
+ *
98
+ * GPU dollars per hour over measured tokens per second, at a declared
99
+ * utilisation. Division, nothing else: no amortisation, no energy model, no
100
+ * guessed cluster efficiency — a calculator that estimated those would be an
101
+ * invented price wearing arithmetic's clothes. The result is only as honest
102
+ * as the throughput measurement it was given, which is why every rendering
103
+ * labels it derived-from-your-declaration.
104
+ */
105
+ export declare function ownRate(inputs: {
106
+ gpuUsdPerHour: number;
107
+ tokensPerSecond: number;
108
+ /** Fraction of the hour actually serving (0–1]. Defaults to 1. */
109
+ utilization?: number;
110
+ }): {
111
+ usdPerMTok: number;
112
+ };
113
+ //# sourceMappingURL=switch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../src/switch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAIrD,uEAAuE;AACvE,MAAM,MAAM,gBAAgB;AAC1B,+EAA+E;AAC7E,WAAW;AACb,sEAAsE;GACpE,UAAU,CAAC;AAEf,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,CAAC,CAAC;IACjB,gEAAgE;IAChE,OAAO,EAAE,aAAa,CAAC;IACvB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,yEAAyE;IACzE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;;OAIG;IACH,SAAS,EACL;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GACtC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,gBAAgB,CAAA;KAAE,GACnD,IAAI,CAAC;IACT;;;;;OAKG;IACH,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,kBAAkB,EAAE,MAAM,CAAC;QAC3B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,IAAI,CAAC;CACV;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,EAAE,CAAC,EAAE,IAAI,CAAC;IACV,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,kBAAkB,EAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,aAAa,GACrB,cAAc,GAAG,IAAI,CAoCvB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAQzB"}
package/dist/switch.js ADDED
@@ -0,0 +1,90 @@
1
+ /**
2
+ * The switching decision, priced — the 1.74 arc's second chapter.
3
+ *
4
+ * Every what-if reader is really asking one question: *should we move this
5
+ * traffic, and when does moving pay?* The what-if answers the first half as
6
+ * arithmetic; this answers the second half the only way this product allows:
7
+ *
8
+ * - the delta rests on `repriceProfile` — the same slice-by-slice move that
9
+ * already refuses over-context slices and cache traffic the target could
10
+ * not grant, so nothing here re-derives pricing;
11
+ * - break-even is **division on the past**: a declared migration cost over
12
+ * the measured daily rate of the saving, with the denominator (how many
13
+ * days were measured) attached. No growth is assumed, nothing is
14
+ * forecast — if the log carries no timestamps there is no rate, and the
15
+ * answer is a stated refusal rather than an invented calendar;
16
+ * - the evaluation the switch requires is itself priced, because the cost
17
+ * of *knowing* the cheaper model can do the work is part of the cost of
18
+ * switching: `trazum route` spends three provider calls per case (two on
19
+ * the incumbent, one on the candidate), priced here at this log's own
20
+ * mean call — an assumption, and a stated one.
21
+ *
22
+ * **What this never says: anything about quality.** Whether the target can
23
+ * do the work is `trazum route`'s verdict to measure, and every rendering
24
+ * of this document is expected to end by pointing there.
25
+ */
26
+ import { repriceProfile } from './reprice.js';
27
+ const DAY_MS = 86_400_000;
28
+ /**
29
+ * Null when the catalogue does not know the target — the same contract as
30
+ * `repriceProfile`, and for the same reason: a comparison against a price
31
+ * nobody has is worse than no comparison.
32
+ */
33
+ export function switchAnalysis(report, targetId, options) {
34
+ const { catalogue, on = new Date(), migrationUsd, evalCases } = options;
35
+ const reprice = repriceProfile(report, targetId, catalogue, on);
36
+ if (reprice === null)
37
+ return null;
38
+ // reprice's convention is `target - current` (negative is cheaper); the
39
+ // saving is its negation, named so no reader has to carry the sign.
40
+ const savingUsd = -reprice.deltaUsd;
41
+ const span = report.span;
42
+ const measuredDays = span === null ? null : Math.max(1, Math.ceil((span.toMs - span.fromMs) / DAY_MS));
43
+ const dailySavingUsd = measuredDays === null ? null : savingUsd / measuredDays;
44
+ let breakEven = null;
45
+ if (migrationUsd !== undefined) {
46
+ if (savingUsd <= 0)
47
+ breakEven = { migrationUsd, refused: 'no-saving' };
48
+ else if (dailySavingUsd === null)
49
+ breakEven = { migrationUsd, refused: 'no-clock' };
50
+ else
51
+ breakEven = { migrationUsd, days: migrationUsd / dailySavingUsd };
52
+ }
53
+ let evalCost = null;
54
+ const movableCalls = reprice.slices.reduce((sum, slice) => sum + slice.calls, 0);
55
+ if (evalCases !== undefined && evalCases > 0 && movableCalls > 0) {
56
+ const meanCurrentCallUsd = reprice.currentUsd / movableCalls;
57
+ const meanTargetCallUsd = reprice.targetUsd / movableCalls;
58
+ evalCost = {
59
+ cases: evalCases,
60
+ meanCurrentCallUsd,
61
+ meanTargetCallUsd,
62
+ // route's own bill: two calls on the incumbent, one on the candidate.
63
+ totalUsd: evalCases * (2 * meanCurrentCallUsd + meanTargetCallUsd),
64
+ };
65
+ }
66
+ return { schemaVersion: 1, reprice, savingUsd, measuredDays, dailySavingUsd, breakEven, evalCost };
67
+ }
68
+ /**
69
+ * A self-hosted model's dollars per million tokens, derived from the
70
+ * operator's own two numbers — the 1.74 arc's third chapter.
71
+ *
72
+ * GPU dollars per hour over measured tokens per second, at a declared
73
+ * utilisation. Division, nothing else: no amortisation, no energy model, no
74
+ * guessed cluster efficiency — a calculator that estimated those would be an
75
+ * invented price wearing arithmetic's clothes. The result is only as honest
76
+ * as the throughput measurement it was given, which is why every rendering
77
+ * labels it derived-from-your-declaration.
78
+ */
79
+ export function ownRate(inputs) {
80
+ const { gpuUsdPerHour, tokensPerSecond, utilization = 1 } = inputs;
81
+ if (!(gpuUsdPerHour > 0))
82
+ throw new Error('gpuUsdPerHour must be a positive number');
83
+ if (!(tokensPerSecond > 0))
84
+ throw new Error('tokensPerSecond must be a positive number');
85
+ if (!(utilization > 0 && utilization <= 1))
86
+ throw new Error('utilization must be greater than 0 and at most 1');
87
+ const tokensPerHour = tokensPerSecond * 3600 * utilization;
88
+ return { usdPerMTok: (gpuUsdPerHour / tokensPerHour) * 1_000_000 };
89
+ }
90
+ //# sourceMappingURL=switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.js","sourceRoot":"","sources":["../src/switch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,MAAM,MAAM,GAAG,UAAU,CAAC;AA6D1B;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,MAA0B,EAC1B,QAAgB,EAChB,OAAsB;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,6 +1,6 @@
1
1
  {
2
2
  "name": "@trazum/core",
3
- "version": "1.73.1",
3
+ "version": "1.75.0",
4
4
  "description": "Trazum core: priced advisories for LLM prompts (caching, model tier, batching, schemas), plus deterministic trimming, token counting and pricing.",
5
5
  "license": "MIT",
6
6
  "author": "David Mu\u00f1oz Rey",
package/src/index.ts CHANGED
@@ -324,6 +324,8 @@ export type { RepeatedTurns, RepeatsOptions, RepeatsTracker } from './repeats.js
324
324
  export { contextPressure } from './context-pressure.js';
325
325
  export type { ContextPressure, ContextPressureOptions } from './context-pressure.js';
326
326
  export { priceTokensOn, repriceProfile } from './reprice.js';
327
+ export { ownRate, switchAnalysis } from './switch.js';
328
+ export type { BreakEvenRefusal, SwitchAnalysis, SwitchOptions } from './switch.js';
327
329
  export type { OverContextSlice, RepriceReport, RepricedSlice } from './reprice.js';
328
330
  export { createSessionLedgerTracker, singleTurnCacheWrites } from './session-ledger.js';
329
331
  // What one conversation costs — median and p95, exact. See session-cost.ts.
package/src/switch.ts ADDED
@@ -0,0 +1,164 @@
1
+ /**
2
+ * The switching decision, priced — the 1.74 arc's second chapter.
3
+ *
4
+ * Every what-if reader is really asking one question: *should we move this
5
+ * traffic, and when does moving pay?* The what-if answers the first half as
6
+ * arithmetic; this answers the second half the only way this product allows:
7
+ *
8
+ * - the delta rests on `repriceProfile` — the same slice-by-slice move that
9
+ * already refuses over-context slices and cache traffic the target could
10
+ * not grant, so nothing here re-derives pricing;
11
+ * - break-even is **division on the past**: a declared migration cost over
12
+ * the measured daily rate of the saving, with the denominator (how many
13
+ * days were measured) attached. No growth is assumed, nothing is
14
+ * forecast — if the log carries no timestamps there is no rate, and the
15
+ * answer is a stated refusal rather than an invented calendar;
16
+ * - the evaluation the switch requires is itself priced, because the cost
17
+ * of *knowing* the cheaper model can do the work is part of the cost of
18
+ * switching: `trazum route` spends three provider calls per case (two on
19
+ * the incumbent, one on the candidate), priced here at this log's own
20
+ * mean call — an assumption, and a stated one.
21
+ *
22
+ * **What this never says: anything about quality.** Whether the target can
23
+ * do the work is `trazum route`'s verdict to measure, and every rendering
24
+ * of this document is expected to end by pointing there.
25
+ */
26
+
27
+ import type { PricingCatalogue } from './pricing.js';
28
+ import { repriceProfile } from './reprice.js';
29
+ import type { RepriceReport } from './reprice.js';
30
+ import type { UsageProfileReport } from './usage.js';
31
+
32
+ const DAY_MS = 86_400_000;
33
+
34
+ /** Why a break-even could not be computed. Absence is never silent. */
35
+ export type BreakEvenRefusal =
36
+ /** The reprice shows no saving — there is nothing for migration to recover. */
37
+ | 'no-saving'
38
+ /** No record carried a timestamp, so the log has no measured rate. */
39
+ | 'no-clock';
40
+
41
+ export interface SwitchAnalysis {
42
+ schemaVersion: 1;
43
+ /** The slice-by-slice move this analysis rests on, verbatim. */
44
+ reprice: RepriceReport;
45
+ /**
46
+ * `currentUsd - targetUsd` over the movable slices: **positive means the
47
+ * switch saves.** Stated with its own name because `reprice.deltaUsd`
48
+ * carries the opposite convention (`target - current`, negative is
49
+ * cheaper), and a sign read across that boundary is exactly the class of
50
+ * defect that ships a break-even for a switch that loses money.
51
+ */
52
+ savingUsd: number;
53
+ /**
54
+ * Days the measured window spans, from the log's own first and last
55
+ * timestamps. Null when no record carried one — and then nothing below
56
+ * that needs a rate exists either.
57
+ */
58
+ measuredDays: number | null;
59
+ /** The saving as a daily rate over that window. Null with the window. */
60
+ dailySavingUsd: number | null;
61
+ /**
62
+ * Declared migration cost over the measured daily saving. Present only
63
+ * when a migration cost was declared; `refused` names why the division
64
+ * could not be made rather than leaving a hole.
65
+ */
66
+ breakEven:
67
+ | { migrationUsd: number; days: number }
68
+ | { migrationUsd: number; refused: BreakEvenRefusal }
69
+ | null;
70
+ /**
71
+ * What `trazum route` would cost on this traffic: per case, two calls on
72
+ * the incumbent mix and one on the target, each priced at this log's own
73
+ * mean movable call. Present only when a case count was declared —
74
+ * defaulting one would be inventing the size of somebody's test set.
75
+ */
76
+ evalCost: {
77
+ cases: number;
78
+ meanCurrentCallUsd: number;
79
+ meanTargetCallUsd: number;
80
+ totalUsd: number;
81
+ } | null;
82
+ }
83
+
84
+ export interface SwitchOptions {
85
+ catalogue: PricingCatalogue;
86
+ on?: Date;
87
+ /** What the reader says the migration itself costs. Declared, never guessed. */
88
+ migrationUsd?: number;
89
+ /** How many evaluation cases the reader would run. Declared, never guessed. */
90
+ evalCases?: number;
91
+ }
92
+
93
+ /**
94
+ * Null when the catalogue does not know the target — the same contract as
95
+ * `repriceProfile`, and for the same reason: a comparison against a price
96
+ * nobody has is worse than no comparison.
97
+ */
98
+ export function switchAnalysis(
99
+ report: UsageProfileReport,
100
+ targetId: string,
101
+ options: SwitchOptions,
102
+ ): SwitchAnalysis | null {
103
+ const { catalogue, on = new Date(), migrationUsd, evalCases } = options;
104
+ const reprice = repriceProfile(report, targetId, catalogue, on);
105
+ if (reprice === null) return null;
106
+
107
+ // reprice's convention is `target - current` (negative is cheaper); the
108
+ // saving is its negation, named so no reader has to carry the sign.
109
+ const savingUsd = -reprice.deltaUsd;
110
+
111
+ const span = report.span;
112
+ const measuredDays =
113
+ span === null ? null : Math.max(1, Math.ceil((span.toMs - span.fromMs) / DAY_MS));
114
+ const dailySavingUsd = measuredDays === null ? null : savingUsd / measuredDays;
115
+
116
+ let breakEven: SwitchAnalysis['breakEven'] = null;
117
+ if (migrationUsd !== undefined) {
118
+ if (savingUsd <= 0) breakEven = { migrationUsd, refused: 'no-saving' };
119
+ else if (dailySavingUsd === null) breakEven = { migrationUsd, refused: 'no-clock' };
120
+ else breakEven = { migrationUsd, days: migrationUsd / dailySavingUsd };
121
+ }
122
+
123
+ let evalCost: SwitchAnalysis['evalCost'] = null;
124
+ const movableCalls = reprice.slices.reduce((sum, slice) => sum + slice.calls, 0);
125
+ if (evalCases !== undefined && evalCases > 0 && movableCalls > 0) {
126
+ const meanCurrentCallUsd = reprice.currentUsd / movableCalls;
127
+ const meanTargetCallUsd = reprice.targetUsd / movableCalls;
128
+ evalCost = {
129
+ cases: evalCases,
130
+ meanCurrentCallUsd,
131
+ meanTargetCallUsd,
132
+ // route's own bill: two calls on the incumbent, one on the candidate.
133
+ totalUsd: evalCases * (2 * meanCurrentCallUsd + meanTargetCallUsd),
134
+ };
135
+ }
136
+
137
+ return { schemaVersion: 1, reprice, savingUsd, measuredDays, dailySavingUsd, breakEven, evalCost };
138
+ }
139
+
140
+ /**
141
+ * A self-hosted model's dollars per million tokens, derived from the
142
+ * operator's own two numbers — the 1.74 arc's third chapter.
143
+ *
144
+ * GPU dollars per hour over measured tokens per second, at a declared
145
+ * utilisation. Division, nothing else: no amortisation, no energy model, no
146
+ * guessed cluster efficiency — a calculator that estimated those would be an
147
+ * invented price wearing arithmetic's clothes. The result is only as honest
148
+ * as the throughput measurement it was given, which is why every rendering
149
+ * labels it derived-from-your-declaration.
150
+ */
151
+ export function ownRate(inputs: {
152
+ gpuUsdPerHour: number;
153
+ tokensPerSecond: number;
154
+ /** Fraction of the hour actually serving (0–1]. Defaults to 1. */
155
+ utilization?: number;
156
+ }): { usdPerMTok: number } {
157
+ const { gpuUsdPerHour, tokensPerSecond, utilization = 1 } = inputs;
158
+ if (!(gpuUsdPerHour > 0)) throw new Error('gpuUsdPerHour must be a positive number');
159
+ if (!(tokensPerSecond > 0)) throw new Error('tokensPerSecond must be a positive number');
160
+ if (!(utilization > 0 && utilization <= 1))
161
+ throw new Error('utilization must be greater than 0 and at most 1');
162
+ const tokensPerHour = tokensPerSecond * 3600 * utilization;
163
+ return { usdPerMTok: (gpuUsdPerHour / tokensPerHour) * 1_000_000 };
164
+ }