Skip to content
Raul Montoya Cardenas edited this page Jul 29, 2026 · 3 revisions

cortex-tensor

Pure-Rust tensor, transformer, and Mixture-of-Experts building blocks.

Version: 0.1.0 | Edition: 2024 | License: MIT OR Apache-2.0

cortex-tensor is a minimal, framework-free numerical kernel for transformer LMs and MoE routing. Extracted from corinth-canal and stripped of GPU/CUDA/Julia/SNN orchestration so it can stand alone as reusable open-source math.

Design Goals

  • Zero GPU coupling — no cust, no pinned-host registration, no CUDA features
  • Zero ML frameworks — no candle, tch, or ort; tensors are row-major Vec<f32>
  • Small depsserde, serde_json, thiserror, rand, rayon, memmap2, half (+ optional sentry)
  • Inference-ready MoE — GGUF bridge with family-aware adapters (OLMoE, Qwen3-MoE, Gemma-4, DeepSeek-2, Llama-MoE)

Start Here

Page Description
Getting Started Install, matmul, transformer, router
Project Structure Layout and modules
Architecture Layers, ownership, non-goals
Tensor Tensor type and element ops
Tensor Ops matmul, norms, mask, embedding
Transformer Attention, block, TransformerLM
MoE Router OlmoeRouter, routing modes
GGUF Bridge Checkpoint, dequant, quant types
Model Families Adapters and synapse sources
Parser Boundary engram-parser / safetensors plan
Errors CortexError / HybridError
Sentry Optional monitoring feature
CI and Quality GHA, Azure, Codecov, Qodana, Snyk
Testing Unit tests and env hooks
Ecosystem Sibling crates
Glossary Terms

Quick Commands

cargo build
cargo test
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings

License

Dual-licensed under MIT or Apache-2.0 at your option.


Last updated: July 29, 2026 Updated by: Grok Build: Grok 4.5 Package tip reference: 37c5a21 (main, through PR #21)

Clone this wiki locally