@trazum/cli 1.80.1 → 1.82.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 +1 -1
- package/dist/gateway-server.d.ts +38 -1
- package/dist/gateway-server.d.ts.map +1 -1
- package/dist/gateway-server.js +125 -9
- package/dist/gateway-server.js.map +1 -1
- package/dist/i18n/en.d.ts +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +437 -376
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +68 -5
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/types.d.ts +74 -6
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.d.ts +54 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +545 -55
- package/dist/index.js.map +1 -1
- package/dist/markdown.d.ts +10 -0
- package/dist/markdown.d.ts.map +1 -1
- package/dist/markdown.js +4 -4
- package/dist/markdown.js.map +1 -1
- package/package.json +2 -2
- package/src/gateway-server.ts +160 -9
- package/src/i18n/en.ts +454 -378
- package/src/i18n/es.ts +85 -7
- package/src/i18n/types.ts +76 -6
- package/src/index.ts +602 -54
- package/src/markdown.ts +14 -4
package/src/i18n/es.ts
CHANGED
|
@@ -48,6 +48,8 @@ ${bold('USO')}
|
|
|
48
48
|
trazum position <uso.jsonl>
|
|
49
49
|
trazum from-claude-code <fichero|dir> [--label <nombre>] [-o <fichero>]
|
|
50
50
|
trazum from-otel <fichero|dir> [--label-from-service] [-o <fichero>]
|
|
51
|
+
trazum from-litellm <fichero|dir> [-o <fichero>]
|
|
52
|
+
trazum from-helicone <fichero|dir> [-o <fichero>]
|
|
51
53
|
trazum switch <uso.jsonl> --to <modelo> [--migration-usd <n>] [--cases <n>]
|
|
52
54
|
trazum ownrate --gpu-usd-hour <n> --tokens-per-second <n> [--utilization <0-1>]
|
|
53
55
|
trazum pulse [--max-stale-hours <n>]
|
|
@@ -170,6 +172,31 @@ ${bold('OPCIONES DE ownrate')}
|
|
|
170
172
|
en trazum.config.json, de modo que el modelo que tú mismo sirves sea una
|
|
171
173
|
fila de primera en cada informe, tasado por ti y marcado como tal.
|
|
172
174
|
|
|
175
|
+
${bold('OPCIONES DE from-helicone')}
|
|
176
|
+
-o, --out <fichero> Escribe el log de uso ahí en vez de en stdout.
|
|
177
|
+
|
|
178
|
+
Un export de peticiones de Helicone, leído como un log de uso: modelo, marca
|
|
179
|
+
de tiempo, etiqueta y los recuentos de tokens de cada fila, y nada más. El
|
|
180
|
+
cuerpo de la petición, el de la respuesta y el id de usuario se quedan en la
|
|
181
|
+
fila. Se pone precio al modelo que respondió, y las filas respondidas por un
|
|
182
|
+
modelo distinto del pedido se cuentan. cache_enabled es una bandera y nunca
|
|
183
|
+
un reparto de tokens, así que los veredictos de caché dicen "no se puede
|
|
184
|
+
saber". Un request id es una llamada y nunca una conversación, así que los
|
|
185
|
+
registros no llevan sesión y los hallazgos de conversación no se pueden
|
|
186
|
+
responder desde este registro; se dice en cada ejecución.
|
|
187
|
+
|
|
188
|
+
${bold('OPCIONES DE from-litellm')}
|
|
189
|
+
-o, --out <fichero> Escribe el log de uso ahí en vez de en stdout.
|
|
190
|
+
|
|
191
|
+
Un spend log de LiteLLM, leído como un log de uso: modelo, marca de tiempo,
|
|
192
|
+
etiqueta, sesión y los recuentos de tokens de cada fila, y nada más. Los
|
|
193
|
+
mensajes, la respuesta, la clave con hash, la dirección del solicitante y el
|
|
194
|
+
usuario final se quedan en la fila. cache_hit es una bandera y nunca un
|
|
195
|
+
reparto de tokens, así que los veredictos de caché dicen "no se puede saber"
|
|
196
|
+
en vez de uno inventado. Las filas que no nombran modelo se cuentan y se
|
|
197
|
+
dejan fuera: model_group es una ruta, no un modelo. La cifra de gasto propia
|
|
198
|
+
de LiteLLM se imprime al lado de la de Trazum y nunca se funde con ella.
|
|
199
|
+
|
|
173
200
|
${bold('OPCIONES DE from-otel')}
|
|
174
201
|
--label-from-service Etiqueta cada registro con el nombre de servicio
|
|
175
202
|
de su span, para que salga una factura por
|
|
@@ -1088,10 +1115,14 @@ ${bold('EJEMPLOS')}
|
|
|
1088
1115
|
|
|
1089
1116
|
report: {
|
|
1090
1117
|
inputTokens: () => 'Tokens de entrada',
|
|
1091
|
-
estimated: (offFamily) =>
|
|
1092
|
-
offFamily === null
|
|
1093
|
-
|
|
1094
|
-
|
|
1118
|
+
estimated: (offFamily, band, measuredOff) => {
|
|
1119
|
+
if (offFamily === null) return ` (estimado, ±${band}%)`;
|
|
1120
|
+
return measuredOff === null
|
|
1121
|
+
? ` (estimado: el contador está calibrado sobre Claude, no sobre ${offFamily}, y nadie ha`
|
|
1122
|
+
+ ' medido cuánto se desvía ahí)'
|
|
1123
|
+
: ` (estimado: el contador está calibrado sobre Claude, no sobre ${offFamily}, donde se ha`
|
|
1124
|
+
+ ` medido hasta un ${measuredOff}% de desviación)`;
|
|
1125
|
+
},
|
|
1095
1126
|
exactCount: () => ' (recuento exacto)',
|
|
1096
1127
|
rulesApplied: () => 'Reglas aplicadas',
|
|
1097
1128
|
nothingToTrim: () => ' Ninguna regla ha encontrado nada que recortar.',
|
|
@@ -1724,6 +1755,46 @@ ${bold('EJEMPLOS')}
|
|
|
1724
1755
|
written: (file) => `Escrito ${file}.`,
|
|
1725
1756
|
},
|
|
1726
1757
|
|
|
1758
|
+
fromHelicone: {
|
|
1759
|
+
noPath: () =>
|
|
1760
|
+
'from-helicone necesita un export de peticiones o un directorio: trazum from-helicone requests.json',
|
|
1761
|
+
notFound: (path) => `${path}: no encontrado`,
|
|
1762
|
+
noExports: (path) =>
|
|
1763
|
+
`${path}: no hay exports .json/.jsonl/.ndjson dentro. Las peticiones de Helicone salen de su endpoint POST /v1/request/query, o del botón de exportar de la tabla de peticiones.`,
|
|
1764
|
+
summary: (files, rows) => `${files} archivo(s), ${rows} petición(es) leída(s).`,
|
|
1765
|
+
unnamedModel: (count) =>
|
|
1766
|
+
`${count} fila(s) no nombran modelo en ninguna de las tres columnas y no están en la salida: nada en la fila dice qué respondió, así que nada puede ponerle precio.`,
|
|
1767
|
+
disagreements: (count) =>
|
|
1768
|
+
`${count} fila(s) las respondió un modelo distinto del pedido. Se pone precio al que respondió, porque una factura va de lo que se facturó; el recuento está aquí para que una sustitución sea algo que ves y no algo que encuentras dentro de un total.`,
|
|
1769
|
+
noTokens: (count) =>
|
|
1770
|
+
`${count} fila(s) traían cero tokens en ambos lados: peticiones registradas a las que nadie puede poner precio. Se cuentan aquí y merecen un vistazo a Helicone.`,
|
|
1771
|
+
cacheFlagged: (count) =>
|
|
1772
|
+
`${count} fila(s) las sirvió la caché de Helicone. Eso es una bandera en la fila y nunca un reparto de tokens, así que los veredictos de caché dicen "no se puede saber" en este registro en vez de uno inventado.`,
|
|
1773
|
+
noSessions: () =>
|
|
1774
|
+
'Sin identidad de sesión: un request id de Helicone nombra una llamada, no una conversación, así que los hallazgos de conversación (caché desperdiciada en un solo turno, presión de contexto) no se pueden responder desde este registro. Hacer pasar un id por llamada como conversación reportaría cada llamada como una conversación de una.',
|
|
1775
|
+
unparseable: (count) => `${count} línea(s) no se pudieron leer como JSON.`,
|
|
1776
|
+
written: (file) => `Escrito ${file}.`,
|
|
1777
|
+
},
|
|
1778
|
+
|
|
1779
|
+
fromLiteLlm: {
|
|
1780
|
+
noPath: () =>
|
|
1781
|
+
'from-litellm necesita un export de spend log o un directorio: trazum from-litellm spend.json',
|
|
1782
|
+
notFound: (path) => `${path}: no encontrado`,
|
|
1783
|
+
noExports: (path) =>
|
|
1784
|
+
`${path}: no hay exports .json/.jsonl/.ndjson dentro. Los spend logs de LiteLLM salen de la tabla LiteLLM_SpendLogs, o de los endpoints /spend del propio proxy.`,
|
|
1785
|
+
summary: (files, rows) => `${files} archivo(s), ${rows} llamada(s) registrada(s) leída(s).`,
|
|
1786
|
+
unnamedModel: (count) =>
|
|
1787
|
+
`${count} fila(s) no nombran modelo y no están en la salida. "model_group" es el nombre de una ruta del proxy y detrás pueden ir varios modelos, así que poner precio a esas llamadas por la ruta que tomaron sería atribuir una cifra a algo que no describe.`,
|
|
1788
|
+
noTokens: (count) =>
|
|
1789
|
+
`${count} fila(s) traían cero tokens en ambos lados: llamadas registradas a las que nadie puede poner precio. Se cuentan aquí y merecen un vistazo al proxy.`,
|
|
1790
|
+
cacheFlagged: (count) =>
|
|
1791
|
+
`${count} fila(s) están marcadas como acierto de caché. LiteLLM lo registra como una bandera y nunca como un reparto de tokens, así que los veredictos de caché dicen "no se puede saber" en este registro en vez de uno inventado.`,
|
|
1792
|
+
reportedSpend: (usd) =>
|
|
1793
|
+
`LiteLLM puso precio a estas mismas llamadas en ${usd} con su propia tabla. Esa cifra no se funde con nada que calcule Trazum: sumar dos tablas de precios en un total es como un informe se vuelve callado y equivocado. Compáralas a propósito o no las compares.`,
|
|
1794
|
+
unparseable: (count) => `${count} línea(s) no se pudieron leer como JSON.`,
|
|
1795
|
+
written: (file) => `Escrito ${file}.`,
|
|
1796
|
+
},
|
|
1797
|
+
|
|
1727
1798
|
fromClaudeCode: {
|
|
1728
1799
|
noPath: () => 'from-claude-code necesita un archivo o directorio de transcripts: trazum from-claude-code ~/.claude/projects',
|
|
1729
1800
|
notFound: (path) => `${path}: no existe`,
|
|
@@ -1737,6 +1808,13 @@ ${bold('EJEMPLOS')}
|
|
|
1737
1808
|
labelled: () => 'Etiquetado por carpeta de proyecto. Usa --no-label-from-project para dejarlo sin etiqueta, o --label <nombre> para poner una.',
|
|
1738
1809
|
skipped: (other, unparseable, withoutUsage) => `Omitidas: ${other} línea(s) no-assistant (el resto del negocio del transcript), ${unparseable} imparseables, ${withoutUsage} línea(s) assistant sin usage.`,
|
|
1739
1810
|
written: (file) => `Escrito ${file}.`,
|
|
1811
|
+
stateNeedsFile: () =>
|
|
1812
|
+
'--state lee un transcript, no una carpeta: el estado ata un desplazamiento del transcript a una longitud del fichero de salida, y varios transcripts escribiendo en una sola salida no tienen una longitud así. Apúntalo al fichero .jsonl.',
|
|
1813
|
+
stateNeedsOut: () => '--state necesita --out: sin fichero de salida no hay nada contra lo que reanudar.',
|
|
1814
|
+
resumed: (skipped, offset) =>
|
|
1815
|
+
skipped === 0
|
|
1816
|
+
? `Transcript leído entero; punto de reanudación anotado en el byte ${offset}.`
|
|
1817
|
+
: `Reanudado en el byte ${skipped}, así que ${skipped} byte(s) no se releyeron. Siguiente punto de reanudación: byte ${offset}.`,
|
|
1740
1818
|
},
|
|
1741
1819
|
|
|
1742
1820
|
position: {
|
|
@@ -1950,8 +2028,8 @@ ${bold('EJEMPLOS')}
|
|
|
1950
2028
|
truncated: (shown) =>
|
|
1951
2029
|
`Mostrando las ${shown} más recientes. Usa --limit para ver más.`,
|
|
1952
2030
|
followedRename: (from) => `Se ha seguido un renombrado: las revisiones anteriores son ${from}.`,
|
|
1953
|
-
estimateNote: () =>
|
|
1954
|
-
|
|
2031
|
+
estimateNote: (band) =>
|
|
2032
|
+
`Los recuentos son estimaciones (±${band}% para texto de este tipo). Lo que importa es la tendencia, no las cifras absolutas.`,
|
|
1955
2033
|
},
|
|
1956
2034
|
|
|
1957
2035
|
languages: {
|
|
@@ -2170,7 +2248,7 @@ ${bold('EJEMPLOS')}
|
|
|
2170
2248
|
footer: (source, level) => `Recuento de tokens ${source} · nivel de reglas \`${level}\``,
|
|
2171
2249
|
pricingOverlaid: (count, lastReviewed) =>
|
|
2172
2250
|
`Los precios de ${count} ${count === 1 ? 'modelo' : 'modelos'} vienen de un overlay local revisado el ${lastReviewed}.`,
|
|
2173
|
-
sourceEstimated: () =>
|
|
2251
|
+
sourceEstimated: (band) => `estimado, ±${band}%`,
|
|
2174
2252
|
sourceExact: () => 'exacto',
|
|
2175
2253
|
measuringOptimised: () =>
|
|
2176
2254
|
'Se mide lo que dejarían las reglas, no lo que está escrito en el fichero.',
|
package/src/i18n/types.ts
CHANGED
|
@@ -127,10 +127,25 @@ export interface CliMessages {
|
|
|
127
127
|
report: {
|
|
128
128
|
inputTokens(): string;
|
|
129
129
|
/**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
* Where the input-token figure came from, and how far it can be trusted.
|
|
131
|
+
*
|
|
132
|
+
* Three cases, and the third is the one that took a measurement to earn.
|
|
133
|
+
* `band` is this text's own band, printed alone when the model is the family
|
|
134
|
+
* the estimator was calibrated on. `offFamily` names a tokenizer it was not
|
|
135
|
+
* measured on, and then the Claude band is dropped rather than annotated —
|
|
136
|
+
* a number qualified into meaninglessness is still read as a number.
|
|
137
|
+
* `measuredOff` is the worst error actually measured against that family's
|
|
138
|
+
* own counter, or null where nobody has run it: the difference between
|
|
139
|
+
* *this may be off* and *this was 94.5% off* is the difference between a
|
|
140
|
+
* hedge a reader discounts and one they act on.
|
|
141
|
+
*
|
|
142
|
+
* @param offFamily Provider name when the model is not the calibrated
|
|
143
|
+
* family, otherwise null.
|
|
144
|
+
* @param band This text's own measured band, as a percentage.
|
|
145
|
+
* @param measuredOff Worst measured error against that family's tokenizer,
|
|
146
|
+
* or null when it has never been measured.
|
|
147
|
+
*/
|
|
148
|
+
estimated(offFamily: string | null, band: number, measuredOff: number | null): string;
|
|
134
149
|
exactCount(): string;
|
|
135
150
|
rulesApplied(): string;
|
|
136
151
|
nothingToTrim(): string;
|
|
@@ -574,6 +589,48 @@ export interface CliMessages {
|
|
|
574
589
|
written(file: string): string;
|
|
575
590
|
};
|
|
576
591
|
|
|
592
|
+
/**
|
|
593
|
+
* `from-litellm` — the gateway a great many teams already put in front of
|
|
594
|
+
* every provider, so its spend log is the export most likely to already
|
|
595
|
+
* exist on somebody's disk.
|
|
596
|
+
*/
|
|
597
|
+
/**
|
|
598
|
+
* `from-helicone` — the proxy that keeps every request it saw, so a team
|
|
599
|
+
* using it already has the export.
|
|
600
|
+
*/
|
|
601
|
+
fromHelicone: {
|
|
602
|
+
noPath(): string;
|
|
603
|
+
notFound(path: string): string;
|
|
604
|
+
noExports(path: string): string;
|
|
605
|
+
summary(files: number, rows: number): string;
|
|
606
|
+
unnamedModel(count: number): string;
|
|
607
|
+
/** A proxy answered with a different model than was asked for. */
|
|
608
|
+
disagreements(count: number): string;
|
|
609
|
+
noTokens(count: number): string;
|
|
610
|
+
/** A cache flag is not a token split, and this says so rather than guessing. */
|
|
611
|
+
cacheFlagged(count: number): string;
|
|
612
|
+
/** Said once per run: a request id is one call, never a conversation. */
|
|
613
|
+
noSessions(): string;
|
|
614
|
+
unparseable(count: number): string;
|
|
615
|
+
written(file: string): string;
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
fromLiteLlm: {
|
|
619
|
+
noPath(): string;
|
|
620
|
+
notFound(path: string): string;
|
|
621
|
+
noExports(path: string): string;
|
|
622
|
+
summary(files: number, rows: number): string;
|
|
623
|
+
/** Rows naming no model: counted, never priced by the route they took. */
|
|
624
|
+
unnamedModel(count: number): string;
|
|
625
|
+
noTokens(count: number): string;
|
|
626
|
+
/** A cache flag is not a token split, and this says so rather than guessing. */
|
|
627
|
+
cacheFlagged(count: number): string;
|
|
628
|
+
/** LiteLLM's own figure, stated and never merged into Trazum's. */
|
|
629
|
+
reportedSpend(usd: string): string;
|
|
630
|
+
unparseable(count: number): string;
|
|
631
|
+
written(file: string): string;
|
|
632
|
+
};
|
|
633
|
+
|
|
577
634
|
fromClaudeCode: {
|
|
578
635
|
noPath(): string;
|
|
579
636
|
notFound(path: string): string;
|
|
@@ -589,6 +646,12 @@ export interface CliMessages {
|
|
|
589
646
|
labelled(): string;
|
|
590
647
|
skipped(other: number, unparseable: number, withoutUsage: number): string;
|
|
591
648
|
written(file: string): string;
|
|
649
|
+
/** `--state` was pointed at a folder, which it cannot resume. */
|
|
650
|
+
stateNeedsFile(): string;
|
|
651
|
+
/** `--state` with nowhere to append: the records were going to stdout. */
|
|
652
|
+
stateNeedsOut(): string;
|
|
653
|
+
/** How much of the transcript was skipped, and where the next run starts. */
|
|
654
|
+
resumed(skipped: number, offset: number): string;
|
|
592
655
|
};
|
|
593
656
|
|
|
594
657
|
position: {
|
|
@@ -765,7 +828,8 @@ export interface CliMessages {
|
|
|
765
828
|
goneAt(): string;
|
|
766
829
|
truncated(shown: number): string;
|
|
767
830
|
followedRename(from: string): string;
|
|
768
|
-
|
|
831
|
+
/** `band` is the widest band across the texts the trend covers. */
|
|
832
|
+
estimateNote(band: number): string;
|
|
769
833
|
};
|
|
770
834
|
|
|
771
835
|
/** `trazum doctor` — the survey across a whole workspace. */
|
|
@@ -877,7 +941,13 @@ export interface CliMessages {
|
|
|
877
941
|
truncated(): string;
|
|
878
942
|
footer(source: string, level: string): string;
|
|
879
943
|
pricingOverlaid(count: number, lastReviewed: string): string;
|
|
880
|
-
|
|
944
|
+
/**
|
|
945
|
+
* `band` is this text's own measured band, from `bandFor` in core.
|
|
946
|
+
*
|
|
947
|
+
* Never a constant again: the estimator is 6% out on prose and 33% out on
|
|
948
|
+
* a CSV ledger, so one figure printed on both was wrong about one of them.
|
|
949
|
+
*/
|
|
950
|
+
sourceEstimated(band: number): string;
|
|
881
951
|
sourceExact(): string;
|
|
882
952
|
measuringOptimised(): string;
|
|
883
953
|
metricTokens(before: string, after: string): string;
|