@adaptic/lumic-utils 1.0.20 → 1.0.22
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/dist/{apollo-client.client-DRk6kygw.js → apollo-client.client-Bu5mc2I8.js} +4 -4
- package/dist/{apollo-client.client-DRk6kygw.js.map → apollo-client.client-Bu5mc2I8.js.map} +1 -1
- package/dist/{apollo-client.client-DVsbR05r.js → apollo-client.client-YzlpL7kf.js} +3 -3
- package/dist/{apollo-client.client-DVsbR05r.js.map → apollo-client.client-YzlpL7kf.js.map} +1 -1
- package/dist/{apollo-client.server-Djh4v__C.js → apollo-client.server-BTHAQqYl.js} +3 -3
- package/dist/{apollo-client.server-Djh4v__C.js.map → apollo-client.server-BTHAQqYl.js.map} +1 -1
- package/dist/{apollo-client.server-L8JR2ko_.js → apollo-client.server-sD1QteQO.js} +3 -3
- package/dist/{apollo-client.server-L8JR2ko_.js.map → apollo-client.server-sD1QteQO.js.map} +1 -1
- package/dist/{index-eU6Q74W8.js → index-B_4Q2noT.js} +2 -2
- package/dist/{index-eU6Q74W8.js.map → index-B_4Q2noT.js.map} +1 -1
- package/dist/{index-Cs56Fq24.js → index-CWx6sW9a.js} +2 -2
- package/dist/{index-Cs56Fq24.js.map → index-CWx6sW9a.js.map} +1 -1
- package/dist/{index-CSOg0U0R.js → index-DPaCMqua.js} +211 -23
- package/dist/{index-BVl0tRmx.js.map → index-DPaCMqua.js.map} +1 -1
- package/dist/{index-BVl0tRmx.js → index-DfuMX-MS.js} +211 -23
- package/dist/{index-CSOg0U0R.js.map → index-DfuMX-MS.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/test.cjs +1 -1
- package/dist/test.mjs +1 -1
- package/dist/types/functions/llm-config.d.ts +9 -1
- package/dist/types/types/openai-types.d.ts +95 -5
- package/dist/types/utils/llm-cost-tracker.d.ts +3 -0
- package/package.json +1 -1
|
@@ -79,6 +79,25 @@ const OPENAI_COMPATIBLE_PROVIDERS = {
|
|
|
79
79
|
* Supported models with their capabilities
|
|
80
80
|
*/
|
|
81
81
|
const SUPPORTED_MODELS = {
|
|
82
|
+
// ── OpenAI GPT-5.5 series (current flagship) ─────────────────────────
|
|
83
|
+
'gpt-5.5': {
|
|
84
|
+
provider: 'openai',
|
|
85
|
+
supportsTools: true,
|
|
86
|
+
supportsJson: true,
|
|
87
|
+
supportsStructuredOutput: true,
|
|
88
|
+
supportsDeveloperPrompt: true,
|
|
89
|
+
supportsTemperature: true,
|
|
90
|
+
isReasoningModel: false,
|
|
91
|
+
},
|
|
92
|
+
'gpt-5.5-pro': {
|
|
93
|
+
provider: 'openai',
|
|
94
|
+
supportsTools: true,
|
|
95
|
+
supportsJson: true,
|
|
96
|
+
supportsStructuredOutput: true,
|
|
97
|
+
supportsDeveloperPrompt: true,
|
|
98
|
+
supportsTemperature: true,
|
|
99
|
+
isReasoningModel: false,
|
|
100
|
+
},
|
|
82
101
|
// ── OpenAI GPT-5.4 series ────────────────────────────────────────────
|
|
83
102
|
'gpt-5.4': {
|
|
84
103
|
provider: 'openai',
|
|
@@ -201,6 +220,15 @@ const SUPPORTED_MODELS = {
|
|
|
201
220
|
isReasoningModel: true,
|
|
202
221
|
},
|
|
203
222
|
// ── Anthropic Claude models ──────────────────────────────────────────
|
|
223
|
+
'claude-opus-4-7': {
|
|
224
|
+
provider: 'anthropic',
|
|
225
|
+
supportsTools: true,
|
|
226
|
+
supportsJson: false,
|
|
227
|
+
supportsStructuredOutput: false,
|
|
228
|
+
supportsDeveloperPrompt: true,
|
|
229
|
+
supportsTemperature: true,
|
|
230
|
+
isReasoningModel: false,
|
|
231
|
+
},
|
|
204
232
|
'claude-opus-4-6': {
|
|
205
233
|
provider: 'anthropic',
|
|
206
234
|
supportsTools: true,
|
|
@@ -229,6 +257,24 @@ const SUPPORTED_MODELS = {
|
|
|
229
257
|
isReasoningModel: false,
|
|
230
258
|
},
|
|
231
259
|
// ── Deepseek models ──────────────────────────────────────────────────
|
|
260
|
+
'deepseek-v4-pro': {
|
|
261
|
+
provider: 'deepseek',
|
|
262
|
+
supportsTools: true,
|
|
263
|
+
supportsJson: true,
|
|
264
|
+
supportsStructuredOutput: false,
|
|
265
|
+
supportsDeveloperPrompt: true,
|
|
266
|
+
supportsTemperature: true,
|
|
267
|
+
isReasoningModel: true,
|
|
268
|
+
},
|
|
269
|
+
'deepseek-v4-flash': {
|
|
270
|
+
provider: 'deepseek',
|
|
271
|
+
supportsTools: true,
|
|
272
|
+
supportsJson: true,
|
|
273
|
+
supportsStructuredOutput: false,
|
|
274
|
+
supportsDeveloperPrompt: true,
|
|
275
|
+
supportsTemperature: true,
|
|
276
|
+
isReasoningModel: true,
|
|
277
|
+
},
|
|
232
278
|
'deepseek-chat': {
|
|
233
279
|
provider: 'deepseek',
|
|
234
280
|
supportsTools: true,
|
|
@@ -248,6 +294,24 @@ const SUPPORTED_MODELS = {
|
|
|
248
294
|
isReasoningModel: true,
|
|
249
295
|
},
|
|
250
296
|
// ── Kimi (Moonshot) models ───────────────────────────────────────────
|
|
297
|
+
'kimi-k2.6': {
|
|
298
|
+
provider: 'kimi',
|
|
299
|
+
supportsTools: true,
|
|
300
|
+
supportsJson: true,
|
|
301
|
+
supportsStructuredOutput: false,
|
|
302
|
+
supportsDeveloperPrompt: true,
|
|
303
|
+
supportsTemperature: true,
|
|
304
|
+
isReasoningModel: false,
|
|
305
|
+
},
|
|
306
|
+
'kimi-k2.5': {
|
|
307
|
+
provider: 'kimi',
|
|
308
|
+
supportsTools: true,
|
|
309
|
+
supportsJson: true,
|
|
310
|
+
supportsStructuredOutput: false,
|
|
311
|
+
supportsDeveloperPrompt: true,
|
|
312
|
+
supportsTemperature: true,
|
|
313
|
+
isReasoningModel: false,
|
|
314
|
+
},
|
|
251
315
|
'kimi-k2-0905-preview': {
|
|
252
316
|
provider: 'kimi',
|
|
253
317
|
supportsTools: true,
|
|
@@ -313,6 +377,33 @@ const SUPPORTED_MODELS = {
|
|
|
313
377
|
isReasoningModel: false,
|
|
314
378
|
},
|
|
315
379
|
// ── xAI Grok models ─────────────────────────────────────────────────
|
|
380
|
+
'grok-4.3': {
|
|
381
|
+
provider: 'xai',
|
|
382
|
+
supportsTools: true,
|
|
383
|
+
supportsJson: true,
|
|
384
|
+
supportsStructuredOutput: true,
|
|
385
|
+
supportsDeveloperPrompt: true,
|
|
386
|
+
supportsTemperature: true,
|
|
387
|
+
isReasoningModel: false,
|
|
388
|
+
},
|
|
389
|
+
'grok-4.20': {
|
|
390
|
+
provider: 'xai',
|
|
391
|
+
supportsTools: true,
|
|
392
|
+
supportsJson: true,
|
|
393
|
+
supportsStructuredOutput: true,
|
|
394
|
+
supportsDeveloperPrompt: true,
|
|
395
|
+
supportsTemperature: true,
|
|
396
|
+
isReasoningModel: false,
|
|
397
|
+
},
|
|
398
|
+
'grok-4.1-fast': {
|
|
399
|
+
provider: 'xai',
|
|
400
|
+
supportsTools: true,
|
|
401
|
+
supportsJson: true,
|
|
402
|
+
supportsStructuredOutput: true,
|
|
403
|
+
supportsDeveloperPrompt: true,
|
|
404
|
+
supportsTemperature: true,
|
|
405
|
+
isReasoningModel: false,
|
|
406
|
+
},
|
|
316
407
|
'grok-4': {
|
|
317
408
|
provider: 'xai',
|
|
318
409
|
supportsTools: true,
|
|
@@ -391,21 +482,41 @@ const SUPPORTED_MODELS = {
|
|
|
391
482
|
* Common model aliases that map to canonical model names
|
|
392
483
|
*/
|
|
393
484
|
const MODEL_ALIASES = {
|
|
394
|
-
|
|
395
|
-
'
|
|
396
|
-
|
|
485
|
+
// OpenAI aliases
|
|
486
|
+
'gpt-5.5-flagship': 'gpt-5.5',
|
|
487
|
+
// Anthropic aliases
|
|
488
|
+
'claude-opus-4.7': 'claude-opus-4-7',
|
|
489
|
+
'claude-opus-4.6': 'claude-opus-4-6',
|
|
490
|
+
'claude-sonnet-4.6': 'claude-sonnet-4-6',
|
|
491
|
+
'claude-haiku-4.5': 'claude-haiku-4-5',
|
|
492
|
+
'claude-4-opus': 'claude-opus-4-7',
|
|
397
493
|
'claude-4-sonnet': 'claude-sonnet-4-6',
|
|
398
494
|
'claude-4-haiku': 'claude-haiku-4-5',
|
|
495
|
+
'claude-4.7-opus': 'claude-opus-4-7',
|
|
496
|
+
'claude-4.6-opus': 'claude-opus-4-6',
|
|
497
|
+
// Deepseek aliases (legacy names route to V4 Flash thinking modes per DeepSeek migration policy)
|
|
498
|
+
'deepseek-r1': 'deepseek-reasoner',
|
|
499
|
+
'deepseek-v3': 'deepseek-chat',
|
|
500
|
+
'deepseek-v4': 'deepseek-v4-pro',
|
|
501
|
+
// xAI aliases
|
|
399
502
|
'grok-4-0709': 'grok-4',
|
|
503
|
+
'grok-3-fast': 'grok-4-fast-non-reasoning',
|
|
504
|
+
'grok-3-mini-fast': 'grok-3-mini',
|
|
505
|
+
'grok-4-3': 'grok-4.3',
|
|
506
|
+
'grok-4-20': 'grok-4.20',
|
|
507
|
+
// Gemini aliases
|
|
400
508
|
'gemini-pro': 'gemini-3.1-pro-preview',
|
|
401
509
|
'gemini-flash': 'gemini-3-flash-preview',
|
|
402
|
-
'
|
|
403
|
-
'
|
|
510
|
+
'gemini-3.1-pro': 'gemini-3.1-pro-preview',
|
|
511
|
+
'gemini-3-flash': 'gemini-3-flash-preview',
|
|
512
|
+
'gemini-3.1-flash-lite': 'gemini-3.1-flash-lite-preview',
|
|
513
|
+
// Kimi aliases
|
|
514
|
+
'moonshot-v1-auto': 'kimi-k2.6',
|
|
515
|
+
'kimi-k3': 'kimi-k2.6',
|
|
516
|
+
// Qwen aliases
|
|
404
517
|
'qwen-plus': 'qwen3.5-plus',
|
|
405
518
|
'qwen-max': 'qwen3-max',
|
|
406
519
|
'qwen-turbo': 'qwen3.5-flash',
|
|
407
|
-
'grok-3-fast': 'grok-4-fast-non-reasoning',
|
|
408
|
-
'grok-3-mini-fast': 'grok-3-mini',
|
|
409
520
|
};
|
|
410
521
|
/**
|
|
411
522
|
* Type guard to check if a string is a valid supported model
|
|
@@ -435,12 +546,12 @@ function getModelProvider(model) {
|
|
|
435
546
|
* Default model tiers per provider for use with LLM_MODEL_MINI/NORMAL/ADVANCED env vars
|
|
436
547
|
*/
|
|
437
548
|
const PROVIDER_DEFAULT_MODELS = {
|
|
438
|
-
openai: { mini: 'gpt-5.4-nano', normal: 'gpt-5.4-mini', advanced: 'gpt-5.
|
|
439
|
-
anthropic: { mini: 'claude-haiku-4-5', normal: 'claude-sonnet-4-6', advanced: 'claude-opus-4-
|
|
440
|
-
deepseek: { mini: 'deepseek-
|
|
441
|
-
kimi: { mini: 'kimi-k2-0905-preview', normal: 'kimi-k2
|
|
549
|
+
openai: { mini: 'gpt-5.4-nano', normal: 'gpt-5.4-mini', advanced: 'gpt-5.5' },
|
|
550
|
+
anthropic: { mini: 'claude-haiku-4-5', normal: 'claude-sonnet-4-6', advanced: 'claude-opus-4-7' },
|
|
551
|
+
deepseek: { mini: 'deepseek-v4-flash', normal: 'deepseek-v4-flash', advanced: 'deepseek-v4-pro' },
|
|
552
|
+
kimi: { mini: 'kimi-k2-0905-preview', normal: 'kimi-k2.5', advanced: 'kimi-k2.6' },
|
|
442
553
|
qwen: { mini: 'qwen3.5-flash', normal: 'qwen3.5-plus', advanced: 'qwen3-max' },
|
|
443
|
-
xai: { mini: 'grok-
|
|
554
|
+
xai: { mini: 'grok-4.1-fast', normal: 'grok-4-fast-non-reasoning', advanced: 'grok-4.3' },
|
|
444
555
|
gemini: { mini: 'gemini-3.1-flash-lite-preview', normal: 'gemini-3-flash-preview', advanced: 'gemini-3.1-pro-preview' },
|
|
445
556
|
};
|
|
446
557
|
|
|
@@ -748,62 +859,98 @@ const DEFAULT_DEVELOPER_PROMPT = `
|
|
|
748
859
|
Present complete, high-confidence, final answers only. Do not rephrase to be more brief or omit parts of answers.
|
|
749
860
|
Respond only with final content (e.g. code, a json or yaml object, a formatted string, or a markdown document) and nothing else. Do not reply with a preamble, introduction, or conclusion.
|
|
750
861
|
`;
|
|
751
|
-
/**
|
|
862
|
+
/**
|
|
863
|
+
* Token costs in USD per token. Last updated May 2026.
|
|
864
|
+
*
|
|
865
|
+
* `cacheHitCost` reflects OpenAI's cached-input billing rate (~50% of the
|
|
866
|
+
* standard input rate per OpenAI's prompt caching documentation). When set,
|
|
867
|
+
* `calculateCost` splits prompt tokens into cached vs non-cached buckets and
|
|
868
|
+
* applies the discount; when omitted, cached tokens are billed at full input
|
|
869
|
+
* rate (a silent ~50% cost overstatement for cache-friendly workloads).
|
|
870
|
+
*/
|
|
752
871
|
const openAiModelCosts = {
|
|
872
|
+
'gpt-5.5': {
|
|
873
|
+
inputCost: 5 / 1_000_000,
|
|
874
|
+
cacheHitCost: 2.5 / 1_000_000,
|
|
875
|
+
outputCost: 30 / 1_000_000,
|
|
876
|
+
},
|
|
877
|
+
'gpt-5.5-pro': {
|
|
878
|
+
inputCost: 30 / 1_000_000,
|
|
879
|
+
cacheHitCost: 15 / 1_000_000,
|
|
880
|
+
outputCost: 180 / 1_000_000,
|
|
881
|
+
},
|
|
753
882
|
'gpt-5.4': {
|
|
754
883
|
inputCost: 2.5 / 1_000_000,
|
|
884
|
+
cacheHitCost: 1.25 / 1_000_000,
|
|
755
885
|
outputCost: 15 / 1_000_000,
|
|
756
886
|
},
|
|
757
887
|
'gpt-5.4-mini': {
|
|
758
888
|
inputCost: 0.75 / 1_000_000,
|
|
889
|
+
cacheHitCost: 0.375 / 1_000_000,
|
|
759
890
|
outputCost: 4.5 / 1_000_000,
|
|
760
891
|
},
|
|
761
892
|
'gpt-5.4-nano': {
|
|
762
893
|
inputCost: 0.2 / 1_000_000,
|
|
894
|
+
cacheHitCost: 0.1 / 1_000_000,
|
|
763
895
|
outputCost: 1.25 / 1_000_000,
|
|
764
896
|
},
|
|
765
897
|
'gpt-5': {
|
|
766
898
|
inputCost: 2.5 / 1_000_000,
|
|
899
|
+
cacheHitCost: 1.25 / 1_000_000,
|
|
767
900
|
outputCost: 10 / 1_000_000,
|
|
768
901
|
},
|
|
769
902
|
'gpt-5-mini': {
|
|
770
903
|
inputCost: 0.15 / 1_000_000,
|
|
904
|
+
cacheHitCost: 0.075 / 1_000_000,
|
|
771
905
|
outputCost: 0.6 / 1_000_000,
|
|
772
906
|
},
|
|
773
907
|
'o1-mini': {
|
|
774
908
|
inputCost: 1.1 / 1_000_000,
|
|
909
|
+
cacheHitCost: 0.55 / 1_000_000,
|
|
775
910
|
outputCost: 4.4 / 1_000_000,
|
|
776
911
|
},
|
|
777
912
|
'o1': {
|
|
778
913
|
inputCost: 15 / 1_000_000,
|
|
914
|
+
cacheHitCost: 7.5 / 1_000_000,
|
|
779
915
|
outputCost: 60 / 1_000_000,
|
|
780
916
|
},
|
|
781
917
|
'o3-mini': {
|
|
782
918
|
inputCost: 1.1 / 1_000_000,
|
|
919
|
+
cacheHitCost: 0.55 / 1_000_000,
|
|
783
920
|
outputCost: 4.4 / 1_000_000,
|
|
784
921
|
},
|
|
785
922
|
'o3': {
|
|
786
923
|
inputCost: 2 / 1_000_000,
|
|
924
|
+
cacheHitCost: 1 / 1_000_000,
|
|
787
925
|
outputCost: 8 / 1_000_000,
|
|
788
926
|
},
|
|
789
927
|
'gpt-4.1': {
|
|
790
928
|
inputCost: 2 / 1_000_000,
|
|
929
|
+
cacheHitCost: 1 / 1_000_000,
|
|
791
930
|
outputCost: 8 / 1_000_000,
|
|
792
931
|
},
|
|
793
932
|
'gpt-4.1-mini': {
|
|
794
933
|
inputCost: 0.4 / 1_000_000,
|
|
934
|
+
cacheHitCost: 0.2 / 1_000_000,
|
|
795
935
|
outputCost: 1.6 / 1_000_000,
|
|
796
936
|
},
|
|
797
937
|
'gpt-4.1-nano': {
|
|
798
938
|
inputCost: 0.1 / 1_000_000,
|
|
939
|
+
cacheHitCost: 0.05 / 1_000_000,
|
|
799
940
|
outputCost: 0.4 / 1_000_000,
|
|
800
941
|
},
|
|
801
942
|
'o4-mini': {
|
|
802
943
|
inputCost: 1.1 / 1_000_000,
|
|
944
|
+
cacheHitCost: 0.55 / 1_000_000,
|
|
803
945
|
outputCost: 4.4 / 1_000_000,
|
|
804
946
|
},
|
|
805
947
|
};
|
|
806
948
|
const anthropicModelCosts = {
|
|
949
|
+
'claude-opus-4-7': {
|
|
950
|
+
inputCost: 5 / 1_000_000,
|
|
951
|
+
outputCost: 25 / 1_000_000,
|
|
952
|
+
cacheHitCost: 0.5 / 1_000_000,
|
|
953
|
+
},
|
|
807
954
|
'claude-opus-4-6': {
|
|
808
955
|
inputCost: 15 / 1_000_000,
|
|
809
956
|
outputCost: 75 / 1_000_000,
|
|
@@ -821,6 +968,16 @@ const anthropicModelCosts = {
|
|
|
821
968
|
},
|
|
822
969
|
};
|
|
823
970
|
const deepseekModelCosts = {
|
|
971
|
+
'deepseek-v4-pro': {
|
|
972
|
+
inputCost: 0.55 / 1_000_000,
|
|
973
|
+
cacheHitCost: 0.14 / 1_000_000,
|
|
974
|
+
outputCost: 2.19 / 1_000_000,
|
|
975
|
+
},
|
|
976
|
+
'deepseek-v4-flash': {
|
|
977
|
+
inputCost: 0.27 / 1_000_000,
|
|
978
|
+
cacheHitCost: 0.07 / 1_000_000,
|
|
979
|
+
outputCost: 1.1 / 1_000_000,
|
|
980
|
+
},
|
|
824
981
|
'deepseek-chat': {
|
|
825
982
|
inputCost: 0.27 / 1_000_000,
|
|
826
983
|
cacheHitCost: 0.07 / 1_000_000,
|
|
@@ -833,6 +990,14 @@ const deepseekModelCosts = {
|
|
|
833
990
|
},
|
|
834
991
|
};
|
|
835
992
|
const kimiModelCosts = {
|
|
993
|
+
'kimi-k2.6': {
|
|
994
|
+
inputCost: 0.74 / 1_000_000,
|
|
995
|
+
outputCost: 3.49 / 1_000_000,
|
|
996
|
+
},
|
|
997
|
+
'kimi-k2.5': {
|
|
998
|
+
inputCost: 0.44 / 1_000_000,
|
|
999
|
+
outputCost: 2 / 1_000_000,
|
|
1000
|
+
},
|
|
836
1001
|
'kimi-k2-0905-preview': {
|
|
837
1002
|
inputCost: 0.15 / 1_000_000,
|
|
838
1003
|
outputCost: 0.6 / 1_000_000,
|
|
@@ -865,6 +1030,21 @@ const qwenModelCosts = {
|
|
|
865
1030
|
},
|
|
866
1031
|
};
|
|
867
1032
|
const xaiModelCosts = {
|
|
1033
|
+
'grok-4.3': {
|
|
1034
|
+
inputCost: 1.25 / 1_000_000,
|
|
1035
|
+
outputCost: 2.5 / 1_000_000,
|
|
1036
|
+
cacheHitCost: 0.31 / 1_000_000,
|
|
1037
|
+
},
|
|
1038
|
+
'grok-4.20': {
|
|
1039
|
+
inputCost: 2 / 1_000_000,
|
|
1040
|
+
outputCost: 6 / 1_000_000,
|
|
1041
|
+
cacheHitCost: 0.5 / 1_000_000,
|
|
1042
|
+
},
|
|
1043
|
+
'grok-4.1-fast': {
|
|
1044
|
+
inputCost: 0.2 / 1_000_000,
|
|
1045
|
+
outputCost: 0.5 / 1_000_000,
|
|
1046
|
+
cacheHitCost: 0.05 / 1_000_000,
|
|
1047
|
+
},
|
|
868
1048
|
'grok-4': {
|
|
869
1049
|
inputCost: 3 / 1_000_000,
|
|
870
1050
|
outputCost: 15 / 1_000_000,
|
|
@@ -891,16 +1071,16 @@ const xaiModelCosts = {
|
|
|
891
1071
|
};
|
|
892
1072
|
const geminiModelCosts = {
|
|
893
1073
|
'gemini-3.1-pro-preview': {
|
|
894
|
-
inputCost:
|
|
895
|
-
outputCost:
|
|
1074
|
+
inputCost: 2 / 1_000_000,
|
|
1075
|
+
outputCost: 12 / 1_000_000,
|
|
896
1076
|
},
|
|
897
1077
|
'gemini-3-flash-preview': {
|
|
898
|
-
inputCost: 0.
|
|
899
|
-
outputCost:
|
|
1078
|
+
inputCost: 0.5 / 1_000_000,
|
|
1079
|
+
outputCost: 3 / 1_000_000,
|
|
900
1080
|
},
|
|
901
1081
|
'gemini-3.1-flash-lite-preview': {
|
|
902
|
-
inputCost: 0.
|
|
903
|
-
outputCost:
|
|
1082
|
+
inputCost: 0.25 / 1_000_000,
|
|
1083
|
+
outputCost: 1.5 / 1_000_000,
|
|
904
1084
|
},
|
|
905
1085
|
};
|
|
906
1086
|
/**
|
|
@@ -1874,7 +2054,10 @@ class LLMCostTracker {
|
|
|
1874
2054
|
timestamp: Date.now(),
|
|
1875
2055
|
};
|
|
1876
2056
|
this.usageRecords.push(record);
|
|
1877
|
-
|
|
2057
|
+
// Emit cachedTokens and reasoningTokens explicitly so operators can
|
|
2058
|
+
// verify cache effectiveness from logs alone (the prior log shape only
|
|
2059
|
+
// surfaced inputTokens and outputTokens, hiding the cache discount).
|
|
2060
|
+
getLumicLogger().info(`LLM cost tracked: ${provider}/${model} - $${cost.toFixed(6)}`, { provider, model, inputTokens, cachedTokens: cacheHitTokens, outputTokens, reasoningTokens, cost });
|
|
1878
2061
|
}
|
|
1879
2062
|
/**
|
|
1880
2063
|
* Records usage from an image generation call.
|
|
@@ -1955,11 +2138,13 @@ class LLMCostTracker {
|
|
|
1955
2138
|
const images = this.getImageCosts();
|
|
1956
2139
|
let totalCost = 0;
|
|
1957
2140
|
let totalInputTokens = 0;
|
|
2141
|
+
let totalCacheHitTokens = 0;
|
|
1958
2142
|
let totalOutputTokens = 0;
|
|
1959
2143
|
let totalReasoningTokens = 0;
|
|
1960
2144
|
for (const summary of Object.values(byModel)) {
|
|
1961
2145
|
totalCost += summary.totalCost;
|
|
1962
2146
|
totalInputTokens += summary.totalInputTokens;
|
|
2147
|
+
totalCacheHitTokens += summary.totalCacheHitTokens;
|
|
1963
2148
|
totalOutputTokens += summary.totalOutputTokens;
|
|
1964
2149
|
totalReasoningTokens += summary.totalReasoningTokens;
|
|
1965
2150
|
}
|
|
@@ -1976,6 +2161,7 @@ class LLMCostTracker {
|
|
|
1976
2161
|
totalCost,
|
|
1977
2162
|
totalCalls: this.usageRecords.length + this.imageRecords.length,
|
|
1978
2163
|
totalInputTokens,
|
|
2164
|
+
totalCacheHitTokens,
|
|
1979
2165
|
totalOutputTokens,
|
|
1980
2166
|
totalReasoningTokens,
|
|
1981
2167
|
byModel,
|
|
@@ -1998,7 +2184,9 @@ class LLMCostTracker {
|
|
|
1998
2184
|
cost: `$${m.totalCost.toFixed(6)}`,
|
|
1999
2185
|
calls: m.callCount,
|
|
2000
2186
|
inputTokens: m.totalInputTokens,
|
|
2187
|
+
cachedTokens: m.totalCacheHitTokens,
|
|
2001
2188
|
outputTokens: m.totalOutputTokens,
|
|
2189
|
+
reasoningTokens: m.totalReasoningTokens,
|
|
2002
2190
|
}));
|
|
2003
2191
|
const images = Object.values(summary.images).map((img) => ({
|
|
2004
2192
|
model: img.model,
|
|
@@ -22801,11 +22989,11 @@ let poolConfig = DEFAULT_POOL_CONFIG;
|
|
|
22801
22989
|
async function loadApolloModules() {
|
|
22802
22990
|
if (typeof window === "undefined" || process.env.AWS_EXECUTION_ENV) {
|
|
22803
22991
|
// Server-side (or Lambda): load the CommonJS‑based implementation.
|
|
22804
|
-
return (await import('./apollo-client.server-
|
|
22992
|
+
return (await import('./apollo-client.server-sD1QteQO.js'));
|
|
22805
22993
|
}
|
|
22806
22994
|
else {
|
|
22807
22995
|
// Client-side: load the ESM‑based implementation.
|
|
22808
|
-
return (await import('./apollo-client.client-
|
|
22996
|
+
return (await import('./apollo-client.client-Bu5mc2I8.js'));
|
|
22809
22997
|
}
|
|
22810
22998
|
}
|
|
22811
22999
|
/**
|
|
@@ -81329,4 +81517,4 @@ const lumic = {
|
|
|
81329
81517
|
};
|
|
81330
81518
|
|
|
81331
81519
|
export { GraphQLInterfaceType as $, print as A, getNamedType as B, isInputType as C, isRequiredArgument as D, isNamedType as E, GraphQLError as F, GraphQLNonNull as G, isOutputType as H, isRequiredInputField as I, isCompositeType as J, Kind as K, getNullableType as L, getEnterLeaveForKind as M, isNode as N, OperationTypeNode as O, didYouMean as P, naturalCompare as Q, suggestionList as R, specifiedScalarTypes as S, keyMap as T, isType as U, isNullableType as V, visit as W, visitInParallel as X, keyValMap as Y, assertObjectType as Z, GraphQLScalarType as _, isListType as a, validateGoogleSheetsRange as a$, GraphQLUnionType as a0, GraphQLInputObjectType as a1, assertNullableType as a2, assertInterfaceType as a3, mapValue as a4, isSpecifiedScalarType as a5, isPrintableAsBlockString as a6, printBlockString as a7, BREAK as a8, GRAPHQL_MAX_INT as a9, printSourceLocation as aA, resolveObjMapThunk as aB, resolveReadonlyArrayThunk as aC, valueFromASTUntyped as aD, version$4 as aE, versionInfo as aF, getAugmentedNamespace as aG, isDigit$1 as aH, isNameStart as aI, dedentBlockStringLines as aJ, isNameContinue as aK, setLumicLogger as aL, getLumicLogger as aM, sanitizeForLog as aN, sanitizeError as aO, sanitizeAWSAuth as aP, sanitizeObject as aQ, getSecrets as aR, resetSecrets as aS, requireSecret as aT, withRetry as aU, CircuitBreaker as aV, CircuitBreakerState as aW, CircuitBreakerOpenError as aX, DEFAULT_CIRCUIT_BREAKER_CONFIG as aY, validateSlackChannel as aZ, validateS3Key as a_, GRAPHQL_MIN_INT as aa, GraphQLFloat as ab, GraphQLInt as ac, Location as ad, Token as ae, assertAbstractType as af, assertCompositeType as ag, assertEnumType as ah, assertEnumValueName as ai, assertInputObjectType as aj, assertInputType as ak, assertLeafType as al, assertListType as am, assertNamedType as an, assertNonNullType as ao, assertOutputType as ap, assertScalarType as aq, assertType as ar, assertUnionType as as, assertWrappingType as at, formatError as au, getLocation as av, getVisitFn as aw, isWrappingType as ax, printError as ay, printLocation as az, isAbstractType as b, PDFError as b$, LLMCostTracker as b0, getLLMCostTracker as b1, setLLMCostTracker as b2, resetLLMCostTracker as b3, setMetricsCollector as b4, getMetricsCollector as b5, resetMetricsCollector as b6, withMetrics as b7, generateCorrelationId as b8, getCorrelationId as b9, openAIChatCompletionSchema as bA, openAIImageResponseSchema as bB, validateOpenAIChatCompletion as bC, safeValidateOpenAIChatCompletion as bD, perplexityResponseSchema as bE, validatePerplexityResponse as bF, safeValidatePerplexityResponse as bG, googleSheetsValueRangeSchema as bH, validateGoogleSheetsResponse as bI, safeValidateGoogleSheetsResponse as bJ, s3ListObjectsSchema as bK, s3GetObjectSchema as bL, lambdaInvokeResponseSchema as bM, validateS3ListObjects as bN, safeValidateS3ListObjects as bO, validateLambdaResponse as bP, safeValidateLambdaResponse as bQ, createValidator as bR, createSafeValidator as bS, LumicError as bT, SlackError as bU, LLMError as bV, AWSLambdaError as bW, AWSS3Error as bX, GoogleSheetsError as bY, PerplexityError as bZ, JsonParseError as b_, getCorrelationContext as ba, withCorrelationId as bb, getCorrelationHeaders as bc, TokenBucketRateLimiter as bd, RATE_LIMIT_PROFILES as be, getRateLimiter as bf, resetAllRateLimiters as bg, withRateLimit as bh, checkIntegrationHealth as bi, SUPPORTED_MODELS as bj, isValidModel as bk, getModelCapabilities as bl, getModelProvider as bm, MODEL_ALIASES as bn, OPENAI_COMPATIBLE_PROVIDERS as bo, PROVIDER_DEFAULT_MODELS as bp, LLM_DEFAULT_PROVIDER as bq, LLM_MINI_PROVIDER as br, LLM_NORMAL_PROVIDER as bs, LLM_ADVANCED_PROVIDER as bt, LLM_PROVIDER as bu, LLM_MODEL_MINI as bv, LLM_MODEL_NORMAL as bw, LLM_MODEL_ADVANCED as bx, makeAnthropicCall as by, makeOpenAICompatibleCall as bz, isInterfaceType as c, ZipError as c0, SLACK_TIMEOUT_MS as c1, PERPLEXITY_TIMEOUT_MS as c2, GOOGLE_SHEETS_TIMEOUT_MS as c3, LLM_TIMEOUT_MS as c4, AWS_LAMBDA_TIMEOUT_MS as c5, AWS_S3_TIMEOUT_MS as c6, OPENWEATHER_TIMEOUT_MS as c7, GENERIC_FETCH_TIMEOUT_MS as c8, isObjectType as d, assertName as e, devAssert as f, isObjectLike as g, defineArguments as h, isNonNullType as i, argsToArgsConfig as j, GraphQLBoolean as k, lumic as l, GraphQLString as m, instanceOf as n, inspect as o, isInputObjectType as p, isLeafType as q, isEnumType as r, GraphQLID as s, toObjMap as t, invariant as u, GraphQLObjectType as v, GraphQLEnumType as w, GraphQLList as x, isScalarType as y, isUnionType as z };
|
|
81332
|
-
//# sourceMappingURL=index-
|
|
81520
|
+
//# sourceMappingURL=index-DPaCMqua.js.map
|