nx_f32_llm_serve.nx
buildroot/runtime/nx_f32_llm_serve.nx
about
nx_f32_llm_serve.nx -- the SOVEREIGN LLM generation SEAT. Loads real Qwen2.5-0.5B GGUF ONCE at startup, binds
127.0.0.1:11434 (the seam nx_writehub_seat already POSTs to), and on POST /chat runs nx_f32_llm_run_v3 ->
returns OpenAI-chat-shaped JSON. Drop-in replacement for the Docker gen-llm:11434 seat -- 100% sovereign (our
nx_f32 stack + our own HTTP accept-loop, the nx_writer_serve pattern), NO Docker, NO 3rd-party lib, no shell.
NOT yet supervised on this box (no nishi_supervisor.sh here -- launch via knowledge/shell/seat_probe.sh or
setsid; supervision = follow-on when the seat moves to its target host). 127.0.0.1-only = seam by construction.
PERF CAVEAT (honest): scalar-CPU matmul + re-dequant per token -> slow; MAX_NEW capped low. The engine's
COHERENCE is gated separately by nx_f32_llm_live_gen_test; this organ is the serving layer around it.
expect: LIVE on :11434 (blocks). license_tier: ORIGINAL module: nishi-core.seat.llm
dependencies 27 imports · 0 importers
diagram shows first 10 each side; +17 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_connect.nxnx_tier.nxnx_bpe.nxnx_gguf.nxnx_gguf_load.nxnx_gguf_meta.nxnx_f32.nxnx_f32_kv_cache.nxnx_f32_lazy_weight.nxnx_f32_llama_block.nxnx_f32_llama_block_v4.nxnx_f32_llama_stack_v4.nxnx_f32_llama_layer_lazy_load.nxnx_f32_llm.nxnx_f32_llm_v4.nxnx_f32_llm_read_dims.nxnx_f32_bpe_load.nxnx_f32_llm_special_tokens.nxnx_f32_sampler.nxnx_f32_llm_run_v2.nxnx_f32_llm_run_v3.nxnx_http_client.nxnx_f32_div.nxnx_f32_cvt.nxnx_prng.nxnx_reasoning.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
| 37 | const NX_MAGIC_67108864: i64 = 67108864 |
| 38 | const NX_MAGIC_262144: i64 = 262144 |
| 39 | const NX_MAGIC_524288: i64 = 524288 |
| 40 | const NX_MAGIC_151644: i64 = 151644 |
| 41 | const NX_MAGIC_151645: i64 = 151645 |
| 42 | const NX_MAGIC_1048576: i64 = 1048576 |
| 43 | const NX_MAGIC_65536: i64 = 65536 |
| 44 | const NX_MAGIC_131072: i64 = 131072 |
| 45 | const NX_MAGIC_200000: i64 = 200000 |
| 46 | const NX_MAGIC_65534: i64 = 65534 |
| 50 | const NX_LSEAT_PORT: i64 = 11434 |
functions
| 52 | func ls_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 53 | func ls_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 54 | func ls_find(buf: *u8, n: i64, ndl: *u8, nl: i64) -> i64 |
| 60 | func ls_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ dst[off]=s[i]; off=off+1; i=i+1 } return off } called by 1: main |
| 61 | func ls_write_all(fd: i64, buf: *u8, n: i64) -> i64 { var off: i64=0; while off<n { let w: i64=sys_write(fd, ((buf as i64)+off) as *u8, n-off); if w<=0 { off=n } else { off=off+w } } return 0 } |
| 62 | func ls_atoi(s: *u8) -> i64 called by 1: ls_read_request |
| 76 | func ls_body_int(body: *u8, blen: i64, key: *u8) -> i64 |
| 97 | func ls_body_temp_tenths(body: *u8, blen: i64) -> i64 |
| 134 | func ls_read_request(fd: i64, req: *u8, cap: i64) -> i64 |
| 153 | func ls_extract_prompt(body: *u8, blen: i64, out: *u8, cap: i64) -> i64 |
| 175 | func ls_json_esc(src: *u8, sn: i64, dst: *u8, cap: i64) -> i64 called by 1: main |
| 190 | func main(argc: i64, argv: *i64) -> i64 |