qualia_core_db/gguf_bridge/wasm_cpu/mod.rs
1//! Qualia's CPU-WASM LLM backend.
2//!
3//! This is a first-party execution floor, not a llama.cpp/wllama binding. It
4//! reuses Qualia's GGUF/P64 index, tokenizer, quantized GEMV and transformer
5//! mathematics while keeping WebGPU an optional accelerator.
6
7mod forward;
8#[cfg(any(test, target_arch = "wasm32"))]
9mod kernels;
10mod model;
11
12#[cfg(target_arch = "wasm32")]
13pub(crate) use kernels::q8_0_gemv_into;
14pub use model::{CpuWasmEngine, CpuWasmError, CpuWasmStep};
15
16/// Mobile-first default for the independent LLM working set. This is not part
17/// of the 42 MiB semantic/SLG Sentinel arena; model inference owns a separate,
18/// explicitly sized memory domain.
19pub const CPU_WASM_DEFAULT_CONTEXT: usize = 512;
20/// Explicit safety cap for one contiguous CPU-WASM KV allocation. This belongs
21/// to the LLM memory policy and is unrelated to the semantic Sentinel arena.
22pub const CPU_WASM_MAX_CONTEXT: usize = 4096;