@trazum/core 1.74.0 → 1.76.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 +32 -0
- package/package.json +1 -1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trazum/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.76.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",
|