Skip to content

Brashkie/Intellivium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Intellivium

A high-performance Deep Learning framework with a Rust core, native to the Node.js ecosystem.

Forge your own neural networks β€” no Python, no C/C++ toolchain, no heavyweight runtime.


npm core runtime bindings license

English Β· EspaΓ±ol


Overview

Intellivium (formerly NeuroForge) is a deep learning framework whose numerical core is written entirely in Rust and exposed to JavaScript/TypeScript through N-API. The goal is the power of a native ML engine with the ergonomics of the npm ecosystem: npm install, import, and train β€” with precompiled binaries per platform and no C/C++ source, no Python, and no embedded VM.

It draws inspiration from PyTorch, TensorFlow and Flux.jl, but makes a deliberate engineering choice: one native language (Rust) for the engine, TypeScript for the public API, and Zig reserved strictly for future hot kernels.

Why not Julia / C++? Julia can be embedded, but it drags its full runtime (VM + LLVM + stdlib, hundreds of MB) plus JIT warm-up β€” impractical to ship over npm. C++ is unnecessary: Rust delivers the same low-level control and SIMD without the toolchain pain. See Architecture.


✨ Why Intellivium

πŸ¦€ Rust core Memory-safe, fast, with a tape-based reverse-mode autograd engine built from scratch.
πŸ“¦ Node-native Ships as prebuilt N-API binaries: npm install and go β€” no compiler required by users.
🧩 Modular Clean separation: engine (neuroforge-core) ↔ bindings (neuroforge-napi) ↔ API (ts/).
πŸͺΆ Zero heavyweight deps No Python interpreter, no Julia runtime, no libtorch. The whole engine is one native addon.
πŸ”“ TypeScript-first API Fully typed, ergonomic surface that reads like modern JS.
βš™οΈ Zig-ready Architecture leaves a clean hook for Zig SIMD kernels when profiling demands it.

🚦 Project Status

v0.4.0 Β· on npm. The engine is tested and trains real models. It's still pre-1.0, so the API may evolve β€” and the grand vision further down is a roadmap, not a current claim.

Available today βœ…

  • Reverse-mode automatic differentiation (Wengert tape, no Rc<RefCell>).
  • Ops: matmul, broadcasted bias add, relu, sigmoid, tanh, MSE.
  • Dense layers with He init, sequential Model, SGD & Adam optimizers, MSE / BCE / categorical cross-entropy losses, softmax for multi-class output, mini-batch training, gradient clipping, LR decay, and model save/load.
  • N-API bindings + typed TypeScript API.
  • Validated end-to-end on the XOR problem (non-linear): loss 0.247 β†’ 0.0002.

πŸš€ Quickstart

npm install intellivium
import { tensor, dense, Model } from "intellivium";

// XOR β€” the classic non-linear sanity check
const X = tensor([[0, 0], [0, 1], [1, 0], [1, 1]]);
const y = tensor([[0],    [1],    [1],    [0]]);

const model = new Model([
  dense(2, 8, "tanh"),
  dense(8, 1, "sigmoid"),
]);

const history = await model.train(X, y, {
  epochs: 1500,
  lr: 0.05,
  optimizer: "adam",
  loss: "bce",
});
console.log("final loss:", history.at(-1));

const pred = model.predict(X);
console.log(pred.toArray()); // β‰ˆ [[0], [1], [1], [0]]

Architecture

The autograd graph lives entirely in Rust. Only flat tensors (Float64Array + shape) and high-level operations cross the FFI boundary β€” the graph is never marshalled per-op.

flowchart TD
    subgraph JS["TypeScript / JavaScript"]
        A["Public API<br/>tensor Β· dense Β· Model"]
    end
    subgraph NAPI["neuroforge-napi (cdylib)"]
        B["N-API bridge<br/>flat tensors in / out"]
    end
    subgraph CORE["neuroforge-core (pure Rust)"]
        C["Autograd tape<br/>matmul Β· add Β· relu Β· sigmoid Β· tanh Β· mse"]
        D["nn: Dense Β· Model Β· SGD/Adam"]
        E["(future) Zig SIMD kernels"]
    end
    A -->|Float64Array + shape| B
    B --> C
    D --> C
    C -.->|hot path| E
Loading

Layout

Intellivium/
β”œβ”€β”€ crates/
β”‚   β”œβ”€β”€ neuroforge-core/    # pure-Rust engine: autograd + nn  ← works today
β”‚   β”‚   β”œβ”€β”€ src/tape.rs     #   reverse-mode AD (the heart)
β”‚   β”‚   β”œβ”€β”€ src/nn.rs       #   Dense, Model, train/predict
β”‚   β”‚   └── examples/xor.rs #   `cargo run` proof
β”‚   └── neuroforge-napi/    # N-API bindings β†’ .node
β”œβ”€β”€ src/                    # public TypeScript API
└── examples/               # xor.mjs (Node)

πŸ”§ Build from source

Requirements: Rust (rustup), Node.js 18+, and @napi-rs/cli (already a dev dependency).

# 1. test the Rust engine alone (no Node needed)
cargo run --release -p neuroforge-core --example xor

# 2. build everything (native .node + TypeScript)
npm install
npm run build

# 3. run the Node example
npm test

πŸ—ΊοΈ Roadmap & Vision

The engine is the foundation. Everything below is the long-term plan, phase by phase β€” honest about what already ships versus what's still ahead.

Legend: βœ… Complete Β· 🟑 Partial Β· πŸ”΄ Planned

Phase 1 β€” Deep Learning Core Β· 🟑

A stable, reliable engine.

Tensors

  • Data types (dtype system β€” currently f32 only)
  • Broadcasting
  • Basic operations
  • MatMul
  • Shape checking
  • Tensor views

Autograd

  • Reverse mode
  • Wengert tape
  • Gradients
  • Computation graph
  • Automatic graph release

Neural networks

  • Dense
  • Sequential
  • He initialization
  • ReLU
  • Sigmoid
  • Tanh
  • Softmax

Loss functions

  • MSE
  • BCE
  • Cross-Entropy (categorical)

Optimizers

  • SGD
  • Adam

API

  • TypeScript
  • N-API
  • npm

Phase 2 β€” Training Β· 🟑

Make training a model comfortable.

Dataset

  • Dataset
  • TensorDataset
  • Custom Dataset

DataLoader

  • Mini-batch
  • Shuffle
  • Batch iterator

Training loop

  • Validation
  • Early stopping
  • Checkpoints
  • Gradient clipping
  • Learning-rate scheduler

Serialization

  • save()
  • load()
  • exportWeights()
  • importWeights()

Phase 3 β€” Neural Library Β· πŸ”΄

More building blocks.

Layers

  • Dropout
  • BatchNorm
  • LayerNorm
  • Embedding
  • Flatten
  • Reshape

CNN

  • Conv1D
  • Conv2D
  • Conv3D

Pooling

  • MaxPool
  • AvgPool
  • Global pool

Recurrent

  • RNN
  • LSTM
  • GRU

Phase 4 β€” Engine Optimization Β· πŸ”΄

Before adding modern AI.

SIMD

  • Zig SIMD
  • Optimized MatMul
  • Optimized Conv

Memory

  • Arena allocator
  • Buffer pool
  • Zero copy
  • Tensor pool

Parallelism

  • Rayon
  • Multi-thread

Benchmark

  • Benchmarks
  • Profiler

Phase 5 β€” Modern Architectures Β· πŸ”΄

Where Transformers finally appear.

Attention

  • Self-attention
  • Multi-head attention
  • Positional encoding
  • Rotary embeddings

Transformers

  • Encoder
  • Decoder
  • GPT
  • BERT

Vision

  • Vision Transformer
  • ConvNeXt

Phase 6 β€” Generative Models Β· πŸ”΄

  • Autoencoder
  • VAE
  • GAN
  • Diffusion

Phase 7 β€” Reinforcement Learning Β· πŸ”΄

  • Replay buffer
  • DQN
  • PPO
  • SAC
  • Actor-Critic

Phase 8 β€” ForgeLab Β· πŸ”΄

Scientific computing.

Linear algebra

  • LU
  • QR
  • SVD
  • Eigen

Numerical

  • Optimization
  • ODE
  • Root finding

Statistics

  • Monte Carlo
  • Distributions

Phase 9 β€” Hyper-Data Engine (HDE) Β· πŸ”΄

Data

  • Lazy loading
  • Streaming
  • Hot cache
  • Dataset cache

Formats

  • Parquet
  • Arrow
  • CSV
  • JSON

Engine

  • Memory mapping
  • Prefetch
  • Columnar storage

Phase 10 β€” GPU Β· πŸ”΄

GPU

  • CUDA
  • ROCm
  • Metal
  • Vulkan

Mixed precision

  • FP16
  • BF16

Quantization

  • INT8
  • INT4

Phase 11 β€” Production Β· πŸ”΄

  • Inference engine
  • Batch inference
  • ONNX
  • Serving
  • HTTP
  • gRPC

Phase 12 β€” Ecosystem Β· πŸ”΄

Tooling, not AI.

Visualization

  • Dashboard
  • Tensor inspector
  • Training graphs

Extensions

  • Plugins
  • Custom layers
  • Custom optimizers

Model Hub

  • Models
  • Datasets

Phase 13 β€” Research Β· πŸ”΄

The most ambitious vision.

Distributed

  • Multi-GPU
  • Multi-node

Compiler

  • Graph optimizer
  • Kernel fusion

AutoML

  • NAS
  • Hyperparameter search

🀝 Contributing

Issues, ideas and pull requests are welcome. For substantial changes, open an issue first to discuss direction. Please keep the engine (neuroforge-core) free of binding/runtime concerns β€” that separation is intentional.


⚠️ License

Apache License 2.0. You may use, modify, and distribute this software under the terms of the Apache 2.0 license, including a patent grant. Copyright Β© 2026 Brashkie.


⭐ If Intellivium is useful to you, consider starring the repo.

Built by Brashkie

About

A high-performance Deep Learning framework with a Rust core, native to the Node.js ecosystem.

Resources

License

Contributing

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors