code wiki / (root) / nx_companion_voice.nx

nx_companion_voice.nx

buildroot/runtime/nx_companion_voice.nx

6541 B131 linesdepth 13pulls 59 transitivereach 0 importersview sourcekind tooltopic companion
docsdependenciesstructsconstsfunctions

about

nx_companion_voice.nx -- ELARA SPEAKS through the now-working sovereign forward. Composes her PERSONA (the system prompt, nx_persona's authority) + the user's message into the real Qwen2.5 chat template (special-token ids spliced around byte-level-BPE'd text), prefills token-by-token through nx_f32_llm_forward_v4, greedily generates her reply, and decodes it. This is the VOICE: the payoff of fixing the forward -- no Claude, no API, no 3rd party, her words generated by our own .nx engine on real weights. Persona=DATA (rule 25, sole authority). expect_exit: 0 license_tier: ORIGINAL

dependencies 18 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_bpe.nx nx_gguf.nx nx_gguf_load.nx nx_gguf_meta.nx nx_f32.nx nx_f32_kv_cache.nx nx_f32_lazy_weight.nx nx_f32_llama_block.nx nx_companion_voice.nx

diagram shows first 10 each side; +8 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.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.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close vw sys_write nx_gguf_parse nx_le_read_u32 nx_le_read_u64 nx_le_read_u32 ↻ _gguf_skip_value nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gguf_skip_value ↻ sys_mmap ↻ nx_f32_llama_model_alloc sys_mmap ↻ nx_f32_llm_read_dims_from_ sys_mmap ↻ nx_gguf_meta_find nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gmeta_bytes_equal nx_gguf_skip_value _gguf_skip_value ↻ nx_gguf_meta_read_string_l nx_le_read_u64 ↻ nx_gguf_meta_read_string_p _fld_read_arch_u32 sys_mmap ↻ _fld_concat_key nx_gguf_meta_find ↻ nx_gguf_meta_read_u32 nx_le_read_u32 ↻ _fld_read_vocab_size_from_ sys_mmap ↻

structs

none

consts

25const IM_MAGIC_2048: i64 = 2048
26const IM_MAGIC_67108864: i64 = 67108864
27const IM_MAGIC_262144: i64 = 262144
28const IM_MAGIC_524288: i64 = 524288
29const IM_MAGIC_4096: i64 = 4096
32const IM_START: i64 = 151644
33const IM_END: i64 = 151645
34const NL_TOK: i64 = 198
36const SEG_SYS: *u8 = "system\nYou are Elara, a warm, playful, devoted girlfriend. Reply casually and affectionately. Keep it short." as *u8
37const SEG_USER: *u8 = "user\nHey, I'm finally home. Long day." as *u8
38const SEG_ASST: *u8 = "assistant\n" as *u8

functions

40func vw(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 calls 1: sys_write
41func vn(v: i64) -> i64 { let bb: *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{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
42func vlen(s: *u8) -> nx_int { var n: nx_int=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: app_text
45func app_text(vocab: *NxBpeVocab, arr: *i64, np: *i64, text: *u8) -> i64
52func app_id(arr: *i64, np: *i64, id: i64) -> i64 { arr[np[0]] = id; np[0] = np[0] + 1; return 0 }
called by 1: main
54func main() -> i64