code wiki / (root) / nx_model_port_registry.nx

nx_model_port_registry.nx

buildroot/runtime/nx_model_port_registry.nx

4829 B89 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic model
docsdependenciesstructsconstsfunctions

about

nx_model_port_registry.nx -- the STANDARD sovereign MODEL-PORT registry: ONE data-driven place that maps every ported (or target) external model -> {family, source URL path, container format, loader organ, status}. Today the ecosystem ports models by COPY-PASTE (nx_hifigan_*, nx_apertus_*, nx_qwen_*/gguf each hardcode their URL, shards, shas, format inline) -- there is no queryable "what have we ported + how" backbone and no format->driver dispatch. This organ is that backbone: a reusable LIBRARY (no main) the team + the generic port-driver query, so porting a NEW model becomes "add a registry row + reuse the fetch/verify/parse/dequant/load organs", not a new copy-paste. Provenance is LIAR-KILLED downstream (nx_model_port_registry_gate opens every entry's loader organ). Data-as-data (rule 11/6): all model facts are table rows, no logic hardcodes a URL. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_model_port_registry.nx nx_model_port_registry_gate.nx

imports: nx_syscalls.nx

imported by: nx_model_port_registry_gate.nx

structs

none

consts

11const MPR_N: i64 = 4 // registry entries
12const MPR_FIELDS: i64 = 6 // name, family, source, format, loader, status
14const MPR_NAME: i64 = 0
15const MPR_FAMILY: i64 = 1
16const MPR_SOURCE: i64 = 2
17const MPR_FORMAT: i64 = 3
18const MPR_LOADER: i64 = 4
19const MPR_STATUS: i64 = 5

functions

21func mpr_streq(a: *u8, b: *u8) -> i64
28func mpr_count() -> i64 { return MPR_N }
called by 1: main
33func mpr_init(tbl: *i64) -> i64
called by 1: main
66func mpr_get(tbl: *i64, idx: i64, field: i64) -> *u8
called by 1: main
71func mpr_lookup(tbl: *i64, name: *u8) -> i64
called by 1: main calls 1: mpr_streq
82func mpr_driver_for(fmt: *u8) -> *u8
called by 1: main calls 1: mpr_streq
89func mpr_open(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close