Shumai (Meta)Shumai (Meta)

Shumai: Fast Differentiable Tensor Library for JS/TS

Shumai is an open-source, GPU-accelerated tensor library that brings differentiable computing and gradient-based training to TypeScript and JavaScript developers.

Overview

Shumai is an open-source tensor library built for developers who want the power of machine learning tooling without leaving the JavaScript ecosystem. Powered by Bun and the Flashlight C++ engine, it delivers fast, differentiable tensor operations that support gradient-based optimization, making it possible to train models and run advanced inference logic directly in TypeScript or JavaScript. Network connectivity is baked in, so tensors and data can move seamlessly across distributed setups. Designed by Meta for software engineers, researchers, and data scientists, Shumai focuses on three goals: simplifying dataset creation, speeding up training for smaller models, and making fine-grained training and inference logic more expressive. Whether you're prototyping a new model architecture or building an application that needs on-the-fly tensor math, Shumai aims to keep the developer experience enjoyable rather than bogged down in boilerplate. Under the hood, Shumai leverages CUDA for GPU acceleration on Linux and falls back to CPU computation on macOS, giving it flexibility across common development environments. Because it's built on Bun, a fast all-in-one JavaScript runtime, and Flashlight, a performant ML backend, Shumai bridges the gap between native-speed tensor computation and the accessibility of the JS/TS language ecosystem.

Capabilities & Features

  • Tensor library
  • JavaScript
  • TypeScript
  • Differentiable tensors
  • Machine learning
  • Deep learning
  • GPU acceleration
  • CUDA
  • Bun
  • Flashlight

Core Features

  • Fast tensor operations optimized for performance
  • Differentiable tensors enabling gradient-based optimization
  • Built-in network connectivity for distributed workflows
  • Deep integration with Bun runtime and Flashlight ML engine
  • GPU support via CUDA on Linux, CPU support on macOS

Use Cases

  • Creating and manipulating datasets for ML workflows
  • Training small machine learning models efficiently
  • Implementing advanced, fine-grained training and inference logic
  • Building tensor-powered applications entirely in JavaScript/TypeScript
  • Prototyping ML research ideas within a JS-native environment

Best For

  • Software engineers
  • Researchers
  • Data scientists
  • Machine learning engineers

Pros

  • Brings differentiable tensor computation natively to JavaScript/TypeScript
  • Fast performance thanks to Bun and the Flashlight C++ backend
  • GPU acceleration available on Linux via CUDA
  • Open-source and free to use
  • Simplifies dataset creation and model training workflows

Cons

  • No official Windows support (requires Docker + WSL2 workaround)
  • macOS limited to CPU computation, no native GPU acceleration
  • No OpenCL support yet, limiting GPU options beyond CUDA
  • Best suited for smaller models rather than large-scale training

How to Use

1. Install Bun, the JavaScript runtime Shumai depends on. 2. Install ArrayFire, a required backend library for tensor operations. 3. Run 'bun install @shumai/shumai' to add the Shumai package to your project. 4. Use Shumai's array utilities to create tensors, converting to and from native JavaScript arrays as needed. 5. Leverage differentiable tensors and gradients to build and train your models or inference pipelines.

Frequently Asked Questions

Open in AI Studio

Ask our AI to evaluate if Shumai (Meta) fits your specific workflow.

Pricing

Shumai is a free, open-source library with no licensing costs or paid tiers.

Pricing data is provided as a summary. Visit the vendor website for full tier details.