runs real models on CPU + GPU + the Neural Engine — one Rust stack

One pure-Rust AI stack.
Every fabric.

Ferric runs the same code on a datacenter GPU, a laptop, an edge robot, and a browser tab — a complete transformer, an ONNX importer, and a safetensors loader, with no Python or C++ in the hot path.

What it is

A single Rust ecosystem for AI compute — cloud, local, and browser.

Browser AI today is JavaScript and C++-WASM; Rust's AI story is fragmented and weak in the browser. Ferric is the missing piece: build directly on the portable GPU layer (wgpu), own the kernels, the model runtime, weight loading, and browser packaging — one coherent stack where a model defined once runs, and computes the same, everywhere. Every result below is validated against an independent reference (CPU, numpy, onnxruntime, or HF transformers) and builds fully offline from vendored source.

Proven

Not a plan — it runs real models.

Every number below is checked against an independent reference — a CPU implementation, numpy, onnxruntime, or Hugging Face transformers.

Runs real models

2

SmolLM2-135M matches numpy 1.4e-6; Liquid AI LFM2-350M (novel conv-hybrid) matches transformers 4.7e-6.

Generates real text

Exact GPT-2 tokenizer (HF token-for-token) + O(S) KV-cache decode — end to end.

Runs on the NPU

ANE

WebNN(npu) → CoreML → Apple Neural Engine, matching CPU to fp16. Plus every GPU + all CPU cores.

Cross-fabric core

7.15e-7

One matmul kernel, native Metal vs browser WebGPU — bit-identical.

It trains

100%

Reverse-mode autograd — an MLP and a transformer (through attention) trained on the GPU.

Down to ternary

1.58-bit

f16/bf16, int8/int4 weight-only, and ternary (BitNet/PrismML) — 1/16 the memory.

Five architectures

5

Ternary LLMs, Liquid LFM2, EBMs, JEPA/V-JEPA2, Llama — plus ONNX + GGUF ingest.

Fusion compiler

codegen

Elementwise DAGs → one generated WGSL kernel (SSA+CSE), and activations fused into matmul.

The stack

Eight crates, published on crates.io.

ferric-coreThe wgpu Context + the cross-fabric transformer kernel set.crates.io ↗
ferric-tensorThe general N-D tensor runtime — strided views, broadcasting, reductions, batched matmul — with autograd for training.crates.io ↗
ferric-onnxA pure-Rust ONNX importer that runs graphs on Ferric tensor ops.crates.io ↗
ferric-loadA safetensors reader — fp16/bf16 dequant — how real checkpoints enter.crates.io ↗
ferric-llamaMaps a Llama/SmolLM safetensors checkpoint onto the kernels and runs it.crates.io ↗
ferric-ggufGGUF reader — F32/F16/Q8_0/Q4_0/Q4_K + TQ2_0 ternary: the llama.cpp/HF corpus.crates.io ↗
ferric-tokenizerByte-level BPE with the exact GPT-2 pre-tokenizer — HF token-for-token.crates.io ↗
ferric-webThe same core compiled to WASM, running on browser WebGPU.crates.io ↗

Playground

A transformer, running in this tab.

This runs a full Llama-style forward pass on your GPU via WebGPU, compiled from the same Rust as the native crates — and checks its own output against an in-page CPU reference.

statusinitializing… backend adapter

Weights here are fixed pseudo-random — an untrained demo net — so generation is deterministic, not meaningful language. The point is that a real transformer's compute runs correctly in a browser tab.