burnmydays commited on
Commit
acecaa0
·
verified ·
1 Parent(s): 57b4252

Add metrics key + plain-English legend

Browse files
Files changed (2) hide show
  1. app.py +43 -0
  2. theme.py +26 -0
app.py CHANGED
@@ -142,6 +142,48 @@ def board_html(extra=None, sort_key="yield"):
142
  out.append('<div class="mb-foot">\u03a5 bar is log-scaled \u00b7 MO\u00a7ES leads the field by ~4 orders of magnitude \u00b7 $/1M blended cost (~ = list-price estimate) \u00b7 * = structural estimation \u00b7 volume can\'t buy rank</div>')
143
  return "".join(out)
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  # ---------- profile ----------
146
  def classify(m):
147
  if m["non_compounding"]: return "Non-Compounding \u00b7 stateless pipe"
@@ -442,6 +484,7 @@ def _build_demo():
442
  label="Rank by", elem_id="rank-by")
443
  lb = gr.HTML(board_html())
444
  rank_by.change(resort_board, rank_by, lb)
 
445
  gr.Markdown("*Curated corpus \u00b7 pasting scores you live but isn't persisted unless you sign in \u00b7 $/1M is a list-price recompute (~) \u00b7 \\* = structural estimation.*", elem_id="moses-foot")
446
  with gr.Column(scale=5):
447
  gr.Markdown("### Operator profile inspector")
 
142
  out.append('<div class="mb-foot">\u03a5 bar is log-scaled \u00b7 MO\u00a7ES leads the field by ~4 orders of magnitude \u00b7 $/1M blended cost (~ = list-price estimate) \u00b7 * = structural estimation \u00b7 volume can\'t buy rank</div>')
143
  return "".join(out)
144
 
145
+ # raw token pillars: I=input O=output Cw=cache-create Cr=cache-read
146
+ _METRIC_KEY = [
147
+ ("\u03a5 yield", "(Cache \u00b7 Output) / Input\u00b2", "the main efficiency score",
148
+ "How well you reuse stored info (cache) to produce strong output while keeping new "
149
+ "input low. Squaring input heavily penalizes wasted tokens \u2014 a high \u03a5 means you're "
150
+ "getting value from smart reuse, not just throwing more data at the model."),
151
+ ("SNR", "O / (I+O)", "signal-to-noise",
152
+ "How much useful, meaningful output (signal) you get versus repetitive or low-value "
153
+ "fluff (noise). Rewards clean, focused generations over long, rambling ones."),
154
+ ("leverage", "Cr / I", "cache leverage",
155
+ "How effectively you reuse previously computed results (cache-read) instead of "
156
+ "recomputing from fresh input. Big \u2018free\u2019 value from smart memory \u2014 the core "
157
+ "architectural signal that separates a compounding cache from a stateless pipe."),
158
+ ("velocity", "O / I", "throughput",
159
+ "Output produced per input token spent \u2014 single-pass processing speed."),
160
+ ("10x DEV", "log\u2081\u2080(transmission \u00d7 commitment \u00d7 reuse)", "cascade velocity",
161
+ "How efficiently the run chains steps together \u2014 the 10\u00d710\u00d720 cascade. The three "
162
+ "factors telescope to Cr/I, so this is the cascade expressed in orders of magnitude "
163
+ "(log\u2081\u2080 of leverage). Smoother chaining = higher."),
164
+ ("$/1M", "blended cost / 1M tokens", "across all states",
165
+ "Average cost per million tokens across input, output, and cache. Efficient "
166
+ "architecture is also the cheapest. ~ = recomputed at list price."),
167
+ ]
168
+
169
+ def metrics_key_html():
170
+ """Collapsible legend for the board columns. Definitions match metrics.compute exactly."""
171
+ rows = "".join(
172
+ f'<div class="mk-row"><span class="mk-name">{n}</span>'
173
+ f'<span class="mk-form">{f}</span>'
174
+ f'<span class="mk-alias">{a}</span>'
175
+ f'<span class="mk-desc">{d}</span></div>'
176
+ for n, f, a, d in _METRIC_KEY
177
+ )
178
+ return (
179
+ '<details class="metric-key"><summary>What do these metrics mean? '
180
+ '<span class="mk-hint">(tap to expand)</span></summary>'
181
+ '<div class="mk-legend">'
182
+ '<div class="mk-note">Raw pillars: <b>I</b> input \u00b7 <b>O</b> output \u00b7 '
183
+ '<b>Cw</b> cache-create \u00b7 <b>Cr</b> cache-read</div>'
184
+ f'{rows}</div></details>'
185
+ )
186
+
187
  # ---------- profile ----------
188
  def classify(m):
189
  if m["non_compounding"]: return "Non-Compounding \u00b7 stateless pipe"
 
484
  label="Rank by", elem_id="rank-by")
485
  lb = gr.HTML(board_html())
486
  rank_by.change(resort_board, rank_by, lb)
487
+ gr.HTML(metrics_key_html())
488
  gr.Markdown("*Curated corpus \u00b7 pasting scores you live but isn't persisted unless you sign in \u00b7 $/1M is a list-price recompute (~) \u00b7 \\* = structural estimation.*", elem_id="moses-foot")
489
  with gr.Column(scale=5):
490
  gr.Markdown("### Operator profile inspector")
theme.py CHANGED
@@ -235,6 +235,32 @@ button.primary:hover, #compute-btn:hover { background: #d8a449 !important; }
235
 
236
  footer { display: none !important; }
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  @media (max-width: 700px) {
239
  /* mobile: collapse both boards to rank · operator · Υ. The numeric middle
240
  columns drop out entirely instead of being crushed into too-few tracks.
 
235
 
236
  footer { display: none !important; }
237
 
238
+ /* ---------- metrics key (collapsible legend under the board) ---------- */
239
+ .metric-key { margin: 10px 2px 0; border: 1px solid #3A3324; border-radius: 6px;
240
+ background: rgba(196,146,58,0.04); }
241
+ .metric-key summary { cursor: pointer; padding: 9px 12px; color: #C4923A;
242
+ font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
243
+ list-style: none; }
244
+ .metric-key summary::-webkit-details-marker { display: none; }
245
+ .metric-key summary::before { content: "▸ "; color: #8a7f68; }
246
+ .metric-key[open] summary::before { content: "▾ "; }
247
+ .metric-key .mk-hint { color: #8a7f68; font-weight: 400; text-transform: none;
248
+ letter-spacing: 0; font-size: 11px; }
249
+ .mk-legend { padding: 4px 12px 12px; }
250
+ .mk-note { color: #8a7f68; font-size: 11px; margin: 2px 0 10px; }
251
+ .mk-note b { color: #C4923A; }
252
+ .mk-row { display: grid; grid-template-columns: 96px 150px 130px 1fr; gap: 8px;
253
+ align-items: baseline; padding: 6px 0; border-top: 1px solid #2c2718; }
254
+ .mk-name { color: #E8E0CF; font-weight: 700; font-size: 12px; }
255
+ .mk-form { color: #C4923A; font-family: ui-monospace, monospace; font-size: 11px; }
256
+ .mk-alias { color: #8a7f68; font-size: 11px; font-style: italic; }
257
+ .mk-desc { color: #a89e85; font-size: 11px; line-height: 1.45; }
258
+ @media (max-width: 700px) {
259
+ /* stack each metric into a card on phones */
260
+ .mk-row { grid-template-columns: 1fr; gap: 2px; }
261
+ .mk-form { font-size: 10px; }
262
+ }
263
+
264
  @media (max-width: 700px) {
265
  /* mobile: collapse both boards to rank · operator · Υ. The numeric middle
266
  columns drop out entirely instead of being crushed into too-few tracks.