the sovereign ai stack · open source · pure rust

Run the
entire stack
on your own
metal.

interactive.paiml.com is the home of Pragmatic AI Labs' WASM-powered books and demos — and a window into the four open-source projects we use to build production AI without dependencies, cloud APIs, or vendor lock-in.

aprender trains and serves models. forjar provisions the hardware. xpile brings legacy code along for the ride. pmat proves it all works.

70 crates
aprender workspace
25,391
tests, all passing
405
provable contracts
0 deps
cloud / vendor / runtime
§ 01

The stack, end to end.

FIG.01 · dataflow · rev 2026.05
diagram · sovereign-ai-stack read: left → right · ↓ verify
FIG.01 — SOVEREIGN AI STACK / DATAFLOW REV.2026.05 / PAIML 01 · SOURCES python .py c .c .h ruchy .ruchy datasets hf:// 02 · TRANSPILE xpile family → rust 3 tools depyler py → rs decy c → rs ruchy ruchy→rs 03 · LEARN / SERVE aprender · pure rust apr 70 crates train · finetune · lora inference · serve quantize · convert simd · gpu (cuda ptx) rag · agents · graph FORMATS .apr · .gguf · .st 405 provable contracts 04 · PROVISION forjar · iac deploy ssh / blake3 bare-metal first content-addressed 17 deps · 1 binary 05 · RUNTIME bare metal gpu browser wasm api :8080 cli apr pmat · mcp agent toolkit verify · gate · context cross-cutting complexity · TDG · SATD · coverage · mutation · WASM proofs · context.md for LLMs [ rust ] [ model ] [ artifact ] 06 · VERIFY (CROSS-CUTTING)
core (aprender) stack module source / runtime ▬▬▬ dataflow (live) ┄┄┄ verification (pmat)
§ 02

Four projects. One stack.

open source · MIT · pure rust
PRJ/01 ML / SERVE

aprender

Next-generation ML in pure Rust. One install, one binary, full stack.

57 commands across inference, training, model ops, quantization, profiling, registry, and GPU — backed by 405 equation-based contracts.

  • apr run · chat · serve · run GGUF, SafeTensors, .apr models locally
  • apr finetune · train · distill · LoRA / QLoRA fine-tuning
  • SIMD (AVX2) + CUDA PTX kernels · 225+ tok/s on 7B / RTX 4090
noah@lambda ~/work/ml
$
PRJ/02 INFRA / IaC

forjar

Rust-native IaC. Bare-metal first. BLAKE3 content-addressed state.

One binary, 17 deps, zero cloud APIs. Drift detection via local hash compare. Apply in milliseconds, not minutes.

  • forjar plan · apply · drift · YAML → DAG → ssh execution
  • Content-addressed store (Nix-inspired) · 4-level purity model
  • 11 resource types incl. model, gpu, pepita sandbox
noah@admin ~/infra/home-lab
$
PRJ/03 TRANSPILE

xpile / decy / depyler / ruchy

Bring any codebase to Rust. Python, C, and a new language built for it.

Three transpilers and a programming language, sharing one philosophy: ownership-aware codegen, formal verification, and energy-efficient output.

  • depyler · Python → Rust · semantic verification, MCP integration
  • decy · C → Rust · ownership inference, 0 unsafe blocks by default
  • ruchy · self-hosting language · transpiles to Rust, beats C at runtime
noah@dev ~/code/migrate
$
PRJ/04 VERIFY / MCP

pmat

MCP agent toolkit. Make code-with-agents deterministic.

Six orthogonal quality metrics (TDG), mutation testing, WASM formal verification, and zero-config context generation for any codebase.

  • pmat context · LLM-optimized repo context for Claude Code, Cline
  • pmat analyze tdg · A+ → F grade across complexity, SATD, coverage…
  • pmat analyze wasm --verify · formal proofs of memory safety
noah@ci ~/repo
$
§ 03

Learn by running it.

no setup · zero install · 100% browser

Interactive demos

07 · wasm

Books

04 · interactive