@opennodes/registry 0.1.39 → 0.1.41
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 +6 -3
- package/bin.js +5 -0
- package/package.json +2 -2
- package/src/data/locations-ca.json +208 -0
- package/src/importers.js +196 -0
- package/src/location.js +4 -8
- package/src/locations.js +242 -0
- package/src/mcp.js +21 -15
- package/src/probes.js +21 -1
- package/src/reimport.js +8 -1
- package/src/search.js +38 -3
- package/src/server.js +48 -2
- package/src/web/index.html +293 -6
package/src/web/index.html
CHANGED
|
@@ -118,6 +118,16 @@
|
|
|
118
118
|
.chip.inst { color: var(--accent); border-color: var(--accent); }
|
|
119
119
|
.chip.imp { background: var(--panel-2); font-weight: 400; }
|
|
120
120
|
.chip.loc { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
|
|
121
|
+
.chip.b-documented { color: var(--accent); border-color: var(--accent); }
|
|
122
|
+
.chip.b-measured, .chip.b-attested { color: var(--good); border-color: var(--good); }
|
|
123
|
+
.chip.s-planned { color: var(--warn); border-color: var(--warn); }
|
|
124
|
+
.wmodels { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; font-size: 0.8rem; }
|
|
125
|
+
.wmodels .lin { font-family: "IBM Plex Mono", monospace; font-size: 0.6rem; color: var(--warn); }
|
|
126
|
+
#w-map { height: 440px; margin-bottom: 0.4rem; overflow: hidden; }
|
|
127
|
+
#w-map .leaflet-popup-content { font-family: "Archivo", "Helvetica Neue", Arial, sans-serif; font-size: 0.8rem; line-height: 1.4; margin: 0.6rem 0.8rem; }
|
|
128
|
+
#w-map .leaflet-popup-content .site + .site { border-top: 1px solid #D6DEE3; margin-top: 0.45rem; padding-top: 0.45rem; }
|
|
129
|
+
.wlegend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.74rem; color: var(--muted); margin: 0 0 0.8rem; }
|
|
130
|
+
.wlegend .dot { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; border: 2px solid currentColor; vertical-align: -0.1rem; margin-right: 0.3rem; }
|
|
121
131
|
.micro { font-family: "IBM Plex Mono", monospace; font-size: 0.58rem; font-weight: 600; letter-spacing: 0.04em; }
|
|
122
132
|
.m-measured { color: var(--good); } .m-claimed { color: var(--faint); font-weight: 400; } .m-warn { color: var(--warn); }
|
|
123
133
|
.prov { font-family: "IBM Plex Mono", monospace; font-size: 0.64rem; color: var(--faint); }
|
|
@@ -146,6 +156,12 @@
|
|
|
146
156
|
.kindtabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
147
157
|
.kindtabs .counts { font-weight: 400; margin-left: 0.25rem; }
|
|
148
158
|
.runrow code { font-size: 0.78rem; }
|
|
159
|
+
.olbox { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; font-size: 0.82rem; margin: 0 0 0.7rem; }
|
|
160
|
+
.olbox input { font: inherit; font-size: 0.78rem; width: 12.5rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 0.3rem 0.5rem; }
|
|
161
|
+
.olbox .ok { color: var(--accent); font-weight: 600; }
|
|
162
|
+
.olhelp { font-size: 0.8rem; margin: 0 0 0.8rem; }
|
|
163
|
+
.olhelp pre { font-size: 0.74rem; overflow-x: auto; margin: 0.3rem 0 0.6rem; }
|
|
164
|
+
.chip.inst { color: var(--on-accent, #fff); background: var(--accent); border-color: var(--accent); }
|
|
149
165
|
.switch { width: 30px; height: 17px; border-radius: 999px; background: var(--line); position: relative; transition: background 0.15s; flex: none; }
|
|
150
166
|
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--panel); transition: left 0.15s; }
|
|
151
167
|
.switchrow.on .switch { background: var(--accent); } .switchrow.on .switch::after { left: 15px; }
|
|
@@ -238,6 +254,7 @@
|
|
|
238
254
|
<a class="tab" data-view="models" href="#/">Models</a>
|
|
239
255
|
<a class="tab" data-view="rankings" href="#/rankings">Rankings</a>
|
|
240
256
|
<a class="tab" data-view="nodes" href="#/nodes">Nodes</a>
|
|
257
|
+
<a class="tab" data-view="where" href="#/where">Where models run</a>
|
|
241
258
|
<a class="tab" data-view="feed" href="#/new">New</a>
|
|
242
259
|
<a class="tab" data-view="build" href="#/build">Build</a>
|
|
243
260
|
<a class="tab" data-view="chat" href="#/chat">Chat</a>
|
|
@@ -261,6 +278,13 @@
|
|
|
261
278
|
</div>
|
|
262
279
|
<p class="sub hostedonly">Search across registered AI nodes and imported catalogs — pick a model on the left, its full card is on the right. Claimed values are never blended with measured ones.</p>
|
|
263
280
|
<p class="sub localonly" hidden>Models you download and run yourself with Ollama: no server, no account, and your data stays on your machine. There is nothing to verify remotely, so they are ranked by popularity (Ollama pulls); memory needs are 4-bit estimates.</p>
|
|
281
|
+
<div class="olbox localonly" id="ol-box" hidden>
|
|
282
|
+
<button class="btn sec" id="ol-check" type="button">Check my Ollama</button>
|
|
283
|
+
<input id="ol-base" aria-label="Your Ollama address" spellcheck="false">
|
|
284
|
+
<span id="ol-status" class="sub">Asks the Ollama on your own computer which models you have. The answer stays in your browser; nothing is sent to this registry.</span>
|
|
285
|
+
<span class="switchrow" id="f-installed" hidden><span class="switch"></span><b style="font-size:0.78rem">Installed only</b></span>
|
|
286
|
+
</div>
|
|
287
|
+
<div class="olhelp localonly" id="ol-help" hidden></div>
|
|
264
288
|
<div class="toolbar">
|
|
265
289
|
<input type="text" id="f-q" placeholder="Search models, families, nodes…">
|
|
266
290
|
<span class="switchrow hostedonly" id="f-verified" title="identity-fingerprinted · context-verified · continuously probed"><span class="switch"></span><b style="font-size:0.78rem">Verified only</b></span>
|
|
@@ -368,6 +392,30 @@
|
|
|
368
392
|
<div class="panel tablewrap" id="n-table"></div>
|
|
369
393
|
</div>
|
|
370
394
|
|
|
395
|
+
<!-- ================= WHERE MODELS RUN ================= -->
|
|
396
|
+
<div id="view-where" hidden>
|
|
397
|
+
<div style="display:flex; align-items:baseline; gap:0.9rem; flex-wrap:wrap"><h1>Where models run</h1><span class="counts" id="w-counts"></span></div>
|
|
398
|
+
<p class="sub">Every known serving site by country, with the models it serves and how far each location can be trusted: <b>claimed</b> (the provider or a news report says so), <b>documented</b> (the provider's own dated page), <b>measured</b> (registry probes), <b>attested</b> (a signed card backed by an audit). Built from node cards, imported catalogs and curated seeds; <a href="https://github.com/opennodes-io/opennodes/tree/main/impl/packages/registry/src/data" target="_blank" rel="noopener">corrections welcome</a>. Also as <a id="w-json" href="/v0/locations">JSON</a>, <a id="w-csv" href="/v0/locations?format=csv">CSV</a> and <a id="w-geojson" href="/v0/locations?format=geojson">GeoJSON</a> for QGIS, ArcGIS or any web map.</p>
|
|
399
|
+
<div class="toolbar">
|
|
400
|
+
<select id="w-country"><option value="">every country</option></select>
|
|
401
|
+
<select id="w-basis"><option value="">any evidence</option><option value="documented">documented or better</option><option value="measured">measured or better</option><option value="attested">attested</option></select>
|
|
402
|
+
<select id="w-status"><option value="">live and planned</option><option value="live">live only</option><option value="planned">planned only</option></select>
|
|
403
|
+
<input type="text" id="w-model" placeholder="Filter by model, e.g. gpt-oss or command">
|
|
404
|
+
<input type="text" id="w-lineage" placeholder="exclude lineage, e.g. CN" style="max-width:12rem">
|
|
405
|
+
</div>
|
|
406
|
+
<div class="panel pad" id="w-summary" style="margin-bottom:0.8rem"></div>
|
|
407
|
+
<div class="panel" id="w-map" hidden></div>
|
|
408
|
+
<div class="wlegend" id="w-legend" hidden>
|
|
409
|
+
<span><span class="dot" style="color:var(--good); background:var(--good)"></span>measured or attested</span>
|
|
410
|
+
<span><span class="dot" style="color:var(--accent); background:var(--accent)"></span>documented</span>
|
|
411
|
+
<span><span class="dot" style="color:var(--faint); background:var(--faint)"></span>claimed</span>
|
|
412
|
+
<span><span class="dot" style="color:var(--muted)"></span>hollow: approximate point, only the region or country is known</span>
|
|
413
|
+
<span><span class="dot" style="color:var(--warn); border-style:dashed"></span>dashed: planned</span>
|
|
414
|
+
<span>Size: models served. Several sites in one city share a marker.</span>
|
|
415
|
+
</div>
|
|
416
|
+
<div class="panel tablewrap" id="w-table"></div>
|
|
417
|
+
</div>
|
|
418
|
+
|
|
371
419
|
<!-- ================= NEW (feed) ================= -->
|
|
372
420
|
<div id="view-feed" hidden>
|
|
373
421
|
<h1>New</h1>
|
|
@@ -582,15 +630,19 @@ const priceStr = (p, nodeId = '') => {
|
|
|
582
630
|
const i = p.input_per_mtok ?? 0, o = p.output_per_mtok ?? 0;
|
|
583
631
|
return (i === 0 && o === 0) ? 'free' : `$${fmt(i)} / $${fmt(o)} per MTok`;
|
|
584
632
|
};
|
|
633
|
+
const basisChip = (b) => `<span class="chip b-${esc(b)}">${esc(String(b).toUpperCase())}</span>`;
|
|
634
|
+
/** "CA-QC Montréal (documented)" for each live serving site of an offering. */
|
|
635
|
+
const locStr = (locs) => (locs || []).map((l) => `${esc(l.region)}${l.site ? ' ' + esc(l.site) : ''} ${basisChip(l.basis)}`).join(' · ');
|
|
585
636
|
|
|
586
637
|
/* ---------- routing ---------- */
|
|
587
|
-
const views = ['models', 'model', 'rankings', 'nodes', 'feed', 'build', 'chat', 'node', 'register', 'qualification'];
|
|
638
|
+
const views = ['models', 'model', 'rankings', 'nodes', 'where', 'feed', 'build', 'chat', 'node', 'register', 'qualification'];
|
|
588
639
|
function route() {
|
|
589
640
|
const hash = location.hash || '#/';
|
|
590
641
|
let view = 'models', arg = null;
|
|
591
642
|
if (hash.startsWith('#/model/')) { view = 'model'; arg = decodeURIComponent(hash.slice(8)); }
|
|
592
643
|
else if (hash.startsWith('#/rankings')) view = 'rankings';
|
|
593
644
|
else if (hash.startsWith('#/nodes')) view = 'nodes';
|
|
645
|
+
else if (hash.startsWith('#/where')) view = 'where';
|
|
594
646
|
else if (hash.startsWith('#/new')) view = 'feed';
|
|
595
647
|
else if (hash.startsWith('#/build')) view = 'build';
|
|
596
648
|
else if (hash.startsWith('#/chat')) view = 'chat';
|
|
@@ -605,6 +657,7 @@ function route() {
|
|
|
605
657
|
if (view === 'chat') loadChatTargets();
|
|
606
658
|
if (view === 'rankings') loadRankings();
|
|
607
659
|
if (view === 'nodes') loadNodes();
|
|
660
|
+
if (view === 'where') loadWhere();
|
|
608
661
|
if (view === 'feed') loadFeed();
|
|
609
662
|
if (view === 'node' && arg) loadNode(arg);
|
|
610
663
|
}
|
|
@@ -633,7 +686,108 @@ document.querySelectorAll('#m-kind [data-kind]').forEach((b) => b.addEventListen
|
|
|
633
686
|
try { localStorage.setItem('onp-list-kind', listKind); } catch { /* storage blocked */ }
|
|
634
687
|
applyKind();
|
|
635
688
|
search();
|
|
689
|
+
if (listKind === 'local') autoCheckOllama();
|
|
636
690
|
}));
|
|
691
|
+
|
|
692
|
+
/* ---------- your Ollama: which local models are installed ----------
|
|
693
|
+
The browser asks the visitor's own Ollama (/api/tags) directly — only after a click, or on later
|
|
694
|
+
visits once a check has succeeded. The list of models never reaches this registry, except as the
|
|
695
|
+
ids of an "installed only" search. */
|
|
696
|
+
const OLLAMA_DEFAULT = 'http://127.0.0.1:11434';
|
|
697
|
+
const ollama = { base: OLLAMA_DEFAULT, installed: null, state: 'unknown', count: 0 };
|
|
698
|
+
try { ollama.base = localStorage.getItem('onp-ollama-base') || OLLAMA_DEFAULT; } catch { /* storage blocked */ }
|
|
699
|
+
$('#ol-base').value = ollama.base;
|
|
700
|
+
const olHost = () => { try { return new URL(ollama.base).host; } catch { return ollama.base; } };
|
|
701
|
+
/** Tags of this local model installed in the visitor's Ollama ("3b", "latest"), or null. */
|
|
702
|
+
function installedTags(o) {
|
|
703
|
+
if (!ollama.installed || !o?.local) return null;
|
|
704
|
+
return ollama.installed.get(String(o.binding?.model_id ?? o.offering_id).split(':')[0].toLowerCase()) ?? null;
|
|
705
|
+
}
|
|
706
|
+
async function checkOllama() {
|
|
707
|
+
ollama.base = ($('#ol-base').value.trim() || OLLAMA_DEFAULT).replace(/\/+$/, '');
|
|
708
|
+
try { localStorage.setItem('onp-ollama-base', ollama.base); } catch { /* storage blocked */ }
|
|
709
|
+
$('#ol-check').disabled = true;
|
|
710
|
+
$('#ol-status').textContent = 'asking your Ollama…';
|
|
711
|
+
try {
|
|
712
|
+
const r = await fetch(ollama.base + '/api/tags', { signal: AbortSignal.timeout(5000) });
|
|
713
|
+
if (!r.ok) throw new Error('status ' + r.status);
|
|
714
|
+
const { models = [] } = await r.json();
|
|
715
|
+
ollama.installed = new Map();
|
|
716
|
+
for (const m of models) {
|
|
717
|
+
const [base, tag = 'latest'] = String(m.name ?? m.model ?? '').toLowerCase().split(':');
|
|
718
|
+
if (!base) continue;
|
|
719
|
+
if (!ollama.installed.has(base)) ollama.installed.set(base, []);
|
|
720
|
+
ollama.installed.get(base).push(tag);
|
|
721
|
+
}
|
|
722
|
+
ollama.count = models.length;
|
|
723
|
+
ollama.state = 'ok';
|
|
724
|
+
try { localStorage.setItem('onp-ollama-ok', '1'); } catch { /* storage blocked */ }
|
|
725
|
+
} catch {
|
|
726
|
+
ollama.installed = null;
|
|
727
|
+
// A no-cors request still reaches a running server: if it goes through, Ollama is up and only
|
|
728
|
+
// refuses this page's origin (OLLAMA_ORIGINS); if it fails too, nothing answered.
|
|
729
|
+
let reachable = false;
|
|
730
|
+
try { await fetch(ollama.base + '/api/version', { mode: 'no-cors', signal: AbortSignal.timeout(4000) }); reachable = true; } catch { /* not running */ }
|
|
731
|
+
ollama.state = reachable ? 'blocked' : 'down';
|
|
732
|
+
} finally { $('#ol-check').disabled = false; }
|
|
733
|
+
const filtered = $('#f-installed').classList.contains('on');
|
|
734
|
+
renderOllamaStatus();
|
|
735
|
+
markInstalled();
|
|
736
|
+
if (filtered) search(); // re-filter by the new answer, or drop the filter if Ollama no longer answers
|
|
737
|
+
}
|
|
738
|
+
function autoCheckOllama() {
|
|
739
|
+
let remembered = false;
|
|
740
|
+
try { remembered = localStorage.getItem('onp-ollama-ok') === '1'; } catch { /* storage blocked */ }
|
|
741
|
+
if (remembered && ollama.state === 'unknown') checkOllama();
|
|
742
|
+
}
|
|
743
|
+
function renderOllamaStatus() {
|
|
744
|
+
const status = $('#ol-status'), help = $('#ol-help');
|
|
745
|
+
$('#f-installed').hidden = ollama.state !== 'ok';
|
|
746
|
+
if (ollama.state !== 'ok') $('#f-installed').classList.remove('on');
|
|
747
|
+
help.hidden = true;
|
|
748
|
+
if (ollama.state === 'ok') {
|
|
749
|
+
status.innerHTML = `<span class="ok">✓ Your Ollama at ${esc(olHost())}</span> has ${ollama.count} model${ollama.count === 1 ? '' : 's'} — installed ones are marked.`;
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
const origin = location.origin;
|
|
753
|
+
if (ollama.state === 'blocked') {
|
|
754
|
+
status.innerHTML = `<b>Ollama is running at ${esc(olHost())} but does not allow this page.</b> Allow it once, then quit and restart Ollama:`;
|
|
755
|
+
help.innerHTML = `<b>Windows</b> (PowerShell or cmd)<pre><code>setx OLLAMA_ORIGINS "${esc(origin)}"</code></pre>
|
|
756
|
+
<b>macOS</b><pre><code>launchctl setenv OLLAMA_ORIGINS "${esc(origin)}"</code></pre>
|
|
757
|
+
<b>Linux</b> (systemd): <code>sudo systemctl edit ollama</code>, add the two lines below, then <code>sudo systemctl restart ollama</code><pre><code>[Service]
|
|
758
|
+
Environment="OLLAMA_ORIGINS=${esc(origin)}"</code></pre>
|
|
759
|
+
<span class="sub">This lets this page read which models you have and use the playground; other sites stay blocked. To allow more origins, separate them with commas.</span>`;
|
|
760
|
+
help.hidden = false;
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
status.innerHTML = `<b>No Ollama answered at ${esc(olHost())}.</b> Start it, or install it from <a href="https://ollama.com/download" target="_blank" rel="noopener">ollama.com</a>, then check again. If your browser asked whether this page may reach devices on your network, allow it.`;
|
|
764
|
+
}
|
|
765
|
+
/** Mark installed models in the list, on the open card and in the playground note. */
|
|
766
|
+
function markInstalled() {
|
|
767
|
+
document.querySelectorAll('.mitem').forEach((el) => {
|
|
768
|
+
const o = lastResults.find((x) => `${x.node_id}/${x.offering_id}` === el.dataset.key);
|
|
769
|
+
if (!o?.local) return;
|
|
770
|
+
const tags = installedTags(o);
|
|
771
|
+
const chip = el.querySelector('.chip.loc, .chip.inst');
|
|
772
|
+
if (!chip) return;
|
|
773
|
+
chip.className = tags ? 'chip inst' : 'chip loc';
|
|
774
|
+
chip.textContent = tags ? 'INSTALLED' : 'LOCAL';
|
|
775
|
+
chip.title = tags ? 'installed in your Ollama: ' + tags.join(', ') : '';
|
|
776
|
+
});
|
|
777
|
+
const inst = $('#md-inst');
|
|
778
|
+
if (inst) {
|
|
779
|
+
const o = pgOfferings.find((x) => x.local);
|
|
780
|
+
const tags = installedTags(o);
|
|
781
|
+
inst.hidden = ollama.state !== 'ok' || !o;
|
|
782
|
+
inst.className = tags ? 'chip inst' : 'chip';
|
|
783
|
+
inst.textContent = tags ? `INSTALLED: ${tags.join(', ')}` : 'NOT INSTALLED';
|
|
784
|
+
}
|
|
785
|
+
pgUpdateNote();
|
|
786
|
+
}
|
|
787
|
+
$('#ol-check').addEventListener('click', checkOllama);
|
|
788
|
+
$('#ol-base').addEventListener('keydown', (e) => { if (e.key === 'Enter') checkOllama(); });
|
|
789
|
+
$('#f-installed').addEventListener('click', () => { $('#f-installed').classList.toggle('on'); search(); });
|
|
790
|
+
if (listKind === 'local') autoCheckOllama();
|
|
637
791
|
const sup = new Set();
|
|
638
792
|
document.querySelectorAll('.toggle').forEach((b) => b.addEventListener('click', () => {
|
|
639
793
|
b.classList.toggle('on'); b.classList.contains('on') ? sup.add(b.dataset.sup) : sup.delete(b.dataset.sup); search();
|
|
@@ -750,7 +904,10 @@ async function search() {
|
|
|
750
904
|
if ($('#f-eea').classList.contains('on')) p.set('jurisdiction', 'eea');
|
|
751
905
|
if ($('#f-price').value) p.set('max_input_price', $('#f-price').value);
|
|
752
906
|
if (sup.size) p.set('supports', [...sup].join(','));
|
|
753
|
-
} else
|
|
907
|
+
} else {
|
|
908
|
+
if ($('#f-mem').value) p.set('memory_gb', $('#f-mem').value);
|
|
909
|
+
if ($('#f-installed').classList.contains('on') && ollama.installed) p.set('ids', [...ollama.installed.keys()].join(','));
|
|
910
|
+
}
|
|
754
911
|
p.set('sort', $('#f-sort').value);
|
|
755
912
|
listQuery = p.toString();
|
|
756
913
|
try {
|
|
@@ -831,11 +988,12 @@ function sizesBit(o) {
|
|
|
831
988
|
return (sz.length > 1 ? `${sz[0].tag}–${sz.at(-1).tag}` : sz[0].tag) + ` · from ~${sz[0].memory_gb} GB`;
|
|
832
989
|
}
|
|
833
990
|
function renderLocalItem(o) {
|
|
991
|
+
const tags = installedTags(o);
|
|
834
992
|
return `<div class="mitem" data-artifact="${esc(o.model.artifact)}" data-key="${esc(o.node_id + '/' + o.offering_id)}">
|
|
835
993
|
<div class="t">
|
|
836
994
|
<span class="nm">${esc(o.model.name)}</span>
|
|
837
995
|
${o.specialty ? `<span class="chip">${esc(o.specialty)}</span>` : ''}
|
|
838
|
-
<span class="chip loc">LOCAL</span>
|
|
996
|
+
${tags ? `<span class="chip inst" title="installed in your Ollama: ${esc(tags.join(', '))}">INSTALLED</span>` : '<span class="chip loc">LOCAL</span>'}
|
|
839
997
|
</div>
|
|
840
998
|
<div class="b">
|
|
841
999
|
${sizesBit(o) ? `<span>${esc(sizesBit(o))}</span>` : ''}
|
|
@@ -887,6 +1045,8 @@ window.toggleRow = async function (el, idx) {
|
|
|
887
1045
|
${o.serving?.max_output_tokens ? `<dt>max output</dt><dd class="num">${fmtInt(o.serving.max_output_tokens)}</dd>` : ''}
|
|
888
1046
|
${hwStr(o) ? `<dt>hardware</dt><dd>${hwStr(o)}</dd>` : ''}
|
|
889
1047
|
<dt>schemes</dt><dd>${esc((o.pricing.schemes || []).join(', '))}</dd>
|
|
1048
|
+
${o.local ? '' : `<dt>served from</dt><dd>${o.locations?.length ? locStr(o.locations) : '<span style="color:var(--faint)">location not declared</span>'}</dd>`}
|
|
1049
|
+
${o.model.lineage_origins ? `<dt>lineage</dt><dd>${esc(o.model.lineage_origins.join(', '))} <span class="prov" style="display:inline">· declared</span></dd>` : ''}
|
|
890
1050
|
${o.local ? `<dt>run locally</dt><dd><code style="background:var(--panel-2); padding:0.1em 0.4em; border-radius:3px" class="mono">${esc(o.local.run)}</code>${o.local.pulls ? ` <span class="prov" style="display:inline">· ${esc(o.local.pulls)} pulls</span>` : ''}${o.local.sizes ? `<br><span class="prov" style="display:inline" title="Memory to run it at Ollama's default 4-bit quantization: weights plus runtime and a default context; an estimate">memory needed: ${o.local.sizes.map((t) => `${esc(t)} ~${memGb(t) ?? '?'} GB`).join(' · ')}</span>` : ''}</dd>` : ''}
|
|
891
1051
|
</dl>
|
|
892
1052
|
</div>
|
|
@@ -1022,10 +1182,11 @@ async function loadModel(artifact) {
|
|
|
1022
1182
|
`<span class="chip">${esc(first.modality)}</span>`,
|
|
1023
1183
|
first.model.family ? `<span class="chip">${esc(first.model.family)}</span>` : '',
|
|
1024
1184
|
isLocal && first.specialty && first.specialty !== first.modality ? `<span class="chip">${esc(first.specialty)}</span>` : '',
|
|
1025
|
-
isLocal ? '<span class="chip loc">LOCAL</span>' : '',
|
|
1185
|
+
isLocal ? '<span class="chip loc">LOCAL</span><span class="chip" id="md-inst" hidden></span>' : '',
|
|
1026
1186
|
...extLinks,
|
|
1027
1187
|
].join('');
|
|
1028
1188
|
$('#md-offtitle').textContent = isLocal ? 'Run it' : 'Offerings';
|
|
1189
|
+
if (isLocal) autoCheckOllama();
|
|
1029
1190
|
$('#md-count').textContent = isLocal ? 'with Ollama, on your own machine' : list.length + ' node' + (list.length === 1 ? '' : 's');
|
|
1030
1191
|
|
|
1031
1192
|
// description (imported catalogs carry one; absent otherwise)
|
|
@@ -1068,7 +1229,7 @@ async function loadModel(artifact) {
|
|
|
1068
1229
|
$('#pg-customrow').hidden = pgOfferings.length > 0; // listing-only offerings leave just the custom endpoint
|
|
1069
1230
|
$('#pg-out').textContent = '';
|
|
1070
1231
|
$('#pg-meta').textContent = '';
|
|
1071
|
-
|
|
1232
|
+
markInstalled();
|
|
1072
1233
|
$('#pg-hosted').innerHTML = '';
|
|
1073
1234
|
if (pgOfferings.length && pgOfferings.every(runsLocally)) showHostedAlternatives(first, artifact);
|
|
1074
1235
|
const runName = first.binding?.model_id ?? first.model.name;
|
|
@@ -1194,6 +1355,15 @@ function pgUpdateNote() {
|
|
|
1194
1355
|
note.innerHTML = `This listing has no server behind it: Send goes to ${app} on <b>your own computer</b> (${esc(localHost(o))}), `
|
|
1195
1356
|
+ `and answers only if ${app} is running with this model installed${o.local?.run ? ` (<code class="mono">${esc(o.local.run)}</code>)` : ''}. `
|
|
1196
1357
|
+ 'It tests your machine, not a node.';
|
|
1358
|
+
if (o.local && ollama.state === 'ok') {
|
|
1359
|
+
const tags = installedTags(o);
|
|
1360
|
+
const id = o.binding?.model_id ?? o.offering_id;
|
|
1361
|
+
note.innerHTML += tags
|
|
1362
|
+
? ` <b>Installed in your Ollama</b> (${esc(tags.map((t) => id + ':' + t).join(', '))}), so ${embed ? 'Embed' : 'Send'} should answer.`
|
|
1363
|
+
: ` <b>Not installed in your Ollama yet:</b> <code class="mono">ollama pull ${esc(id)}</code> first.`;
|
|
1364
|
+
} else if (o.local && ollama.state === 'blocked') {
|
|
1365
|
+
note.innerHTML += ' <b>Your Ollama does not allow this page yet</b> — see "Check my Ollama" on the local models list.';
|
|
1366
|
+
}
|
|
1197
1367
|
}
|
|
1198
1368
|
/** On a local-only model page: hosted listings of the same model, so it can be tried without installing anything. */
|
|
1199
1369
|
async function showHostedAlternatives(first, artifact) {
|
|
@@ -2033,7 +2203,7 @@ async function loadNodes() {
|
|
|
2033
2203
|
<td><a href="#/node/${encodeURIComponent(n.id)}" style="font-weight:600">${esc(n.id)}</a></td>
|
|
2034
2204
|
<td><span style="display:inline-flex; gap:0.3rem">${tierChip(n.tier)}${n.institutional ? '<span class="chip inst">institutional</span>' : ''}${n.source === 'import' ? '<span class="chip imp">IMPORTED</span>' : ''}</span></td>
|
|
2035
2205
|
<td>${esc(n.operator ?? '—')}${n.country ? ' <span style="color:var(--muted)">(' + esc(n.country) + ')</span>' : ''}</td>
|
|
2036
|
-
<td style="color:var(--muted)">${esc((n.regions || []).join(', ') || '—')}</td>
|
|
2206
|
+
<td style="color:var(--muted)">${esc([...new Set([...(n.regions || []), ...(n.locations || []).map((l) => l.region)])].join(', ') || '—')}</td>
|
|
2037
2207
|
<td>${n.offerings}</td>
|
|
2038
2208
|
<td>${n.availability?.ratio != null ? Math.round(n.availability.ratio * 100) + '%' : '—'}</td>
|
|
2039
2209
|
<td><span class="prov">${ago(n.updated_at)}</span></td>
|
|
@@ -2041,6 +2211,123 @@ async function loadNodes() {
|
|
|
2041
2211
|
} catch (e) { $('#n-table').innerHTML = '<p class="err">' + esc(e.message) + '</p>'; }
|
|
2042
2212
|
}
|
|
2043
2213
|
|
|
2214
|
+
/* ---------- where models run ---------- */
|
|
2215
|
+
let whereCountriesLoaded = false;
|
|
2216
|
+
async function loadWhere() {
|
|
2217
|
+
const qs = new URLSearchParams();
|
|
2218
|
+
const set = (k, id) => { const v = $(id).value.trim(); if (v) qs.set(k, v); };
|
|
2219
|
+
set('country', '#w-country'); set('basis', '#w-basis'); set('status', '#w-status');
|
|
2220
|
+
set('model', '#w-model'); set('exclude_lineage', '#w-lineage');
|
|
2221
|
+
const q = qs.toString() ? '?' + qs : '';
|
|
2222
|
+
$('#w-json').href = '/v0/locations' + q;
|
|
2223
|
+
$('#w-csv').href = '/v0/locations' + (q ? q + '&' : '?') + 'format=csv';
|
|
2224
|
+
$('#w-geojson').href = '/v0/locations' + (q ? q + '&' : '?') + 'format=geojson';
|
|
2225
|
+
try {
|
|
2226
|
+
const r = await api('/v0/locations' + q);
|
|
2227
|
+
renderWhereMap(r.sites).catch((e) => { $('#w-map').hidden = true; $('#w-legend').hidden = true; console.warn('map:', e.message); });
|
|
2228
|
+
if (!whereCountriesLoaded && !q) {
|
|
2229
|
+
whereCountriesLoaded = true;
|
|
2230
|
+
$('#w-country').innerHTML = '<option value="">every country</option>'
|
|
2231
|
+
+ r.countries.map((c) => `<option value="${esc(c.country)}">${esc(c.country)} · ${c.sites} sites</option>`).join('');
|
|
2232
|
+
}
|
|
2233
|
+
const s = r.summary;
|
|
2234
|
+
$('#w-counts').textContent = `${s.sites} sites · ${s.countries} countries`;
|
|
2235
|
+
$('#w-summary').innerHTML = `<div style="display:flex; flex-wrap:wrap; gap:0.4rem 1.2rem; font-size:0.84rem">`
|
|
2236
|
+
+ r.countries.map((c) => `<span><b>${esc(c.country)}</b> ${c.providers} providers · ${c.sites} sites (${c.live_sites} live) · ${c.models} models</span>`).join('')
|
|
2237
|
+
+ `</div><p class="prov" style="margin:0.5rem 0 0">${fmtInt(s.located_offerings)} offerings in the registry declare where they run; ${fmtInt(s.unlocated_offerings)} do not. That gap is what this page exists to close.</p>`;
|
|
2238
|
+
const models = (x) => x.models.length
|
|
2239
|
+
? `<div class="wmodels">${x.models.slice(0, 12).map((m) => `<span>${esc(m.name)}${m.lineage_origins ? ` <span class="lin">${esc(m.lineage_origins.join('/'))}</span>` : ''}</span>`).join('')}${x.models.length > 12 ? `<span class="prov">+${x.models.length - 12} more</span>` : ''}</div>`
|
|
2240
|
+
: `<span style="color:var(--muted); font-size:0.8rem">${esc(x.models_note ?? '—')}</span>`;
|
|
2241
|
+
const provider = (x) => (x.source === 'seed'
|
|
2242
|
+
? `<b>${esc(x.provider)}</b>`
|
|
2243
|
+
: `<a href="#/node/${encodeURIComponent(x.node_id)}" style="font-weight:600">${esc(x.provider)}</a>`)
|
|
2244
|
+
+ (x.operator_country ? ` <span style="color:var(--muted)">(${esc(x.operator_country)})</span>` : '')
|
|
2245
|
+
+ (x.source !== 'registration' ? ' <span class="chip imp">' + (x.source === 'seed' ? 'SEED' : 'IMPORTED') + '</span>' : '');
|
|
2246
|
+
$('#w-table').innerHTML = r.sites.length ? `<table class="grid"><thead><tr>
|
|
2247
|
+
<th>REGION</th><th>SITE</th><th>PROVIDER</th><th>STATUS</th><th>EVIDENCE</th><th>MODELS SERVED</th>
|
|
2248
|
+
</tr></thead><tbody>` + r.sites.map((x) => `<tr>
|
|
2249
|
+
<td class="mono" style="font-size:0.78rem">${esc(x.region)}</td>
|
|
2250
|
+
<td>${esc(x.site ?? '—')}${x.facility_operator ? `<span class="prov">run by ${esc(x.facility_operator)}</span>` : ''}${x.note ? `<span class="prov">${esc(x.note)}</span>` : ''}</td>
|
|
2251
|
+
<td>${provider(x)}</td>
|
|
2252
|
+
<td><span class="chip s-${esc(x.status)}">${esc(String(x.status).toUpperCase())}</span></td>
|
|
2253
|
+
<td>${basisChip(x.basis)}${x.source_url ? `<span class="prov"><a href="${esc(x.source_url)}" target="_blank" rel="noopener">source</a>${x.checked ? ' · checked ' + esc(x.checked) : ''}</span>` : ''}</td>
|
|
2254
|
+
<td>${models(x)}</td>
|
|
2255
|
+
</tr>`).join('') + '</tbody></table>' : '<p class="sub" style="padding:0.9rem 1rem; margin:0">No sites match these filters.</p>';
|
|
2256
|
+
} catch (e) { $('#w-table').innerHTML = '<p class="err">' + esc(e.message) + '</p>'; }
|
|
2257
|
+
}
|
|
2258
|
+
/* Map: Leaflet is fetched only when this page opens (no CDN or tile requests elsewhere in the
|
|
2259
|
+
app), pinned by version and integrity. Tiles come from the registry's /v0/health `map`
|
|
2260
|
+
setting; when it is null the map stays hidden and the table carries everything. */
|
|
2261
|
+
const LEAFLET = {
|
|
2262
|
+
css: ['https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.min.css', 'sha512-h9FcoyWjHcOcmEVkxOfTLnmZFWIH0iZhZT1H2TbOq55xssQGEJHEaIm+PgoUaZbRvQTNTluNOEfb1ZRy6D3BOw=='],
|
|
2263
|
+
js: ['https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.min.js', 'sha512-puJW3E/qXDqYp9IfhAI54BJEaWIfloJ7JWs7OeD5i6ruC9JZL1gERT1wjtwXFlh7CjE7ZJ+/vcRZRkIYIb6p4g=='],
|
|
2264
|
+
};
|
|
2265
|
+
let leafletReady = null, whereMap = null, whereLayer = null, mapConfig;
|
|
2266
|
+
function loadLeaflet() {
|
|
2267
|
+
leafletReady ??= new Promise((resolve, reject) => {
|
|
2268
|
+
const css = Object.assign(document.createElement('link'), { rel: 'stylesheet', href: LEAFLET.css[0], integrity: LEAFLET.css[1], crossOrigin: 'anonymous', referrerPolicy: 'no-referrer' });
|
|
2269
|
+
const js = Object.assign(document.createElement('script'), { src: LEAFLET.js[0], integrity: LEAFLET.js[1], crossOrigin: 'anonymous', referrerPolicy: 'no-referrer' });
|
|
2270
|
+
js.onload = () => resolve(window.L);
|
|
2271
|
+
js.onerror = () => { leafletReady = null; reject(new Error('map library did not load')); };
|
|
2272
|
+
document.head.append(css, js);
|
|
2273
|
+
});
|
|
2274
|
+
return leafletReady;
|
|
2275
|
+
}
|
|
2276
|
+
const BASIS_ORDER = ['claimed', 'documented', 'measured', 'attested'];
|
|
2277
|
+
async function renderWhereMap(sites) {
|
|
2278
|
+
if (mapConfig === undefined) mapConfig = (await api('/v0/health')).map ?? null;
|
|
2279
|
+
if (!mapConfig) return;
|
|
2280
|
+
const L = await loadLeaflet();
|
|
2281
|
+
$('#w-map').hidden = false; $('#w-legend').hidden = false;
|
|
2282
|
+
const css = getComputedStyle(document.documentElement);
|
|
2283
|
+
const color = { claimed: css.getPropertyValue('--faint').trim(), documented: css.getPropertyValue('--accent').trim(),
|
|
2284
|
+
measured: css.getPropertyValue('--good').trim(), attested: css.getPropertyValue('--good').trim(), planned: css.getPropertyValue('--warn').trim() };
|
|
2285
|
+
if (!whereMap) {
|
|
2286
|
+
whereMap = L.map('w-map', { worldCopyJump: true, scrollWheelZoom: false }).setView([50, -95], 3);
|
|
2287
|
+
L.tileLayer(mapConfig.tiles, { attribution: mapConfig.attribution, maxZoom: mapConfig.max_zoom ?? 19 }).addTo(whereMap);
|
|
2288
|
+
whereLayer = L.layerGroup().addTo(whereMap);
|
|
2289
|
+
}
|
|
2290
|
+
// The container was hidden until now: let layout give it a size before fitting bounds.
|
|
2291
|
+
await new Promise((r) => requestAnimationFrame(() => r()));
|
|
2292
|
+
whereMap.invalidateSize();
|
|
2293
|
+
whereLayer.clearLayers();
|
|
2294
|
+
// One marker per point: sites in the same city (Montréal: AWS, Google, Oracle) share it.
|
|
2295
|
+
const groups = new Map();
|
|
2296
|
+
for (const s of sites.filter((x) => x.geo)) {
|
|
2297
|
+
const key = s.geo.lat.toFixed(3) + ',' + s.geo.lon.toFixed(3);
|
|
2298
|
+
if (!groups.has(key)) groups.set(key, []);
|
|
2299
|
+
groups.get(key).push(s);
|
|
2300
|
+
}
|
|
2301
|
+
const bounds = [];
|
|
2302
|
+
for (const group of groups.values()) {
|
|
2303
|
+
const { lat, lon } = group[0].geo;
|
|
2304
|
+
const best = group.map((s) => s.basis).sort((a, b) => BASIS_ORDER.indexOf(b) - BASIS_ORDER.indexOf(a))[0];
|
|
2305
|
+
const derived = group.every((s) => s.geo.derived);
|
|
2306
|
+
const planned = group.every((s) => s.status === 'planned');
|
|
2307
|
+
const models = group.reduce((n, s) => n + s.models.length, 0);
|
|
2308
|
+
const c = planned ? color.planned : (color[best] || color.claimed);
|
|
2309
|
+
const marker = L.circleMarker([lat, lon], {
|
|
2310
|
+
radius: Math.min(22, 6 + Math.sqrt(models) * 2.2), color: c, weight: 2,
|
|
2311
|
+
fillColor: c, fillOpacity: derived ? 0 : 0.55, dashArray: planned ? '4 3' : null,
|
|
2312
|
+
});
|
|
2313
|
+
marker.bindPopup(group.map((s) => `<div class="site">
|
|
2314
|
+
<b>${esc(s.provider)}</b>${s.operator_country ? ` (${esc(s.operator_country)})` : ''}<br>
|
|
2315
|
+
${esc(s.site ?? 'site not named')} · <span class="mono">${esc(s.region)}</span> · ${esc(s.status)} · ${basisChip(s.basis)}
|
|
2316
|
+
${s.geo.derived ? `<br><i style="color:#5C6E7E">Approximate: only the ${esc(s.geo.precision)} is known</i>` : ''}
|
|
2317
|
+
<br>${s.models.length ? esc(s.models.slice(0, 8).map((m) => m.name).join(', ')) + (s.models.length > 8 ? ` +${s.models.length - 8} more` : '') : `<span style="color:#5C6E7E">${esc(s.models_note ?? 'no models listed')}</span>`}
|
|
2318
|
+
${s.source === 'seed' ? '' : `<br><a href="#/node/${encodeURIComponent(s.node_id)}">node card</a>`}${s.source_url ? ` · <a href="${esc(s.source_url)}" target="_blank" rel="noopener">source</a>` : ''}
|
|
2319
|
+
</div>`).join(''), { maxWidth: 320, maxHeight: 320 });
|
|
2320
|
+
marker.bindTooltip(`${group.length} site${group.length > 1 ? 's' : ''} · ${models} models`);
|
|
2321
|
+
marker.addTo(whereLayer);
|
|
2322
|
+
bounds.push([lat, lon]);
|
|
2323
|
+
}
|
|
2324
|
+
if (bounds.length) whereMap.fitBounds(bounds, { padding: [30, 30], maxZoom: 6 });
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
for (const id of ['w-country', 'w-basis', 'w-status']) $('#' + id).addEventListener('change', loadWhere);
|
|
2328
|
+
let whereDebounce;
|
|
2329
|
+
for (const id of ['w-model', 'w-lineage']) $('#' + id).addEventListener('input', () => { clearTimeout(whereDebounce); whereDebounce = setTimeout(loadWhere, 250); });
|
|
2330
|
+
|
|
2044
2331
|
/* ---------- feed ---------- */
|
|
2045
2332
|
async function loadFeed() {
|
|
2046
2333
|
try {
|