Spaces:
Running
Running
deploy(hf): sync szl-holdings/a11oy@main derived COPY set
Browse filesReusable Dockerfile-COPY-derived deploy from szl-holdings/a11oy main.
Files: 1043 Pruned: 0
Derived from Dockerfile COPY sources (NO hand-maintained allowlist).
Signed-off-by: SZL Holdings <noreply@szlholdings.ai>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- static/3d/holographic.html +2 -0
- static/3d/surfaces/leaders.js +448 -0
static/3d/holographic.html
CHANGED
|
@@ -333,6 +333,8 @@ const SURFACES = [
|
|
| 333 |
{ id: "brainexplain", cat: "brain", title: "Brain Explain · transparent explanation of WHY the brain retrieved what it did · MODELED descriptive trace over the REAL retrieval subgraph (which query terms matched which seed nodes, per-node ppr-vs-salience rationale, communities traversed, each node's OWN label VERBATIM) → EXPLAINABLE/PARTIALLY-EXPLAINABLE/OPAQUE (never invents a rationale; honest OPAQUE beats a fake one), unsigned SHA-256 receipt-on-write", mod: "/static/3d/surfaces/brainexplain.js" },
|
| 334 |
{ id: "braingaps", cat: "brain", title: "Brain Gaps · an honest map of what the brain does NOT know · MEASURED thin (sparse) communities + weakly-connected island nodes (degree≤1) + weak-label share over the live graph, and per-query COVERED/THIN/GAP grounding → estate verdict WELL-COVERED/PATCHY/SPARSE (a GAP is never fabricated into coverage), unsigned SHA-256 receipt-on-write (MODELED)", mod: "/static/3d/surfaces/braingaps.js" },
|
| 335 |
{ id: "brainconstitution", cat: "brain", title: "Brain Constitution · the honest, machine-checkable ruleset the brain is graded against per query · an explicit ordered set of ARTICLES (grounding sufficiency, calibrated confidence, honest corroboration, contradictions surfaced, traceable to source, freshness honesty, coverage gaps admitted, doctrine invariants) each graded COMPLIANT/VIOLATED/UNAVAILABLE against whatever sibling brain-honesty surfaces are importable (an absent surface is UNAVAILABLE, never a fabricated pass) → CONSTITUTIONAL/IN-VIOLATION/INSUFFICIENT-SIGNAL, never CONSTITUTIONAL while any evaluable Article is VIOLATED, unsigned SHA-256 receipt-on-write (MODELED)", mod: "/static/3d/surfaces/brainconstitution.js" },
|
|
|
|
|
|
|
| 336 |
];
|
| 337 |
|
| 338 |
const stageEl = document.getElementById("stage");
|
|
|
|
| 333 |
{ id: "brainexplain", cat: "brain", title: "Brain Explain · transparent explanation of WHY the brain retrieved what it did · MODELED descriptive trace over the REAL retrieval subgraph (which query terms matched which seed nodes, per-node ppr-vs-salience rationale, communities traversed, each node's OWN label VERBATIM) → EXPLAINABLE/PARTIALLY-EXPLAINABLE/OPAQUE (never invents a rationale; honest OPAQUE beats a fake one), unsigned SHA-256 receipt-on-write", mod: "/static/3d/surfaces/brainexplain.js" },
|
| 334 |
{ id: "braingaps", cat: "brain", title: "Brain Gaps · an honest map of what the brain does NOT know · MEASURED thin (sparse) communities + weakly-connected island nodes (degree≤1) + weak-label share over the live graph, and per-query COVERED/THIN/GAP grounding → estate verdict WELL-COVERED/PATCHY/SPARSE (a GAP is never fabricated into coverage), unsigned SHA-256 receipt-on-write (MODELED)", mod: "/static/3d/surfaces/braingaps.js" },
|
| 335 |
{ id: "brainconstitution", cat: "brain", title: "Brain Constitution · the honest, machine-checkable ruleset the brain is graded against per query · an explicit ordered set of ARTICLES (grounding sufficiency, calibrated confidence, honest corroboration, contradictions surfaced, traceable to source, freshness honesty, coverage gaps admitted, doctrine invariants) each graded COMPLIANT/VIOLATED/UNAVAILABLE against whatever sibling brain-honesty surfaces are importable (an absent surface is UNAVAILABLE, never a fabricated pass) → CONSTITUTIONAL/IN-VIOLATION/INSUFFICIENT-SIGNAL, never CONSTITUTIONAL while any evaluable Article is VIOLATED, unsigned SHA-256 receipt-on-write (MODELED)", mod: "/static/3d/surfaces/brainconstitution.js" },
|
| 336 |
+
{ id: "markets", cat: "finance", flag: true, title: "Markets & Finance · live Polymarket prediction book (top markets by 24h volume, pillar height = 24h vol, bead = YES probability) + crypto majors orbiting by market cap · 100% MEASURED same-origin deva finance feeds, no mocked spend/keys, log-scaling is display-only", mod: "/static/3d/surfaces/finance.js" },
|
| 337 |
+
{ id: "leaders", cat: "more", flag: true, title: "Frontier Models · Live AI Leaders · MEASURED live OpenRouter model catalog — one pillar per lab (height = max context window, bead = open/free share); widest-context models orbit as satellites (teal = free, amber = paid); log-scaling is display-only, no invented benchmark or ranking", mod: "/static/3d/surfaces/leaders.js" },
|
| 338 |
];
|
| 339 |
|
| 340 |
const stageEl = document.getElementById("stage");
|
static/3d/surfaces/leaders.js
ADDED
|
@@ -0,0 +1,448 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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ic estate.
|
| 5 |
+
//
|
| 6 |
+
// A live "frontier landscape observatory": the real, public OpenRouter model catalog
|
| 7 |
+
// (every model the aggregator currently serves) rendered as a ring of pillars — one per
|
| 8 |
+
// LAB (provider) — around a pulsing frontier core, with the widest-context individual
|
| 9 |
+
// models orbiting as satellites. 100% LIVE MEASURED data, pulled same-origin from the
|
| 10 |
+
// a11oy deva frontier feed. Nothing here is faked: no invented benchmark, no made-up
|
| 11 |
+
// ranking — only the catalog's own published context windows, prices, and lab counts.
|
| 12 |
+
//
|
| 13 |
+
// Surface export shape (mirrors finance.js / evalarena.js):
|
| 14 |
+
// export default { id, title, endpoints, mount(ctx), unmount() }
|
| 15 |
+
// ctx = { stage, container, live, label, THREE, szl3d }
|
| 16 |
+
//
|
| 17 |
+
// DATA SHOWN (all live, same-origin):
|
| 18 |
+
// /api/a11oy/v1/deva/frontier/models -> openrouter.value.labs[] {lab, count, maxCtx, free}
|
| 19 |
+
// openrouter.value.models[] {id, name, lab, ctx,
|
| 20 |
+
// price_prompt, price_completion, modality}
|
| 21 |
+
// openrouter.value.total
|
| 22 |
+
//
|
| 23 |
+
// VISUAL ENCODING (direct read of measured values; the only transform is log-normalization
|
| 24 |
+
// for scale, which is a DISPLAY transform — never a model):
|
| 25 |
+
// * each LAB = a pillar on a ring. pillar HEIGHT = log(max context window that lab
|
| 26 |
+
// publishes), normalized; a bead rides up the pillar to the lab's OPEN share
|
| 27 |
+
// (free-priced models / total models); pillar hue lerps lattice-blue (mostly paid)
|
| 28 |
+
// -> proof-teal (mostly open/free).
|
| 29 |
+
// * widest-context MODELS = satellites orbiting the core, size = log(context window),
|
| 30 |
+
// colour proof-teal if the model is free-priced else gold-amber (paid). hover shows
|
| 31 |
+
// the model name, its context window, and live prompt price.
|
| 32 |
+
// * center = proof-teal wireframe "frontier core" that pulses with the total catalog size.
|
| 33 |
+
//
|
| 34 |
+
// HONESTY: MEASURED (real live observations from the public OpenRouter model catalog).
|
| 35 |
+
// Degrades to NO-LIVE-DATA (grey) on 404 / offline; never fabricates a model or price.
|
| 36 |
+
// Context windows and prices are as PUBLISHED by each provider; informational only.
|
| 37 |
+
// COLOURS: proof-teal 0x3af4c8, lattice-blue 0x5b8dee, gold-amber 0xd7b96b (paid), greys.
|
| 38 |
+
// Purple BANNED as UI/background. 0 RUNTIME CDN. Vendored three.js via page importmap.
|
| 39 |
+
// CITATIONS: OpenRouter openrouter.ai/api/v1/models — public live model catalog.
|
| 40 |
+
|
| 41 |
+
import { createShowcase } from "./_showcase.js";
|
| 42 |
+
|
| 43 |
+
const ID = "leaders";
|
| 44 |
+
const TITLE = "Frontier Models \u00b7 Live AI Leaders (OpenRouter)";
|
| 45 |
+
|
| 46 |
+
const MODELS_EP = "/api/a11oy/v1/deva/frontier/models?limit=24";
|
| 47 |
+
|
| 48 |
+
// palette — purple BANNED
|
| 49 |
+
const C_PAID = 0xd7b96b; // gold-amber (paid model / mostly-paid lab)
|
| 50 |
+
const C_OPEN = 0x3af4c8; // proof-teal (free / open model / mostly-open lab)
|
| 51 |
+
const C_LO = 0x5b8dee; // lattice-blue (low open-share)
|
| 52 |
+
const C_HI = 0x3af4c8; // proof-teal (high open-share)
|
| 53 |
+
const C_CORE = 0x3af4c8; // proof-teal (frontier core)
|
| 54 |
+
const C_PILLAR = 0x24506a; // dim pillar body
|
| 55 |
+
const C_DIM = 0x42505d; // grey (degraded / no-live-data)
|
| 56 |
+
const C_GRID = 0x1b3a44;
|
| 57 |
+
|
| 58 |
+
const RING_R = 9.5; // lab ring radius
|
| 59 |
+
const MAXL = 16; // lab pillar slots
|
| 60 |
+
const ORBIT_R = 4.6; // model orbit radius
|
| 61 |
+
const MAXM = 8; // model satellite slots
|
| 62 |
+
const PIL_MAXH = 6.5; // tallest pillar (world units)
|
| 63 |
+
|
| 64 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 65 |
+
let _frameReg = false, _polls = [], _el = {}, _badge = null;
|
| 66 |
+
|
| 67 |
+
let _core = null;
|
| 68 |
+
let _pillars = []; // Array<{ grp, body, bead, lab }>
|
| 69 |
+
let _sats = []; // Array<{ mesh, model }>
|
| 70 |
+
|
| 71 |
+
// live state
|
| 72 |
+
const S = {
|
| 73 |
+
label: null, labs: null, models: null, total: null, state: "init",
|
| 74 |
+
};
|
| 75 |
+
|
| 76 |
+
// =============================================================================
|
| 77 |
+
// mount(ctx)
|
| 78 |
+
// =============================================================================
|
| 79 |
+
export function mount(ctx) {
|
| 80 |
+
_ctx = ctx; _stage = ctx.stage; _THREE = ctx.THREE;
|
| 81 |
+
_group = new _THREE.Group();
|
| 82 |
+
_stage.scene.add(_group);
|
| 83 |
+
try { _stage.camera.position.set(0, 10, 27); } catch (_) {}
|
| 84 |
+
try { if (_stage.controls && _stage.controls.target) { _stage.controls.target.set(0, 2.2, 0); _stage.controls.update(); } } catch (_) {}
|
| 85 |
+
try { _stage.setBloom(true); } catch (_) {}
|
| 86 |
+
|
| 87 |
+
_buildFloor();
|
| 88 |
+
_buildCore();
|
| 89 |
+
_buildPillars();
|
| 90 |
+
_buildSats();
|
| 91 |
+
|
| 92 |
+
if (!_frameReg) { _stage.onFrame(_onFrame); _frameReg = true; }
|
| 93 |
+
|
| 94 |
+
_badge = ctx.live.createBadge();
|
| 95 |
+
_polls.push(ctx.live.poll(MODELS_EP, 60000, _onModels, {
|
| 96 |
+
badge: _badge, onState: (m) => { S.state = m.state; _layout(); _layoutSats(); _paint(); },
|
| 97 |
+
}));
|
| 98 |
+
|
| 99 |
+
_buildOverlay();
|
| 100 |
+
return { id: ID, started: true };
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
// =============================================================================
|
| 104 |
+
// builders
|
| 105 |
+
// =============================================================================
|
| 106 |
+
function _buildFloor() {
|
| 107 |
+
const THREE = _THREE;
|
| 108 |
+
const grid = new THREE.GridHelper(48, 48, C_GRID, 0x0f2027);
|
| 109 |
+
grid.material.opacity = 0.16; grid.material.transparent = true; grid.position.y = -0.01;
|
| 110 |
+
_group.add(grid);
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
function _buildCore() {
|
| 114 |
+
const THREE = _THREE;
|
| 115 |
+
_core = new THREE.Mesh(
|
| 116 |
+
new THREE.IcosahedronGeometry(1.7, 1),
|
| 117 |
+
new THREE.MeshStandardMaterial({ color: C_CORE, emissive: C_CORE, emissiveIntensity: 0.35, wireframe: true, transparent: true, opacity: 0.55 }),
|
| 118 |
+
);
|
| 119 |
+
_core.position.set(0, 2.2, 0);
|
| 120 |
+
_group.add(_core);
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
function _buildPillars() {
|
| 124 |
+
const THREE = _THREE;
|
| 125 |
+
const bodyGeo = new THREE.CylinderGeometry(0.16, 0.20, 1, 14);
|
| 126 |
+
const beadGeo = new THREE.SphereGeometry(0.26, 16, 12);
|
| 127 |
+
_pillars = [];
|
| 128 |
+
for (let i = 0; i < MAXL; i++) {
|
| 129 |
+
const a = (i / MAXL) * Math.PI * 2;
|
| 130 |
+
const x = Math.cos(a) * RING_R, z = Math.sin(a) * RING_R;
|
| 131 |
+
const grp = new THREE.Group();
|
| 132 |
+
grp.position.set(x, 0, z);
|
| 133 |
+
|
| 134 |
+
const body = new THREE.Mesh(bodyGeo, new THREE.MeshStandardMaterial({
|
| 135 |
+
color: C_PILLAR, emissive: C_PILLAR, emissiveIntensity: 0.12, metalness: 0.3, roughness: 0.5,
|
| 136 |
+
}));
|
| 137 |
+
body.scale.y = 0.4; body.position.y = 0.2;
|
| 138 |
+
body.userData.label = "";
|
| 139 |
+
grp.add(body);
|
| 140 |
+
|
| 141 |
+
const bead = new THREE.Mesh(beadGeo, new THREE.MeshStandardMaterial({
|
| 142 |
+
color: C_DIM, emissive: C_DIM, emissiveIntensity: 0.15, metalness: 0.2, roughness: 0.4,
|
| 143 |
+
}));
|
| 144 |
+
bead.position.y = 0.4; bead.visible = false;
|
| 145 |
+
grp.add(bead);
|
| 146 |
+
|
| 147 |
+
_group.add(grp);
|
| 148 |
+
_pillars.push({ grp, body, bead, lab: null });
|
| 149 |
+
}
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
function _buildSats() {
|
| 153 |
+
const THREE = _THREE;
|
| 154 |
+
const geo = new THREE.SphereGeometry(0.34, 18, 14);
|
| 155 |
+
_sats = [];
|
| 156 |
+
for (let i = 0; i < MAXM; i++) {
|
| 157 |
+
const mesh = new THREE.Mesh(geo, new THREE.MeshStandardMaterial({
|
| 158 |
+
color: C_DIM, emissive: C_DIM, emissiveIntensity: 0.15, metalness: 0.35, roughness: 0.35,
|
| 159 |
+
}));
|
| 160 |
+
mesh.position.set(0, 2.2, 0);
|
| 161 |
+
mesh.visible = false;
|
| 162 |
+
mesh.userData.label = "";
|
| 163 |
+
_group.add(mesh);
|
| 164 |
+
_sats.push({ mesh, model: null });
|
| 165 |
+
}
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
// =============================================================================
|
| 169 |
+
// live data handler
|
| 170 |
+
// =============================================================================
|
| 171 |
+
function _onModels(j, meta) {
|
| 172 |
+
S.label = (_ctx.live.readHonestyLabel(j) || "MEASURED").toUpperCase();
|
| 173 |
+
const or = (j && j.openrouter && j.openrouter.value) || null;
|
| 174 |
+
S.labs = (or && Array.isArray(or.labs)) ? or.labs : null;
|
| 175 |
+
S.models = (or && Array.isArray(or.models)) ? or.models : null;
|
| 176 |
+
S.total = (or && typeof or.total === "number") ? or.total : null;
|
| 177 |
+
// An HTTP-200 can still carry a null per-source value (upstream outage). Honestly
|
| 178 |
+
// downgrade to DEGRADED rather than claim "live" while showing dashes.
|
| 179 |
+
S.state = (S.labs != null && !(meta && meta.degraded)) ? "live" : "degraded";
|
| 180 |
+
_layout(); _layoutSats(); _paint();
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
// =============================================================================
|
| 184 |
+
// geometry updaters
|
| 185 |
+
// =============================================================================
|
| 186 |
+
function _lerpHex(c0, c1, t) {
|
| 187 |
+
const a = new _THREE.Color(c0), b = new _THREE.Color(c1);
|
| 188 |
+
return a.lerp(b, Math.max(0, Math.min(1, t)));
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
function _layout() {
|
| 192 |
+
const live = S.state === "live";
|
| 193 |
+
const labs = (S.labs || []).slice(0, MAXL);
|
| 194 |
+
|
| 195 |
+
// log-normalize max context window across the visible labs for pillar heights
|
| 196 |
+
const cx = labs.map((l) => Math.log10(Math.max(1, num(l.maxCtx))));
|
| 197 |
+
const cMin = cx.length ? Math.min(...cx) : 0;
|
| 198 |
+
const cMax = cx.length ? Math.max(...cx) : 1;
|
| 199 |
+
const cSpan = Math.max(cMax - cMin, 1e-6);
|
| 200 |
+
|
| 201 |
+
_pillars.forEach((p, i) => {
|
| 202 |
+
const l = labs[i] || null;
|
| 203 |
+
p.lab = l;
|
| 204 |
+
if (!l || !live) {
|
| 205 |
+
p.body.material.color.setHex(C_PILLAR);
|
| 206 |
+
p.body.material.emissive.setHex(live ? C_PILLAR : C_DIM);
|
| 207 |
+
p.body.material.emissiveIntensity = 0.1;
|
| 208 |
+
p.body.scale.y = 0.4; p.body.position.y = 0.2;
|
| 209 |
+
p.bead.visible = false;
|
| 210 |
+
p.body.userData.label = "";
|
| 211 |
+
return;
|
| 212 |
+
}
|
| 213 |
+
const h = 0.8 + PIL_MAXH * ((Math.log10(Math.max(1, num(l.maxCtx))) - cMin) / cSpan);
|
| 214 |
+
p.body.scale.y = h; p.body.position.y = h / 2;
|
| 215 |
+
|
| 216 |
+
const open = openShare(l);
|
| 217 |
+
const col = _lerpHex(C_LO, C_HI, open);
|
| 218 |
+
p.body.material.color.copy(col);
|
| 219 |
+
p.body.material.emissive.copy(col);
|
| 220 |
+
p.body.material.emissiveIntensity = 0.22 + 0.5 * open;
|
| 221 |
+
|
| 222 |
+
p.bead.visible = true;
|
| 223 |
+
p.bead.position.y = 0.2 + open * h; // bead rides up to the open (free) share
|
| 224 |
+
p.bead.material.color.copy(col);
|
| 225 |
+
p.bead.material.emissive.copy(col);
|
| 226 |
+
p.bead.material.emissiveIntensity = 0.85;
|
| 227 |
+
|
| 228 |
+
p.body.userData.label = labShort(l.lab) + " \u00b7 " + num(l.count) + " models \u00b7 " + fmtCtx(num(l.maxCtx)) + " ctx";
|
| 229 |
+
});
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
function _layoutSats() {
|
| 233 |
+
const live = S.state === "live";
|
| 234 |
+
const models = topModels().slice(0, MAXM);
|
| 235 |
+
const ctxs = models.map((m) => Math.log10(Math.max(1, num(m.ctx))));
|
| 236 |
+
const mMin = ctxs.length ? Math.min(...ctxs) : 0;
|
| 237 |
+
const mMax = ctxs.length ? Math.max(...ctxs) : 1;
|
| 238 |
+
const mSpan = Math.max(mMax - mMin, 1e-6);
|
| 239 |
+
|
| 240 |
+
_sats.forEach((s, i) => {
|
| 241 |
+
const m = models[i] || null;
|
| 242 |
+
s.model = m;
|
| 243 |
+
if (!m || !live) { s.mesh.visible = false; s.mesh.userData.label = ""; return; }
|
| 244 |
+
s.mesh.visible = true;
|
| 245 |
+
const scale = 0.55 + 1.0 * ((Math.log10(Math.max(1, num(m.ctx))) - mMin) / mSpan);
|
| 246 |
+
s.mesh.scale.setScalar(scale);
|
| 247 |
+
const free = isFree(m);
|
| 248 |
+
const col = free ? C_OPEN : C_PAID;
|
| 249 |
+
s.mesh.material.color.setHex(col);
|
| 250 |
+
s.mesh.material.emissive.setHex(col);
|
| 251 |
+
s.mesh.material.emissiveIntensity = 0.4;
|
| 252 |
+
s.mesh.userData.label = modShort(m) + " " + fmtCtx(num(m.ctx)) + " " + priceTxt(m);
|
| 253 |
+
});
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
// =============================================================================
|
| 257 |
+
// per-frame animation
|
| 258 |
+
// =============================================================================
|
| 259 |
+
function _onFrame() {
|
| 260 |
+
const t = performance.now();
|
| 261 |
+
if (_group) _group.rotation.y = Math.sin(t * 0.00008) * 0.18;
|
| 262 |
+
if (_core) {
|
| 263 |
+
_core.rotation.y += 0.003; _core.rotation.x += 0.0012;
|
| 264 |
+
const pulse = 1 + 0.06 * Math.sin(t * 0.002);
|
| 265 |
+
_core.scale.setScalar(pulse);
|
| 266 |
+
}
|
| 267 |
+
const live = S.state === "live";
|
| 268 |
+
_sats.forEach((s, i) => {
|
| 269 |
+
if (!s.mesh.visible) return;
|
| 270 |
+
const a = t * 0.00022 * (live ? 1 : 0) + (i / MAXM) * Math.PI * 2;
|
| 271 |
+
s.mesh.position.set(Math.cos(a) * ORBIT_R, 2.2 + Math.sin(a * 1.3) * 0.6, Math.sin(a) * ORBIT_R);
|
| 272 |
+
});
|
| 273 |
+
if (live) _pillars.forEach((p, i) => {
|
| 274 |
+
if (p.bead.visible) p.bead.rotation.y += 0.02 + 0.004 * i;
|
| 275 |
+
});
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
// =============================================================================
|
| 279 |
+
// overlay
|
| 280 |
+
// =============================================================================
|
| 281 |
+
function _buildOverlay() {
|
| 282 |
+
const ctx = _ctx;
|
| 283 |
+
_show = createShowcase(ctx, {
|
| 284 |
+
id: ID, title: TITLE, accent: "#3af4c8",
|
| 285 |
+
badge: _badge,
|
| 286 |
+
chips: [{ label: "MEASURED", text: "live catalog", name: "src" }],
|
| 287 |
+
legend: ["MEASURED", "MODELED"],
|
| 288 |
+
description:
|
| 289 |
+
'The live, public <b>OpenRouter</b> model catalog as a ring of <b>pillars</b> \u2014 one ' +
|
| 290 |
+
'per <b>lab</b> \u2014 around a pulsing frontier core: pillar <b>height</b> = the widest ' +
|
| 291 |
+
'context window that lab publishes (log-scaled), a bead rides up each pillar to the lab\u2019s ' +
|
| 292 |
+
'<b>open share</b> (free-priced / total models), hue lattice-blue \u2192 proof-teal as more of ' +
|
| 293 |
+
'the lab\u2019s models are open. The <b>widest-context models</b> orbit as satellites sized by ' +
|
| 294 |
+
'context window, teal = free / amber = paid. All values are <b>live & MEASURED</b> from the ' +
|
| 295 |
+
'catalog\u2019s own published context windows and prices \u2014 no invented benchmark, no ranking. ' +
|
| 296 |
+
'Log-scaling is a display transform, not a model. 0 runtime CDN.',
|
| 297 |
+
citations:
|
| 298 |
+
"OpenRouter openrouter.ai/api/v1/models \u2014 public live model catalog. Context windows and " +
|
| 299 |
+
"prices are as PUBLISHED by each provider; informational only. MEASURED \u2014 real live observations.",
|
| 300 |
+
plain: { html: _plainHtml },
|
| 301 |
+
});
|
| 302 |
+
|
| 303 |
+
_el["l-n"] = _show.addField("labs on the frontier (live)");
|
| 304 |
+
_el["l-top"] = _show.addField("top lab (models \u00b7 max ctx)");
|
| 305 |
+
_el["l-wide"] = _show.addField("widest-context model");
|
| 306 |
+
_el["l-open"] = _show.addField("free / open \u00b7 paid");
|
| 307 |
+
_el["l-total"] = _show.addField("total models cataloged");
|
| 308 |
+
_el["l-label"] = _show.addField("honesty label");
|
| 309 |
+
|
| 310 |
+
_show.attachSceneLabels({
|
| 311 |
+
objects: () => {
|
| 312 |
+
const out = [];
|
| 313 |
+
_pillars.forEach((p) => { if (p.body && p.body.userData.label) out.push(p.body); });
|
| 314 |
+
_sats.forEach((s) => { if (s.mesh && s.mesh.visible && s.mesh.userData.label) out.push(s.mesh); });
|
| 315 |
+
return out;
|
| 316 |
+
},
|
| 317 |
+
text: (o) => (o && o.userData && o.userData.label) || "",
|
| 318 |
+
weight: (o) => (o && o.scale ? o.scale.y : 0),
|
| 319 |
+
topN: 4, hover: true, fadeNear: 11, fadeFar: 72,
|
| 320 |
+
});
|
| 321 |
+
|
| 322 |
+
_paint();
|
| 323 |
+
}
|
| 324 |
+
|
| 325 |
+
function _plainHtml() {
|
| 326 |
+
const n = S.labs ? String(S.labs.length) : "loading\u2026";
|
| 327 |
+
const top = _topLab();
|
| 328 |
+
const topTxt = top ? (esc(labShort(top.lab)) + " \u2014 " + num(top.count) + " models") : "loading\u2026";
|
| 329 |
+
return (
|
| 330 |
+
"<b>What this means:</b> A <b>frontier model</b> is one of the large AI systems the world\u2019s " +
|
| 331 |
+
"labs are racing to build. <b>OpenRouter</b> is a live marketplace that lists most of them side " +
|
| 332 |
+
"by side. This surface plots every <b>lab</b> serving models there right now as a pillar: the " +
|
| 333 |
+
"taller the pillar, the bigger the <b>context window</b> that lab\u2019s best model can read at " +
|
| 334 |
+
"once; the bead\u2019s height is how much of that lab\u2019s line-up is <b>free / open</b> (teal) " +
|
| 335 |
+
"versus paid. The busiest lab at this moment is <b>" + topTxt + "</b>, out of <b>" + n + "</b> " +
|
| 336 |
+
"competing. Orbiting the center are the individual models with the <b>widest context windows</b> " +
|
| 337 |
+
"available today. Everything here is <b>real, live catalog data</b> \u2014 nothing is ranked, " +
|
| 338 |
+
"scored, or made up \u2014 shown for orientation.");
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
// =============================================================================
|
| 342 |
+
// helpers + paint
|
| 343 |
+
// =============================================================================
|
| 344 |
+
function num(v) { return typeof v === "number" && isFinite(v) ? v : (parseFloat(v) || 0); }
|
| 345 |
+
function esc(s) { return String(s == null ? "" : s).replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }[c])); }
|
| 346 |
+
function isFree(m) { return m && num(m.price_prompt) === 0 && num(m.price_completion) === 0; }
|
| 347 |
+
function openShare(l) {
|
| 348 |
+
const c = num(l && l.count); if (!c) return 0;
|
| 349 |
+
return Math.max(0, Math.min(1, num(l.free) / c));
|
| 350 |
+
}
|
| 351 |
+
function fmtCtx(v) {
|
| 352 |
+
v = num(v);
|
| 353 |
+
if (v >= 1e6) return (v / 1e6).toFixed(v >= 1e7 ? 0 : 1) + "M";
|
| 354 |
+
if (v >= 1e3) return Math.round(v / 1e3) + "K";
|
| 355 |
+
return String(Math.round(v));
|
| 356 |
+
}
|
| 357 |
+
function priceTxt(m) {
|
| 358 |
+
if (isFree(m)) return "free";
|
| 359 |
+
const p = num(m && m.price_prompt) * 1e6; // $ per 1M prompt tokens
|
| 360 |
+
if (p <= 0) return "\u2014";
|
| 361 |
+
if (p < 1) return "$" + p.toFixed(2) + "/M";
|
| 362 |
+
return "$" + p.toFixed(p < 10 ? 1 : 0) + "/M";
|
| 363 |
+
}
|
| 364 |
+
function labShort(s) {
|
| 365 |
+
s = String(s || "").trim();
|
| 366 |
+
const M = { "openai": "OpenAI", "anthropic": "Anthropic", "google": "Google", "meta-llama": "Meta",
|
| 367 |
+
"mistralai": "Mistral", "deepseek": "DeepSeek", "qwen": "Qwen", "x-ai": "xAI",
|
| 368 |
+
"cohere": "Cohere", "microsoft": "Microsoft", "nvidia": "NVIDIA", "amazon": "Amazon",
|
| 369 |
+
"perplexity": "Perplexity", "ai21": "AI21", "moonshotai": "Moonshot" };
|
| 370 |
+
return M[s.toLowerCase()] || (s ? s.charAt(0).toUpperCase() + s.slice(1) : "other");
|
| 371 |
+
}
|
| 372 |
+
function modShort(m) {
|
| 373 |
+
const name = String((m && m.name) || (m && m.id) || "").trim();
|
| 374 |
+
const short = name.replace(/^[^:]+:\s*/, ""); // drop "Lab: " prefix if present
|
| 375 |
+
const n = 26;
|
| 376 |
+
return short.length > n ? short.slice(0, n - 1) + "\u2026" : short;
|
| 377 |
+
}
|
| 378 |
+
function topModels() {
|
| 379 |
+
const ms = (S.models || []).slice();
|
| 380 |
+
return ms.sort((a, b) => num(b.ctx) - num(a.ctx));
|
| 381 |
+
}
|
| 382 |
+
function _topLab() {
|
| 383 |
+
const ls = S.labs || [];
|
| 384 |
+
if (!ls.length) return null;
|
| 385 |
+
return ls.reduce((a, b) => (num(b.count) > num(a.count) ? b : a), ls[0]);
|
| 386 |
+
}
|
| 387 |
+
function _widest() {
|
| 388 |
+
const ms = topModels();
|
| 389 |
+
return ms.length ? ms[0] : null;
|
| 390 |
+
}
|
| 391 |
+
function _freePaid() {
|
| 392 |
+
const ms = S.models || [];
|
| 393 |
+
let f = 0, p = 0;
|
| 394 |
+
ms.forEach((m) => (isFree(m) ? f++ : p++));
|
| 395 |
+
return { f, p };
|
| 396 |
+
}
|
| 397 |
+
|
| 398 |
+
function _tok(state) {
|
| 399 |
+
if (state === "live") return null;
|
| 400 |
+
if (state === "missing") return "NO-LIVE-DATA";
|
| 401 |
+
if (state === "degraded") return "DEGRADED";
|
| 402 |
+
if (state === "error") return "OFFLINE";
|
| 403 |
+
return "\u2026";
|
| 404 |
+
}
|
| 405 |
+
function _set(id, v) { if (_el[id]) _el[id].textContent = v; }
|
| 406 |
+
|
| 407 |
+
function _paint() {
|
| 408 |
+
const t = _tok(S.state);
|
| 409 |
+
_set("l-n", t || (S.labs != null ? String(S.labs.length) : "\u2014"));
|
| 410 |
+
const top = _topLab();
|
| 411 |
+
_set("l-top", t || (top ? (labShort(top.lab) + " " + num(top.count) + " \u00b7 " + fmtCtx(num(top.maxCtx))) : "\u2014"));
|
| 412 |
+
const w = _widest();
|
| 413 |
+
_set("l-wide", t || (w ? (modShort(w) + " " + fmtCtx(num(w.ctx))) : "\u2014"));
|
| 414 |
+
if (S.models) { const fp = _freePaid(); _set("l-open", t || (fp.f + " free \u00b7 " + fp.p + " paid")); }
|
| 415 |
+
else _set("l-open", t || "\u2014");
|
| 416 |
+
_set("l-total", t || (S.total != null ? String(S.total) : "\u2014"));
|
| 417 |
+
|
| 418 |
+
// honesty label verbatim — never upgraded
|
| 419 |
+
_set("l-label", S.label || "MEASURED");
|
| 420 |
+
if (_show) { _show.setChip("src", S.label || "MEASURED", { text: "live catalog" }); _show.refreshPlain(); }
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
// =============================================================================
|
| 424 |
+
// unmount — clean up everything; must not affect other organs
|
| 425 |
+
// =============================================================================
|
| 426 |
+
export function unmount() {
|
| 427 |
+
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 428 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 429 |
+
try {
|
| 430 |
+
if (_group && _stage) {
|
| 431 |
+
_group.traverse((o) => {
|
| 432 |
+
if (o.geometry && o.geometry.dispose) o.geometry.dispose();
|
| 433 |
+
if (o.material) {
|
| 434 |
+
const ms = Array.isArray(o.material) ? o.material : [o.material];
|
| 435 |
+
ms.forEach((m) => { if (m.dispose) m.dispose(); });
|
| 436 |
+
}
|
| 437 |
+
});
|
| 438 |
+
_stage.scene.remove(_group);
|
| 439 |
+
}
|
| 440 |
+
} catch (_) {}
|
| 441 |
+
_group = _show = _core = null;
|
| 442 |
+
_pillars = []; _sats = [];
|
| 443 |
+
_el = {}; _badge = null; _frameReg = false;
|
| 444 |
+
_stage = _THREE = _ctx = null;
|
| 445 |
+
S.label = S.labs = S.models = S.total = null; S.state = "init";
|
| 446 |
+
}
|
| 447 |
+
|
| 448 |
+
export default { id: ID, title: TITLE, endpoints: [MODELS_EP], mount, unmount };
|