r/LocalAIStack • • 4h ago

LexiSuite ad31b74: my all-Rust local AI stack gets its own AI agent (LexiAgent, 81,000 lines), crypto that survives a broken RSA or "P=NP" (every signature doubled, a one-time-pad channel), and Qwen4-35B at 135 tok/s on one 7900 XTX, ahead of llama.cpp b13023 & New MedGemma2 support is now available

https://github.com/W61k3r/LexiSuite-Releases/releases/tag/LexiSuiteT27

I'm building a local AI platform from scratch in Rust: its own kernel (LexiKernel), OS (LexiOS), inference engine (LexiEngine) and control panel (LexiPanel), one USB image, no cloud. A new development image went out today, five days after the last post (996260c). 711 changes this time, and the biggest release so far: the code base grew by 394,000 lines to 2.51 million lines of Rust in 528 crates.

LexiAgent: an AI agent of my own, from the first line

55 crates, about 81,000 lines, 989 tests, no third-party crates. It works with the model you run yourself on LexiEngine (this machine, another one on your network, or through the Panel), not with a cloud model.

What it does:

- Carries a task from request to done: plans, keeps a task list, calls tools in order, stops on Ctrl-C together with every command it started. Helpers take sub-tasks inside limits they cannot escape.

- Reads a project: fast bounded search, and source navigation (symbols, definitions, references) without a language server. Project memory files and a digest of the project keep the context across a long session.

- Changes files safely: exact edits, new files and multi-file patches as one transaction, each undoable. It reads the patch formats models already write, the way GNU patch reads them.

- Runs commands in a real terminal with background jobs and a read-only fast lane, every command inside a sandbox.

- Git with fixed argument lists and no shell, qualified against a real repository (amend, forced reset, clean, branch delete). Off unless switched on.

- Web pages and files through my own HTTP client, from the origins you allow, treated as data.

- Model Context Protocol client for outside tool servers, every tool behind the same gate. Servers a project lists are imported for approval, never started unasked.

- Skills, slash commands, specialist definitions, hooks and plug-ins in the formats people already use, plug-ins installed into a private store pinned by digest.

Why I would let it near my own machine:

- One gate decides every call: mode (plan, ask, edit, auto), the person's rules, the person's answers. A project's settings can only narrow what you allow, never widen it. Approvals on the interactive screen are typed by a person, so the model cannot approve itself.

- On Linux every command runs under kernel-enforced confinement: it sees only what the session allows, reaches the network only through a proxy, and dies with the session. macOS has its own confinement.

- Secrets are found before a file is read and removed before the model sees them.

- A shield marks and contains whatever tools and tool servers bring back: text that tries to give orders stays data. A red-team corpus of attacks runs against the assembled session parts.

- Every decision and action goes into an append-only, chained record that can be verified afterwards.

- The Panel has a LexiAgent page: start a supervised session against a model instance you pick, answer its questions, stop it. The agent pairs with the Panel over the suite's own two-signature TLS.

- lexi-agent doctor tells you, check by check, what this build and this machine provide.

Built for the day the math breaks ("P=NP hardening")

Almost all security today rests on RSA and elliptic curves staying hard to break. If quantum computers or an AI-found shortcut toward P vs NP make them easy, everything signed with them opens. I rebuilt the suite so that no single broken assumption opens anything:

- My own Rust implementations of the new standards: ML-KEM (FIPS 203), ML-DSA (FIPS 204), SLH-DSA (FIPS 205), LMS/HSS (SP 800-208), SHA-3 and Shamir secret sharing, every parameter set checked against the official test files and an independent implementation.

- Every signature is doubled: a classical one plus one from another family (lattice, or hash-based that rests only on a hash function), and both must verify. Updates, the trust store, provenance, enrollment, image identity, licenses, evidence, release decisions, fleet actions, the Panel's certificates.

- Key exchange mixes unrelated methods: my own TLS 1.3 with the hybrid group and a pre-shared secret mixed in, one session key from several exchanges that share no math. LexiOS's SSH does the hybrid exchange first.

- LexiKernel's own boot chain now requires a hash-only signature (SLH-DSA-SHA2-256s) beside RSA on every owner-signed boot object. PC firmware itself can only check RSA on the very first loader; that one link is the firmware's.

- Vault keys are wrapped so one broken algorithm opens nothing; key backup is printed shares, 3 of 5.

- And for the owner's approvals, a one-time-pad channel made from a hardware randomness source: the one kind of encryption no computation breaks, P=NP included. The pad store was killed with SIGKILL at every step of reserve-then-use and never moved backwards.

- The release gate refuses any new use of RSA or a curve alone, so it cannot drift back.

Qwen4 on the card

- Qwen4-35B-A3B writes 99.5 tok/s after a short prompt against 92.5 on llama.cpp b13023, and 89.8 against 80.8 after 57,550 tokens of prompt.

- With the draft head built into the model file: 117.7 to 134.9 tok/s. The full model checks every drafted token, so the answer is the same token for token, only faster.

- It reads pictures on the card: on five test pictures the card wrote exactly the words of the processor path.

- Its own template, reasoning levels by the template's own names, required and named tool choices enforced (grammar on the processor, device allow-list on the card), thought kept apart from the answer on every API route.

- Attention cache in F16, Q8_0, Q6_0, Q4_1, Q4_0, rotated 4-bit or IQ4_NL, keys and values in different formats if you like.

- Found while measuring: the previous version fell from about 100 to 46 tok/s after some 30 requests (the engine reshuffled experts when the whole model was already on the card, and one evicted expert sent routing to the processor for good). Fixed: 70 requests in a row now all run at 102 to 104.

MedGemma 2 and Gemma 4

- Straight from the BF16 checkpoint to a quantized file in one pass with my own quantizer, the 26B-A4B mixture-of-experts layout on the card, picture input through the vision tower on the card, tool calls in Gemma 4's own format read as structured calls.

- MedGemma 2 E4B writes faster than llama.cpp up to about 14,000 tokens of prompt: 148.8 / 140.9 / 125.1 against 130.5 / 125.2 / 118.0 tok/s.

Pictures, video, voice and sound in the engine

- Image diffusion from a checkpoint (conditioner, DiT, VAE, scheduler on the chosen device), image editing from reference pictures, adapters merged per request, upscaling, Qwen-Image 2.1 on a Radeon card as a build option.

- Video generation (LTX stage family) into a real container, and video understanding in chat (H.264 decode and frame sampling into the prompt).

- Kokoro text to speech on my own graph library, Moonshine streaming recognition, speech from codebooks, live two-way voice sessions, sound input in chat.

- In the Panel: pictures made by LexiEngine, speech in and out, and a media model library.

Also new

- New model families on the processor: GPT-OSS, Mistral, Phi, and the diffusion text models LLaDA and diffusion Gemma. Experts read from an SSD through a signed manifest.

- My own quantizer as a Panel tool with recipes, a per-tensor table, progress and cancel. NVFP4, MXFP4 and FP8 products on Vulkan, exact NVFP4/MXFP4 import, 4-bit weights with 8-bit inputs on RDNA 3 integer dot products.

- The processor path computes exactly now (no 8-bit rounding of inputs), with fused AVX2 kernels that do it with less work.

- 21 template fixes, tokenizer fixes, Hermes-style tool calls read and written by the engine.

- LexiOS: a change authority with a TPM 2.0 anchor that cannot be rolled back, a control socket the engine reads to place itself on the right cores and memory, authenticated crash evidence.

- LexiKernel: a long list of new hardware support (NVMe recovery, xHCI, AHCI, USB4, TPM2, chipsets, Intel Macs, ARM boot, and detection of many accelerators).

- My own AMD code-object writer on my own RDNA 3 instruction encoder, and a KFD transport with a device-resident executor for my kernel IR.

- The Panel speaks 45 languages, every tab was read on a live engine and corrected, settings are offered per model family, and its gateway serves /v1/responses and /v1/messages with quotas.

- Windows installer with the Panel, the engine, the agent and six helpers, registered as services on an all-users install.

Speed, one Radeon RX 7900 XTX at 291 W, one request at a time, newest builds of the other engines on the same card and files

- Qwen4-35B-A3B: 99.5 tok/s writing, 134.9 with its draft head (llama.cpp b13023: 92.5). After 3,659 / 14,339 / 57,550 tokens: 92.6 / 91.9 / 89.8, with the draft head 120.9 / 120.3 / 117.7 (llama.cpp 90.8 / 89.6 / 80.8).

- Inkling-2-Mini against Strata 0.2.28, 8-bit cache on both (Strata's 4-bit cache is refused on this card): 4,096-token prompt read at 2,589 tok/s (2,302), then 75.6 tok/s writing (64.9). 261,632-token prompt read at 1,228 tok/s (828), then 57.9 tok/s writing (12.7).

- Qwen3.8 Flash-Next (94 GB) on the same 24 GB card: first token after 16k / 64k / 256k prompts in 36.3 / 136.4 / 572.1 s.

Things I am not hiding

- llama.cpp reads long Qwen4 prompts 1.5 to 3 times as fast (2,427 / 2,566 / 1,808 against 845 / 1,066 / 1,217 tok/s).

- On MedGemma 2 26B-A4B llama.cpp is clearly ahead (136.3 against 94.3 tok/s writing, 8 to 13 times faster reading prompts): my engine still runs that model's experts one token at a time while reading a prompt. IQ4_XS expert kernels for it are already in progress.

- At 56,123 tokens of prompt llama.cpp writes faster on MedGemma 2 E4B (97.5 against 86.4).

What it is not, yet

- No physical machine has booted this version yet; its nine Secure Boot checks and the install to a disk ran in a virtual machine.

- The Windows installer is built and tested on Linux and has not run on a Windows PC.

- LexiAgent's desktop control (screen, input, accessibility tree) is in the source with its tests but not yet in the program.

Tested: 22,536 tests passed in the full run (LexiOS with LexiKernel 8,822, the engine 7,757 including its device tests on the 7900 XTX, the Panel 5,957), nine boot checks and an 18-step install to a disk.

Links: lexipanel.com/download (about 1 GB image). Release notes, the full change list and the new LexiAgent page are in the wiki of the LexiSuite-Releases repository on GitHub.

1 Upvotes

0 comments sorted by