code wiki / (root) / nx_llm_route_gate.nx

nx_llm_route_gate.nx

buildroot/runtime/nx_llm_route_gate.nx

5841 B90 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic llm
docsdependenciesstructsconstsfunctions

about

nx_llm_route_gate.nx -- the REFEREE for companionchat CC6 (go_llm_route in nx_llm_route.nx): a route row selects a backend by trigger, first row wins, case-insensitive, `*` is a default; no conf / no match / malformed target = NO ROUTE; the prepend puts the routed backend first without losing the local candidates; the provenance label names what answered. GPU-free, in-process, fixture confs under /tmp/<gate>/ written at run time (never a checked-in fixture). license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_llm_route.nx nx_llm_route_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_llm_route.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_mkdir sys_unlinkat lg_write sys_openat_wr sys_write ↻ lg_len sys_close gv_check gv_puts ↻ sys_mmap ↻ go_llm_route_from sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close ↻ llr_has_ci

structs

none

consts

10const LG_DIR: *u8 = "/tmp/nx_llm_route_gate" as *u8
11const LG_CONF: *u8 = "/tmp/nx_llm_route_gate/routes.conf" as *u8
12const LG_CONF_DEFAULT: *u8 = "/tmp/nx_llm_route_gate/routes_default.conf" as *u8
13const LG_CONF_BAD: *u8 = "/tmp/nx_llm_route_gate/routes_bad.conf" as *u8
14const LG_CONF_ABSENT: *u8 = "/tmp/nx_llm_route_gate/does_not_exist.conf" as *u8
15const LG_MODE_DIR: i64 = 511
16const LG_MODE_FILE: i64 = 420
17const LG_ROWS: *u8 = "# fixture routes\ndeep|think hard|10.9.8.7|5000\nfast|quick|10.9.8.6|5001\n" as *u8
18const LG_ROWS_DEFAULT: *u8 = "every|*|10.9.8.5|5002\n" as *u8
19const LG_ROWS_BAD: *u8 = "broken|think hard|10.9.8.999|5000\n" as *u8

functions

21func lg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: lg_writemain
22func lg_eq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] == b[i] { if a[i] == (0 as u8) { return 1 } i = i + 1 } return 0 }
called by 1: main
23func lg_write(path: *u8, body: *u8) -> i64
31func main() -> i64