@opennodes/registry 0.1.45 → 0.1.47
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 +1 -1
- package/package.json +2 -2
- package/src/data/locations-world.json +5 -0
- package/src/locations.js +22 -0
- package/src/search.js +18 -1
- package/src/server.js +4 -2
package/README.md
CHANGED
|
@@ -20,6 +20,6 @@ What it does:
|
|
|
20
20
|
|
|
21
21
|
Environment: `PORT`, `ONP_DB`, `ONP_REGISTRY_KEY`, `ONP_ADMIN_TOKEN`, `ONP_ALLOW_PRIVATE=1` (dev only: permit localhost nodes), `ONP_STAGE_C=0`, `ONP_REIMPORT=1`, `ONP_REIMPORT_SOURCES` (default `openrouter,huggingface`; also `models-dev`, `ollama`, and `openrouter-providers`, which makes one request per OpenRouter model, so give it a long `ONP_REIMPORT_MS`), `ONP_LOCATION_SEEDS=0` (skip the curated location seeds), `ONP_MAP_TILES` (basemap for the locations map: unset = OpenStreetMap, `off` = no map, or an XYZ URL template with `ONP_MAP_ATTRIBUTION`). The map loads Leaflet from cdnjs, pinned with subresource integrity, only on the "Where models run" page. Viewers' browsers then fetch tiles from the tile server. OpenStreetMap's tile policy asks for light use, so a busy registry should point `ONP_MAP_TILES` at its own or a commercial tile service.
|
|
22
22
|
|
|
23
|
-
Location seeds are dated JSON files (`locations-{seed}.json`): providers, their sites with `basis`, `source` and `checked`, and the models each site serves. A provider whose models are listed becomes a listing-only node `import.seed.{seed}.{id}`; one that publishes no model list is shown with a note. An entry with `nodes` describes existing registry nodes instead: its sites are shown under the first of them, with that node's models when `placement` is `all`. Providers carry `kind` and `residency`; `residency_of: "{seed}:{id}"` reuses another entry's commitments (the Canadian and European regions of a cloud share the cloud's). Corrections and new countries are welcome by pull request: cite the provider's own page for `documented`, anything else is `claimed`.
|
|
23
|
+
Location seeds are dated JSON files (`locations-{seed}.json`): providers, their sites with `basis`, `source` and `checked`, and the models each site serves. A provider whose models are listed becomes a listing-only node `import.seed.{seed}.{id}`; one that publishes no model list is shown with a note. An entry with `nodes` describes existing registry nodes instead: its sites are shown under the first of them, with that node's models when `placement` is `all`. With `placement: "all"`, or `serves_from: "{seed}:{id}"` (the node's whole API runs at that entry's sites), search and recommend also use the live sites as the node's serving locations, marked `via: "seed"`, for offerings whose card declares none, except for listings reached through the Hugging Face router or OpenRouter. Providers carry `kind` and `residency`; `residency_of: "{seed}:{id}"` reuses another entry's commitments (the Canadian and European regions of a cloud share the cloud's). Corrections and new countries are welcome by pull request: cite the provider's own page for `documented`, anything else is `claimed`.
|
|
24
24
|
|
|
25
25
|
Part of [OpenNodes](https://opennodes.io) · [specification](https://github.com/opennodes-io/opennodes/tree/main/spec) · Apache-2.0.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opennodes/registry",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.47",
|
|
4
4
|
"description": "OpenNodes (ONP) reference registry: node registration with proof-of-resource qualification (Stage A/B/C), transparent ranking, enforceable estimates, catalog importers (OpenRouter, Hugging Face, models.dev, Ollama), MCP surface, and the web app (catalog, chat, advisor, Node Builder)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@opennodes/core": "0.1.
|
|
46
|
+
"@opennodes/core": "0.1.21",
|
|
47
47
|
"pg": "^8.13.1"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -1484,6 +1484,7 @@
|
|
|
1484
1484
|
"name": "Scaleway Generative APIs",
|
|
1485
1485
|
"kind": "cloud",
|
|
1486
1486
|
"nodes": ["import.modelsdev.scaleway", "import.hf.scaleway"],
|
|
1487
|
+
"serves_from": "eu:scaleway",
|
|
1487
1488
|
"operator": { "name": "Scaleway SAS", "country": "FR", "url": "https://www.scaleway.com/en/generative-apis/" },
|
|
1488
1489
|
"note": "All serverless models run in Paris (OPCORE data centre), already in the Europe seed. Scaleway's regions (Paris, Amsterdam, Warsaw) are all in the EU; no site outside Europe.",
|
|
1489
1490
|
"sites": [],
|
|
@@ -1497,6 +1498,7 @@
|
|
|
1497
1498
|
"name": "OVHcloud AI Endpoints",
|
|
1498
1499
|
"kind": "cloud",
|
|
1499
1500
|
"nodes": ["import.modelsdev.ovhcloud", "import.hf.ovhcloud"],
|
|
1501
|
+
"serves_from": "eu:ovhcloud",
|
|
1500
1502
|
"operator": { "name": "OVH SAS", "country": "FR", "url": "https://www.ovhcloud.com/en/public-cloud/ai-endpoints/" },
|
|
1501
1503
|
"note": "Gravelines (France) is in the Europe seed and Beauharnois (Canada) in the Canada seed; no other non-European AI Endpoints site found. The capabilities doc could not be fetched directly (redirect loop); its wording was read from a search excerpt. The product page says only 'hosted and run in the EU', which sits awkwardly with the Canada seed entry.",
|
|
1502
1504
|
"sites": [],
|
|
@@ -1509,6 +1511,7 @@
|
|
|
1509
1511
|
"name": "STACKIT AI Model Serving",
|
|
1510
1512
|
"kind": "cloud",
|
|
1511
1513
|
"nodes": ["import.modelsdev.stackit"],
|
|
1514
|
+
"serves_from": "eu:stackit",
|
|
1512
1515
|
"operator": { "name": "STACKIT GmbH & Co. KG (Schwarz Digits)", "country": "DE", "url": "https://stackit.com" },
|
|
1513
1516
|
"note": "Shared models run in region eu01 (Germany), in the Europe seed. STACKIT runs regions only in Germany and Austria; no site outside Europe.",
|
|
1514
1517
|
"sites": [],
|
|
@@ -1521,6 +1524,7 @@
|
|
|
1521
1524
|
"name": "Infomaniak AI Services",
|
|
1522
1525
|
"kind": "inference",
|
|
1523
1526
|
"nodes": ["import.modelsdev.infomaniak"],
|
|
1527
|
+
"serves_from": "eu:infomaniak",
|
|
1524
1528
|
"operator": { "name": "Infomaniak Network SA", "country": "CH", "url": "https://www.infomaniak.com/en/hosting/ai-services" },
|
|
1525
1529
|
"note": "Runs on Infomaniak's own data centres in Switzerland (in the Europe seed). No site outside Switzerland.",
|
|
1526
1530
|
"sites": [],
|
|
@@ -1533,6 +1537,7 @@
|
|
|
1533
1537
|
"name": "Berget AI",
|
|
1534
1538
|
"kind": "inference",
|
|
1535
1539
|
"nodes": ["import.modelsdev.berget"],
|
|
1540
|
+
"serves_from": "eu:berget",
|
|
1536
1541
|
"operator": { "name": "Berget AI AB", "country": "SE", "url": "https://berget.ai" },
|
|
1537
1542
|
"note": "Own hardware in Sweden (in the Europe seed). DPA sub-processors: AI Iron AB (GPU bare metal), Acebit AB, Obenet AB (colocation), Stripe. No site outside Sweden.",
|
|
1538
1543
|
"sites": [],
|
package/src/locations.js
CHANGED
|
@@ -25,6 +25,28 @@ const seedIndex = (seeds) => new Map(seeds.flatMap((seed) => (seed.providers ??
|
|
|
25
25
|
/** A seed provider's own commitments, or those of the entry it points to with `residency_of`. */
|
|
26
26
|
const seedResidency = (index, p) => (p.residency_of ? index.get(p.residency_of)?.p.residency : p.residency) ?? null;
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Where the nodes a seed entry describes serve every one of their models: the entry's own live
|
|
30
|
+
* sites when `placement` is "all", or the live sites of the entry named by `serves_from`
|
|
31
|
+
* ("eu:scaleway": the whole API runs at that entry's sites). Search and recommend use these for
|
|
32
|
+
* offerings whose card declares no location (ONP-3 §5); each location is marked `via: "seed"`.
|
|
33
|
+
*/
|
|
34
|
+
export function seedPlacements(seeds) {
|
|
35
|
+
const index = seedIndex(seeds);
|
|
36
|
+
const out = new Map(); // node id -> locations
|
|
37
|
+
for (const seed of seeds) {
|
|
38
|
+
for (const p of seed.providers ?? []) {
|
|
39
|
+
if (p.models?.length || !p.nodes?.length) continue;
|
|
40
|
+
const from = p.serves_from ? index.get(p.serves_from)?.p : p.placement === 'all' ? p : null;
|
|
41
|
+
const locs = (from?.sites ?? []).map(siteLocation).filter((l) => (l.status ?? 'live') === 'live')
|
|
42
|
+
.map(({ geo: _g, ...l }) => ({ ...l, via: 'seed' }));
|
|
43
|
+
if (!locs.length) continue;
|
|
44
|
+
for (const id of p.nodes) if (!out.has(id)) out.set(id, locs);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
|
|
28
50
|
/** Visible nodes with their latest cards. */
|
|
29
51
|
async function listedCards(store) {
|
|
30
52
|
const cards = [];
|
package/src/search.js
CHANGED
|
@@ -20,6 +20,19 @@ const TIER_SCORE = { unverified: 0, community: 0.4, verified: 0.8, attested: 1.0
|
|
|
20
20
|
const MAX_AGE_MS = 60_000;
|
|
21
21
|
const catalogs = new WeakMap(); // store -> { items, at, stale, building }
|
|
22
22
|
|
|
23
|
+
// Curated seed placements (locations.js seedPlacements): node id -> where it serves every model.
|
|
24
|
+
const placements = new WeakMap(); // store -> Map
|
|
25
|
+
// A request to these hosts passes through a third-party router before it reaches the provider, so
|
|
26
|
+
// the provider's sites say nothing about where the prompt goes: no seed placement for them.
|
|
27
|
+
const ROUTER_HOSTS = new Set(['router.huggingface.co', 'openrouter.ai']);
|
|
28
|
+
const hostOf = (url) => { try { return new URL(url).hostname; } catch { return null; } };
|
|
29
|
+
|
|
30
|
+
/** Use these seed placements in search from now on (the server sets them at start and on seed import). */
|
|
31
|
+
export function setSeedPlacements(store, map) {
|
|
32
|
+
placements.set(store, map);
|
|
33
|
+
markCatalogStale(store);
|
|
34
|
+
}
|
|
35
|
+
|
|
23
36
|
/** Mark the cached catalog stale: the next read rebuilds it. */
|
|
24
37
|
export function markCatalogStale(store) {
|
|
25
38
|
const entry = catalogs.get(store);
|
|
@@ -70,12 +83,16 @@ async function buildOfferings(store) {
|
|
|
70
83
|
const nodeObs = await store.getObservations(node.id, '_node');
|
|
71
84
|
const availability = nodeObs.availability ?? null;
|
|
72
85
|
const loc = nodeObs.location ?? null;
|
|
86
|
+
const placed = ROUTER_HOSTS.has(hostOf(card.endpoints?.openai)) ? null : placements.get(store)?.get(node.id);
|
|
73
87
|
// Server-location check (location.js): what the registry found, next to what the operator declared.
|
|
74
88
|
const location = loc ? {
|
|
75
89
|
verdict: loc.verdict, server_country: loc.server?.country ?? null, network: loc.server?.network ?? null,
|
|
76
90
|
cdn: Boolean(loc.server?.cdn), latency: loc.latency?.verdict ?? 'unknown', checked_at: loc.checked_at,
|
|
77
91
|
} : null;
|
|
78
|
-
for (const
|
|
92
|
+
for (const declared of card.offerings) {
|
|
93
|
+
// No location on the card: a curated seed may say where this node serves every model.
|
|
94
|
+
const offering = placed && !Array.isArray(declared.locations) && !(card.node?.locations ?? []).length
|
|
95
|
+
? { ...declared, locations: placed } : declared;
|
|
79
96
|
const obs = await store.getObservations(node.id, offering.offering_id);
|
|
80
97
|
// Measured values override claims (DS-ADM-03/04): cap the advertised context to
|
|
81
98
|
// the verified size, and surface registry-measured latency/throughput.
|
package/src/server.js
CHANGED
|
@@ -15,7 +15,7 @@ import { runStageB, captureFingerprints } from './stageb.js';
|
|
|
15
15
|
import { startStageC } from './stagec.js';
|
|
16
16
|
import { startReimport } from './reimport.js';
|
|
17
17
|
import { makeSafeFetch } from './safefetch.js';
|
|
18
|
-
import { searchOfferings, searchOfferingsPaged, collectOfferings, watchStoreWrites, RANK_COMPONENTS, pricePublished } from './search.js';
|
|
18
|
+
import { searchOfferings, searchOfferingsPaged, collectOfferings, watchStoreWrites, setSeedPlacements, RANK_COMPONENTS, pricePublished } from './search.js';
|
|
19
19
|
import { mcpRoutes } from './mcp.js';
|
|
20
20
|
import { hostControlsNamespace, isPrivateHost, makeRateLimiter } from './namespace.js';
|
|
21
21
|
import { exportRoutes } from './export.js';
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
importOpenRouterProviders, fetchOpenRouterEndpoints, importLocationSeed,
|
|
28
28
|
HF_ROUTER_URL, HF_HUB_URL, OPENROUTER_URL, OPENROUTER_PROVIDERS_URL, OLLAMA_LIBRARY_URL,
|
|
29
29
|
} from './importers.js';
|
|
30
|
-
import { locationRoutes, loadLocationSeeds } from './locations.js';
|
|
30
|
+
import { locationRoutes, loadLocationSeeds, seedPlacements } from './locations.js';
|
|
31
31
|
|
|
32
32
|
/** Default basemap. OSM's tile policy asks for attribution and light use; busy registries set their own. */
|
|
33
33
|
export const OSM_TILES = {
|
|
@@ -60,6 +60,7 @@ export async function startRegistry({
|
|
|
60
60
|
const result = await importLocationSeed(store, seed);
|
|
61
61
|
if (result.skipped.length) console.warn(`location seed ${seed.seed}: skipped ${result.skipped.join('; ')}`);
|
|
62
62
|
}
|
|
63
|
+
setSeedPlacements(store, seedPlacements(seeds));
|
|
63
64
|
const webApp = readFileSync(fileURLToPath(new URL('./web/index.html', import.meta.url)), 'utf8');
|
|
64
65
|
let registryKeys;
|
|
65
66
|
if (keyPath && existsSync(keyPath)) {
|
|
@@ -527,6 +528,7 @@ export async function startRegistry({
|
|
|
527
528
|
const i = seeds.findIndex((s) => s.seed === seed.seed); // /v0/locations reads site-only entries from here
|
|
528
529
|
if (i < 0) seeds.push(seed); else seeds[i] = seed;
|
|
529
530
|
}
|
|
531
|
+
setSeedPlacements(store, seedPlacements(seeds));
|
|
530
532
|
sendJson(res, 200, results);
|
|
531
533
|
}],
|
|
532
534
|
|