code wiki / _hdl_build / nx_nofloat_serve.nx
nx_nofloat_serve.nx
buildroot/runtime/_hdl_build/nx_nofloat_serve.nx
about
nx_nofloat_serve.nx -- the DEPLOYABLE no-float LLM daemon (ops shell around the gated pure core
nx_nofloat_serve_core). Binds 127.0.0.1:8032 and serves the interactive app + JSON API for the sovereign
100pct-integer Qwen2.5-0.5B: POST /gen {prompt,max_new,mode} -> readable text (byte-level-BPE decoded),
GET / app page, GET /health, GET /api. FAIL-FAST startup (Rule 20): the model is loaded and BOTH
dequant-once caches are built BEFORE bind/listen -- a daemon that accepts is a daemon that can serve.
Single accept loop = requests naturally serialize (one 16-core box, one pool). WSL2 forwards localhost
to Windows, so the app is browsable at http://localhost:8032/ on the host. Runs forever; build with
--build-only, run deliberately (same pattern as nx_relate_daemon :8027). license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_nofloat_serve_core.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 10 | const NSD_MAGIC_131072: i64 = 131072 |
| 11 | const NSD_MAGIC_262144: i64 = 262144 |
| 13 | const NSD_PORT: i64 = 0x1f60 // 8032 |
| 14 | const NSD_MODEL: *u8 = "/home/elderwesto/nx_stage/nx_real_model.gguf" |
functions
| 16 | func nsd_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } called by 1: main |
| 17 | func nsd_pn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } called by 1: main |
| 19 | func nsd_addr(out: *u8, port: i64) -> i64 called by 1: main |
| 32 | func nsd_write_all(fd: i64, buf: *u8, n: i64) -> i64 |
| 38 | func nsd_read_req(fd: i64, buf: *u8, cap: i64) -> i64 calls 1: sys_read |
| 93 | func main(argc: i64, argv: *i64) -> i64 |