Repository navigation
Expand file tree
/
Copy pathcartridge-economics.html
More file actions
1467 lines (1444 loc) · 70.5 KB
/
Copy pathcartridge-economics.html
File metadata and controls
1467 lines (1444 loc) · 70.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="When do trained, reusable KV-cache Cartridges repay their training, storage and loading costs versus repeatedly prefilling RAG text?"
/>
<meta name="theme-color" content="#0b0b14" />
<link rel="icon" type="image/png" sizes="192x192" href="icon-192.png" />
<link rel="icon" type="image/png" sizes="512x512" href="icon-512.png" />
<link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600;700&family=Sora:wght@400;500;600;700;800&display=swap"
rel="stylesheet"
/>
<title>Cartridge Economics - Break-even vs Text RAG</title>
<style>
:root {
--mono: 'IBM Plex Mono', 'JetBrains Mono', monospace;
--display: 'Sora', 'Space Grotesk', sans-serif;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
background: #0b0b14;
color: #fff;
font-family: var(--mono);
padding: 24px 20px;
}
.wrap {
max-width: 960px;
margin: 0 auto;
}
h1 {
font-family: var(--display);
font-size: 28px;
font-weight: 800;
line-height: 1.2;
margin: 0 0 6px 0;
background: linear-gradient(135deg, #22d3ee, #a78bfa, #f472b6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.subtitle {
font-size: 14px;
color: rgba(255, 255, 255, 0.78);
margin: 0 0 16px 0;
line-height: 1.45;
max-width: 720px;
}
.subtitle a {
color: #22d3ee;
text-decoration: none;
}
.top-tabs {
display: flex;
gap: 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
margin-bottom: 20px;
flex-wrap: wrap;
}
.top-tab {
padding: 10px 24px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
background: transparent;
border: none;
border-bottom: 2px solid transparent;
color: rgba(255, 255, 255, 0.45);
font-family: var(--display);
transition: all 0.15s ease;
}
.top-tab.active {
font-weight: 700;
background: rgba(167, 139, 250, 0.12);
border-bottom-color: #a78bfa;
color: #fff;
}
.page {
display: none;
}
.page.active {
display: block;
}
.card {
background: rgba(255, 255, 255, 0.025);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 10px;
padding: 16px 20px;
margin-bottom: 16px;
}
.sec-title {
font-size: 16px;
color: #fff;
font-weight: 700;
font-family: var(--display);
margin-bottom: 12px;
}
.sec-note {
font-size: 12px;
color: rgba(255, 255, 255, 0.55);
line-height: 1.5;
margin-bottom: 10px;
}
.g3 {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 10px 20px;
}
.g2 {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px 20px;
}
.field label {
display: block;
font-size: 12px;
color: rgba(255, 255, 255, 0.75);
margin-bottom: 3px;
}
.field input[type='number'],
.field input[type='text'],
.field select {
width: 100%;
padding: 6px 10px;
background: #16162a;
color: #fff;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 5px;
font-size: 13px;
font-family: var(--mono);
}
.field input[type='range'] {
width: 100%;
accent-color: #a78bfa;
cursor: pointer;
}
.field .val {
font-size: 12px;
color: #a78bfa;
font-weight: 600;
}
.radio-row {
display: flex;
gap: 18px;
align-items: center;
margin-bottom: 10px;
font-size: 13px;
flex-wrap: wrap;
}
.radio-row label {
cursor: pointer;
color: rgba(255, 255, 255, 0.85);
}
.radio-row input {
accent-color: #a78bfa;
margin-right: 5px;
}
.status-banner {
border-radius: 8px;
padding: 12px 16px;
font-size: 14px;
line-height: 1.5;
margin-bottom: 16px;
border: 1px solid;
}
.status-neutral {
background: rgba(148, 163, 184, 0.08);
border-color: rgba(148, 163, 184, 0.35);
color: #cbd5e1;
}
.status-good {
background: rgba(52, 211, 153, 0.08);
border-color: rgba(52, 211, 153, 0.4);
color: #34d399;
}
.status-warn {
background: rgba(251, 191, 36, 0.08);
border-color: rgba(251, 191, 36, 0.4);
color: #fbbf24;
}
.status-fail {
background: rgba(248, 113, 113, 0.08);
border-color: rgba(248, 113, 113, 0.4);
color: #f87171;
}
.warn-box {
background: rgba(251, 191, 36, 0.06);
border: 1px solid rgba(251, 191, 36, 0.3);
border-radius: 6px;
padding: 8px 12px;
font-size: 12px;
color: #fbbf24;
line-height: 1.5;
margin-bottom: 10px;
}
.warn-inline {
color: #fbbf24;
font-size: 11px;
}
.bench-required {
color: #fbbf24;
font-size: 12px;
font-style: italic;
}
.prov {
display: inline-block;
font-size: 9px;
padding: 1px 5px;
border-radius: 4px;
margin-left: 4px;
vertical-align: middle;
letter-spacing: 0.3px;
text-transform: uppercase;
}
.prov-paper {
background: rgba(34, 211, 238, 0.15);
color: #22d3ee;
}
.prov-assume {
background: rgba(251, 191, 36, 0.15);
color: #fbbf24;
}
.prov-measured {
background: rgba(52, 211, 153, 0.15);
color: #34d399;
}
.prov-derived {
background: rgba(167, 139, 250, 0.15);
color: #a78bfa;
}
.prov-proj {
background: rgba(244, 114, 182, 0.15);
color: #f472b6;
}
.metric-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 10px;
}
.metric {
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.07);
border-radius: 8px;
padding: 10px 12px;
min-height: 66px;
}
.metric .k {
font-size: 11px;
color: rgba(255, 255, 255, 0.55);
margin-bottom: 4px;
}
.metric .v {
font-size: 15px;
font-weight: 700;
color: #fff;
word-break: break-word;
}
.metric .v .sub {
font-size: 11px;
font-weight: 400;
color: rgba(255, 255, 255, 0.5);
}
.graph-host svg {
width: 100%;
height: auto;
display: block;
}
.graph-empty,
.graph-note {
font-size: 12px;
color: rgba(255, 255, 255, 0.6);
padding: 10px 4px;
line-height: 1.5;
}
.graph-note {
color: #fbbf24;
}
.graph-toggle {
display: flex;
gap: 6px;
margin-bottom: 10px;
}
.graph-toggle button {
padding: 6px 14px;
font-size: 12px;
cursor: pointer;
background: transparent;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 6px;
color: rgba(255, 255, 255, 0.55);
font-family: var(--mono);
}
.graph-toggle button.active {
background: rgba(167, 139, 250, 0.15);
border-color: rgba(167, 139, 250, 0.35);
color: #a78bfa;
font-weight: 700;
}
.comp-title {
font-size: 12px;
color: rgba(255, 255, 255, 0.65);
margin: 12px 0 8px;
line-height: 1.5;
}
.comp-row {
display: grid;
grid-template-columns: 240px 1fr 90px;
gap: 10px;
align-items: center;
margin-bottom: 6px;
}
.comp-label {
font-size: 12px;
color: rgba(255, 255, 255, 0.8);
}
.comp-bar-track {
background: rgba(255, 255, 255, 0.05);
border-radius: 4px;
height: 14px;
overflow: hidden;
}
.comp-bar {
height: 100%;
border-radius: 4px;
}
.comp-value {
font-size: 12px;
text-align: right;
color: rgba(255, 255, 255, 0.85);
}
.btn {
padding: 8px 18px;
font-size: 13px;
font-weight: 600;
cursor: pointer;
background: rgba(34, 211, 238, 0.12);
border: 1px solid rgba(34, 211, 238, 0.35);
border-radius: 6px;
color: #22d3ee;
font-family: var(--display);
}
.btn:hover {
background: rgba(34, 211, 238, 0.2);
}
table.prices {
width: 100%;
border-collapse: collapse;
font-size: 12px;
}
table.prices th,
table.prices td {
text-align: left;
padding: 6px 8px;
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
table.prices th {
color: rgba(255, 255, 255, 0.55);
font-weight: 600;
}
table.prices a {
color: #22d3ee;
text-decoration: none;
}
.price-scroll {
overflow-x: auto;
}
ul.assump {
font-size: 13px;
color: rgba(255, 255, 255, 0.85);
line-height: 1.7;
padding-left: 20px;
}
.back-link {
position: fixed;
bottom: 20px;
left: 20px;
z-index: 100;
}
.back-link a {
color: rgba(95, 163, 230, 0.7);
text-decoration: none;
font-size: 0.85rem;
}
.back-link a:hover {
color: #5fa3e6;
}
.footer {
margin-top: 24px;
padding: 16px;
text-align: center;
color: rgba(255, 255, 255, 0.4);
font-size: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.06);
line-height: 1.6;
}
.footer a {
color: rgba(34, 211, 238, 0.7);
text-decoration: none;
}
@media (max-width: 640px) {
.g3,
.g2 {
grid-template-columns: 1fr;
}
.comp-row {
grid-template-columns: 1fr;
gap: 2px;
}
.comp-value {
text-align: left;
}
.top-tab {
padding: 10px 14px;
font-size: 13px;
}
}
</style>
</head>
<body>
<div class="wrap">
<h1>Cartridge Economics & Break-even</h1>
<p class="subtitle">
When does the one-time cost of generating and training reusable per-document KV-cache Cartridges, plus
persistent storage and loading, become cheaper than repeatedly prefilling conventional RAG text?
Inspired by
<a href="https://arxiv.org/pdf/2606.04557" target="_blank" rel="noopener">
Cartridges at Scale (Amazon AGI Lab, arXiv:2606.04557)
</a>
.
</p>
<div class="top-tabs">
<button class="top-tab active" data-page="breakeven">Break-even</button>
<button class="top-tab" data-page="storage">Storage & Traffic</button>
<button class="top-tab" data-page="assumptions">Assumptions & Prices</button>
</div>
<!-- ═══ BREAK-EVEN ═══ -->
<div id="page-breakeven" class="page active">
<div id="be-status" class="status-banner status-neutral"> </div>
<div class="card">
<div class="sec-title">Measured KNLP evidence · Qwen3-8B / LongHealth patient_02</div>
<div class="sec-note">
The completed reproduction now supplies training time, artifact size, seed variation, quality,
quantization, and scoped serving measurements. It still lacks self-study cost, matched
production cost/request, and storage-load behavior, so it cannot establish economic break-even.
</div>
<div class="metric-grid" style="margin-top: 12px">
<div class="metric">
<div class="k">
Isolated training job
<span class="prov prov-measured">measured</span>
</div>
<div class="v">8.21–8.29 H100 h</div>
</div>
<div class="metric">
<div class="k">
Distinct-seed outcomes
<span class="prov prov-measured">measured</span>
</div>
<div class="v" style="color: #fbbf24">5 / 7 healthy</div>
<div class="sec-note">2 / 7 scored 40%</div>
</div>
<div class="metric">
<div class="k">
Serialized BF16 artifact
<span class="prov prov-measured">measured</span>
</div>
<div class="v">88.923 MiB</div>
</div>
<div class="metric">
<div class="k">
Selected seed-42 quality
<span class="prov prov-measured">measured</span>
</div>
<div class="v" style="color: #f87171">78.33% vs 98.33%</div>
<div class="sec-note">Cartridge vs full document</div>
</div>
</div>
<div class="price-scroll" style="margin-top: 12px">
<table class="prices">
<thead>
<tr>
<th>Finding</th>
<th>Measured result</th>
<th>Scope</th>
</tr>
</thead>
<tbody>
<tr>
<td>K16/V8 post-training quantization</td>
<td>
<span style="color: #34d399">25% smaller raw payload</span>
with loss +0.029–0.038%
</td>
<td>Three trained patient_02 artifacts; lower evaluation loss is better</td>
</tr>
<tr>
<td>Symmetric K8/V8 post-training quantization</td>
<td><span style="color: #f87171">Loss +0.873–1.303%</span></td>
<td>The keys cause almost all of the measured quantization penalty</td>
</tr>
<tr>
<td>Fused K16/V8 vs ordinary BF16 Cartridge</td>
<td>
Throughput
<span style="color: #34d399">+0.42% / +0.52%</span>
and TTFT
<span style="color: #34d399">−2.92% / −3.96%</span>
</td>
<td>Corrected patient_01 H100 run, batches 1 / 16</td>
</tr>
<tr>
<td>Full text vs Cartridge path</td>
<td>Median TTFT 757 ms → 80.6 ms</td>
<td>
Older patient_01 single-stream run; useful latency evidence, not production
cost/request
</td>
</tr>
</tbody>
</table>
</div>
<div class="sec-note" style="margin-top: 10px">
Five accepted runs and two screened-out runs imply 40% failed work per accepted artifact if this
small-sample rate holds. The measured preset loads that derived retry allowance and the specific
seed-42 artifact; its quality gate fails visibly. Read the
<a href="https://knlp.io/cas.html">CAS reproduction</a>
and
<a href="https://knlp.io/cartridge-asymmetric-quantization.html">
asymmetric-quantization results
</a>
.
</div>
<button class="btn" id="load-measured" style="margin-top: 12px">
Load measured patient_02 snapshot
</button>
</div>
<div id="planning-banner" class="warn-box" style="display: none">
ILLUSTRATIVE planning-assumption mode: prefill wall times below are estimated from an assumed
throughput, not measured, and are NOT results from the CAS paper. Use measured wall times for real
decisions.
</div>
<div class="card">
<div class="sec-title">Workload</div>
<div class="sec-note">
Provenance badges:
<span class="prov prov-paper">paper</span>
reported in arXiv:2606.04557 ·
<span class="prov prov-assume">assumption</span>
calculator default, not a paper value ·
<span class="prov prov-derived">derived</span>
computed from other inputs ·
<span class="prov prov-measured">measured</span>
your benchmark ·
<span class="prov prov-proj">projection</span>
experimental, not validated by the paper.
</div>
<div class="g3">
<div class="field">
<label for="in-docs">Source documents</label>
<input type="number" id="in-docs" value="20" min="1" step="1" />
</div>
<div class="field">
<label for="in-corpus-tokens">
Total source tokens
<span class="prov prov-paper">paper</span>
</label>
<input type="number" id="in-corpus-tokens" value="236000" min="0" step="1000" />
</div>
<div class="field">
<label for="in-doc-tokens">
Avg source tokens/document (derived, overridable)
<span class="prov prov-derived">derived</span>
</label>
<input type="number" id="in-doc-tokens" value="11800" min="0" step="100" />
</div>
<div class="field">
<label for="in-compression">
Compression ratio
<span class="prov prov-paper">paper</span>
</label>
<select id="in-compression"></select>
<input
type="number"
id="in-compression-custom"
placeholder="custom ratio"
min="1"
step="1"
style="display: none; margin-top: 4px"
/>
</div>
<div class="field">
<label for="in-model">
Model (BF16 KV MiB per 1K Cartridge tokens)
<span class="prov prov-paper">paper</span>
</label>
<select id="in-model"></select>
<input
type="number"
id="in-model-custom"
placeholder="MiB per 1K tokens"
min="1"
step="1"
style="display: none; margin-top: 4px"
/>
</div>
<div class="field">
<label for="in-kvformat">KV format</label>
<select id="in-kvformat"></select>
</div>
<div class="field">
<label for="in-actual-mib-doc">
Measured serialized MiB/Cartridge (override)
<span class="prov prov-measured">measured</span>
</label>
<input
type="number"
id="in-actual-mib-doc"
placeholder="incl. framing + metadata"
min="0"
step="0.1"
/>
</div>
<div class="field">
<label for="in-actual-mib-1k">
Measured serialized MiB/1K tokens (override)
<span class="prov prov-measured">measured</span>
</label>
<input
type="number"
id="in-actual-mib-1k"
placeholder="incl. framing + metadata"
min="0"
step="0.1"
/>
</div>
<div class="field">
<label for="in-unique">
Avg unique Cartridges/query
<span class="prov prov-paper">paper</span>
</label>
<input type="number" id="in-unique" value="4.4" min="0" step="0.1" />
</div>
<div class="field">
<label for="in-queries-month">
RAG queries/month
<span class="prov prov-assume">assumption</span>
</label>
<input type="number" id="in-queries-month" value="100000" min="0" step="1000" />
</div>
<div class="field">
<label for="in-lifetime">
Model/Cartridge lifetime (months)
<span class="prov prov-assume">assumption</span>
</label>
<input type="number" id="in-lifetime" value="6" min="1" step="1" />
</div>
<div class="field">
<label for="in-replicas">
Storage replicas
<span class="prov prov-assume">assumption</span>
</label>
<input type="number" id="in-replicas" value="1" min="1" step="1" />
</div>
</div>
</div>
<div class="card">
<div class="sec-title">One-time Cartridge construction cost</div>
<div class="sec-note">
CAS trains Cartridge pools jointly, so enter the measured cost of the whole corpus run; the
per-document number shown in results is an average, not a marginal cost. The paper reports
H200/B200 hardware and optimizer configuration but not wall-clock time or GPU-hours —
empty fields stay “benchmark required”. Self-study question generation and
target-model inference are part of the principal offline cost per the paper: a blank self-study
field blocks the construction cost rather than counting as $0.
</div>
<div class="radio-row">
<label>
<input type="radio" name="build-mode" id="in-mode-a" checked />
Measured run
</label>
<label>
<input type="radio" name="build-mode" id="in-mode-b" />
Direct total GPU-hours
</label>
</div>
<div id="mode-a-fields" class="g3">
<div class="field">
<label for="in-train-gpus">Training GPUs</label>
<input type="number" id="in-train-gpus" placeholder="benchmark required" min="1" step="1" />
</div>
<div class="field">
<label for="in-train-hours">Training wall-clock hours</label>
<input
type="number"
id="in-train-hours"
placeholder="benchmark required"
min="0"
step="0.1"
/>
</div>
</div>
<div id="mode-b-fields" class="g3" style="display: none">
<div class="field">
<label for="in-train-gpuhours">Measured total GPU-hours</label>
<input
type="number"
id="in-train-gpuhours"
placeholder="benchmark required"
min="0"
step="0.1"
/>
</div>
</div>
<div class="g3" style="margin-top: 10px">
<div class="field">
<label for="in-train-gpu-preset">Training GPU provider/rate</label>
<select id="in-train-gpu-preset"></select>
<input
type="number"
id="in-train-rate-custom"
placeholder="$/GPU-hour"
min="0"
step="0.01"
style="display: none; margin-top: 4px"
/>
</div>
<div class="field">
<label for="in-selfstudy">Self-study generation + inference cost ($)</label>
<input type="number" id="in-selfstudy" placeholder="benchmark required" min="0" step="1" />
<label style="margin-top: 4px; cursor: pointer">
<input type="checkbox" id="in-selfstudy-included" style="accent-color: #a78bfa" />
Included in measured total above
</label>
</div>
<div class="field">
<label for="in-other-build">Other one-time cost ($)</label>
<input type="number" id="in-other-build" placeholder="0" min="0" step="1" />
</div>
</div>
<div class="g3" style="margin-top: 10px">
<div class="field">
<label for="in-retry-pct">
Failed/preempted training retry overhead (%)
<span class="prov prov-derived">derived</span>
</label>
<input type="number" id="in-retry-pct" value="0" min="0" step="1" />
</div>
<div class="field">
<label for="in-rebuild-pct">Corpus retrained per month (%)</label>
<input type="number" id="in-rebuild-pct" value="0" min="0" step="1" />
</div>
</div>
<div class="sec-note" style="margin-top: 8px">
Frequently updated corpora retrain a fraction of their Cartridges every month; that fraction of
the (retry-inflated) build cost recurs monthly. Model/checkpoint migrations that invalidate
every Cartridge are the lifetime input above. The measured patient_02 preset derives 40% retry
work from two screened-out runs for every five accepted runs; treat that seven-seed observation
as a local estimate, not a universal failure rate.
</div>
</div>
<div class="card">
<div class="sec-title">Per-query inference cost (both paths)</div>
<div class="sec-note">
Primary mode: billed GPU-hours divided by completed matched requests for each path — that
is what production actually pays under continuous batching. Wall latency × TP size
survives only as a microbenchmark approximation: many requests share each GPU-second, so
per-request wall latency is not exclusive GPU time. A 10x token reduction is not automatically a
100x reduction in GPU time. Record matched metadata with every run: model/checkpoint, engine +
commit, token counts, concurrency and batching policy, completed requests, p50/p95 TTFT,
throughput and quality score.
</div>
<div class="g3" style="margin-bottom: 10px">
<div class="field">
<label for="in-baseline">Baseline for comparison</label>
<select id="in-baseline"></select>
</div>
</div>
<div class="sec-note">
Uncached Text RAG (repeated full prefill) is a valid experiment but a deliberately weak
deployment baseline. On a stack with ordinary KV/prefix reuse (e.g. LMCache), measure that
baseline all-in instead of assuming arbitrary retrieved chunk combinations compose safely.
</div>
<div class="radio-row">
<label>
<input type="radio" name="inf-mode" id="in-inf-hours" checked />
GPU-hours / completed requests (recommended)
</label>
<label>
<input type="radio" name="inf-mode" id="in-inf-1k" />
$ per 1K requests
</label>
<label>
<input type="radio" name="inf-mode" id="in-inf-wall" />
Wall-latency microbenchmark (approximation)
</label>
</div>
<div id="inf-hours-fields" class="g2">
<div class="field">
<label for="in-text-gpuhours">Text-RAG run: billed GPU-hours</label>
<input
type="number"
id="in-text-gpuhours"
placeholder="benchmark required"
min="0"
step="0.01"
/>
</div>
<div class="field">
<label for="in-text-queries">Text-RAG run: completed requests</label>
<input
type="number"
id="in-text-queries"
placeholder="benchmark required"
min="1"
step="1"
/>
</div>
<div class="field">
<label for="in-cart-gpuhours">Cartridge run: billed GPU-hours</label>
<input
type="number"
id="in-cart-gpuhours"
placeholder="benchmark required"
min="0"
step="0.01"
/>
</div>
<div class="field">
<label for="in-cart-queries">Cartridge run: completed requests</label>
<input
type="number"
id="in-cart-queries"
placeholder="benchmark required"
min="1"
step="1"
/>
</div>
</div>
<div id="inf-1k-fields" class="g2" style="display: none">
<div class="field">
<label for="in-text-usd1k">Text-RAG variable cost ($/1K requests)</label>
<input
type="number"
id="in-text-usd1k"
placeholder="benchmark required"
min="0"
step="0.01"
/>
</div>
<div class="field">
<label for="in-cart-usd1k">Cartridge-path variable cost ($/1K requests)</label>
<input
type="number"
id="in-cart-usd1k"
placeholder="benchmark required"
min="0"
step="0.01"
/>
</div>
</div>
<div id="inf-wall-fields" style="display: none">
<div class="radio-row">
<label>
<input type="checkbox" id="in-planning" />
Planning-assumption mode (illustrative only)
</label>
</div>
<div id="measured-ms-fields" class="g3">
<div class="field">
<label for="in-text-ms">Text-RAG prefill wall ms/query</label>
<input
type="number"
id="in-text-ms"
placeholder="benchmark required"
min="0"
step="1"
/>
</div>
<div class="field">
<label for="in-cart-ms">Cartridge-path prefill wall ms/query</label>
<input
type="number"
id="in-cart-ms"
placeholder="benchmark required"
min="0"
step="1"
/>
</div>
</div>
<div id="planning-fields" class="g3" style="display: none">
<div class="field">
<label for="in-plan-text-tokens">Assumed text-RAG prefill tokens/query</label>
<input type="number" id="in-plan-text-tokens" value="9860" min="0" step="10" />
</div>
<div class="field">
<label for="in-plan-cart-tokens">
Assumed fresh prefill tokens/query (Cartridge path)
</label>
<input type="number" id="in-plan-cart-tokens" value="200" min="0" step="10" />
</div>
<div class="field">
<label for="in-plan-tps-text">Assumed Text-RAG throughput (tokens/s)</label>
<input type="number" id="in-plan-tps-text" value="50000" min="1" step="1000" />
</div>
<div class="field">
<label for="in-plan-tps-cart">Assumed Cartridge-path throughput (tokens/s)</label>
<input
type="number"
id="in-plan-tps-cart"
placeholder="benchmark required"
min="1"
step="1000"
/>
</div>
</div>
<div class="sec-note" id="planning-note" style="margin-top: 6px">
Source-token compression is not GPU-time compression: the fresh Cartridge-path tokens still
attend over the loaded Cartridge prefix, so each path needs its own effective throughput.
Planning mode never emits a “viable” verdict.
</div>
<div class="g3" style="margin-top: 10px">
<div class="field">
<label for="in-inf-gpus">Inference GPUs/request (TP size)</label>
<input type="number" id="in-inf-gpus" value="1" min="1" step="1" />
</div>
<div class="field">
<label for="in-decode-ms">Decode GPU-ms saved/query (signed, optional)</label>
<input type="number" id="in-decode-ms" value="0" step="1" />
</div>
</div>
</div>
<div class="g3" style="margin-top: 10px">
<div class="field">
<label for="in-inf-gpu-preset">Inference GPU provider/rate</label>
<select id="in-inf-gpu-preset"></select>
<input
type="number"
id="in-inf-rate-custom"
placeholder="$/GPU-hour"
min="0"
step="0.01"
style="display: none; margin-top: 4px"
/>
</div>
<div class="field">
<label for="in-inf-rate-cart">Cartridge-run $/GPU-hour override (optional)</label>
<input
type="number"
id="in-inf-rate-cart"
placeholder="same as baseline"
min="0"
step="0.01"
/>
</div>
<div class="field">
<label for="in-realization">
Compute-value realization
<span class="val" id="v-realization">100%</span>
</label>
<input type="range" id="in-realization" min="0" max="100" step="5" value="100" />
</div>
</div>
<div class="field" style="margin-top: 10px">
<label for="in-run-meta">Run metadata (free text, saved in the scenario link)</label>
<input
type="text"
id="in-run-meta"
placeholder="model/checkpoint, engine+commit, tokens, concurrency, TTFT p50/p95, QPS"
/>
</div>
<div class="sec-note" style="margin-top: 8px">
Realization 100% = elastic billing, or saved capacity eventually removes GPUs, so saved GPU time
becomes cash. 0% = fixed provisioned fleet: the optimization creates headroom, not a smaller
invoice.
</div>
</div>
<div class="card">
<div class="sec-title">Cartridge storage & loading</div>
<div class="sec-note">
Dense-retrieval/index costs are common to Text RAG and Cartridge RAG and cancel out of the
comparison. The CAS implementation still performs chunk retrieval to select document Cartridges;
only the additional Cartridge-object load is modeled here.
</div>
<div id="storage-unmodeled" class="warn-box" style="display: none"></div>