Skip to main content
ToolPotion
AI Advisor
Submit a Tool (Free)

Shumai

Shumai is a fast, differentiable tensor library for JavaScript and TypeScript, built with Bun and Flashlight. It enables software engineers and researchers to create datasets, train small models, and implement advanced training logic efficiently within the JavaScript ecosystem. It leverages native typed arrays and a JIT compiler for performance.

View Repository
Share
View Repository
Share

Shumai is a differentiable tensor library designed for JavaScript and TypeScript, leveraging the speed of Bun and the power of Flashlight. It aims to make data manipulation, model training, and advanced inference logic more accessible and efficient for developers within the JavaScript ecosystem. By utilizing native typed arrays and Bun's Just-In-Time (JIT) compiler, Shumai offers a performant solution for tasks ranging from dataset creation to training small machine learning models.

Read More

The library provides core tensor operations, automatic differentiation for gradient computation, and seamless conversion to and from JavaScript native arrays. This allows developers to work with data directly in JavaScript, prepare it for GPU-compatible arrays, and then train models without leaving the environment. Shumai's architecture is built to minimize overhead, allowing JavaScript to get out of the way during training and inference, especially for smaller models.

Key capabilities include standard array utilities, tensor creation, mathematical operations, and gradient tracking. Users can enable gradient computation for tensors, perform operations, and then access the computed gradients. The library also offers features for memory management tuning, allowing users to adjust garbage collection parameters to optimize performance based on hardware capabilities. Furthermore, Shumai includes a statistics gathering system that can log operation performance to the console or over HTTP, with options for scoped profiling and stack trace collection.

Shumai is particularly beneficial for software engineers and researchers who are already working within the JavaScript ecosystem and want to incorporate machine learning capabilities without a steep learning curve associated with other languages or frameworks. Its performance benchmarks show significant advantages over libraries like TensorFlow.js in various operations, especially on Apple M1 Pro and Nvidia GPUs. The project is experimental, and contributions are welcomed to improve its functionality and stability.

  • CategoryMachine Learning Platforms
  • Pricing ModelOpen source
  • DeploymentCloud
  • PlatformsWeb

  • Fast, differentiable tensor library for JavaScript and TypeScript

  • Built with Bun and Flashlight for high performance

  • Supports automatic differentiation for gradient computation

  • Seamless conversion between tensors and JavaScript native arrays

  • Optimized for training small models and advanced inference logic

  • Leverages native typed arrays and JIT compilation

  • Memory usage tuning for performance optimization

  • Built-in statistics gathering for operation profiling

  • Scoped statistics collection for isolated profiling

  • Experimental software with active development

  • Supports GPU computation via ArrayFire backends (CUDA on Linux, CPU on macOS)

  • Extensible statistics logging with Console and HTTP options

  1. Install Bun and ArrayFire: Follow platform-specific instructions for macOS and Linux.

  2. Install Shumai: Run `bun install @shumai/shumai`.

  3. Import Shumai: Use `import * as sm from '@shumai/shumai'` in your TypeScript/JavaScript code.

  4. Create Tensors: Utilize functions like `sm.randn()` or `sm.tensor()` to create tensors.

  5. Perform Operations: Apply mathematical operations such as `matmul()`, `mul()`, and `sum()`.

  6. Enable Gradients: Set `tensor.requires_grad = true` for tensors that need gradient tracking.

  7. Compute Gradients: Call `.backward()` on the loss tensor to populate gradients.

  8. Tune Memory: Adjust memory options using `util.memoryOptions()` for performance.

  • Dataset Creation
  • Model Training
  • Inference Logic
  • Data Preprocessing
  • Research Prototyping
  • Application Development

Popular AI Tools Like Shumai

TensorFlow

AI GitHub Repos

TensorFlow is an open-source machine learning framework designed for everyone. It provides a comprehensive ecosystem for building and deploying machine learning models, making it…

Machine Learning Platforms
View Tool

AI GitHub Repos

Open-source machine learning framework designed for everyone. It provides a comprehensive ecosystem for building and deploying machine learning models, making it…TensorFlow is an open-source machine learning framework designed for everyone. It provides a comprehensive ecosystem for building and deploying machine learning models, making it…

FeaturedMachine Learning Platforms
See the Top 250 AI GitHub Repos

TensorFlow

AI Frameworks

TensorFlow is an end-to-end open source machine learning platform designed for everyone. It provides a flexible ecosystem of tools, libraries, and community resources to create…

Machine Learning Platforms
View Tool

AI Frameworks

End-to-end open source machine learning platform designed for everyone. It provides a flexible ecosystem of tools, libraries, and community resources to create…TensorFlow is an end-to-end open source machine learning platform designed for everyone. It provides a flexible ecosystem of tools, libraries, and community resources to create…

FeaturedMachine Learning Platforms
See the Top 50 AI Frameworks

Keras

AI GitHub Repos

Keras is an open-source deep learning library designed for humans. It simplifies the process of building neural networks and allows developers to contribute to its development on…

Machine Learning Platforms
View Tool

AI GitHub Repos

Open-source deep learning library designed for humans. It simplifies the process of building neural networks and allows developers to contribute to its development on…Keras is an open-source deep learning library designed for humans. It simplifies the process of building neural networks and allows developers to contribute to its development on…

FeaturedMachine Learning Platforms
See the Top 250 AI GitHub Repos

nanoGPT

AI GitHub Repos

nanoGPT is a minimalist, high-performance GitHub repository for training and fine-tuning medium-sized GPT models. It offers a simple, readable codebase for researchers and…

AI Models & LLMs
View Tool

AI GitHub Repos

Minimalist, high-performance GitHub repository for training and fine-tuning medium-sized GPT models. It offers a simple, readable codebase for researchers and…nanoGPT is a minimalist, high-performance GitHub repository for training and fine-tuning medium-sized GPT models. It offers a simple, readable codebase for researchers and…

FeaturedAI Models & LLMs
See the Top 250 AI GitHub Repos

🤗 Transformers is a model-definition framework designed for state-of-the-art machine learning models across text, vision, audio, and multimodal domains, facilitating both…

Machine Learning Platforms
View Tool

🤗 Transformers is a model-definition framework designed for state-of-the-art machine learning models across text, vision, audio, and multimodal domains, facilitating both…

FeaturedMachine Learning Platforms
See the Top 250 AI GitHub Repos

PyTorch

AI GitHub Repos

PyTorch is an open-source machine learning library that provides tools for building dynamic neural networks in Python, leveraging strong GPU acceleration for efficient computation.

Machine Learning & Data Science
View Tool

AI GitHub Repos

Open-source machine learning library that provides tools for building dynamic neural networks in Python, leveraging strong GPU acceleration for efficient computation.PyTorch is an open-source machine learning library that provides tools for building dynamic neural networks in Python, leveraging strong GPU acceleration for efficient computation.

FeaturedMachine Learning & Data Science
See the Top 250 AI GitHub Repos

LocalAI

AI GitHub Repos

LocalAI is an open-source AI engine that allows users to run various models, including LLMs, vision, voice, image, and video, on any hardware without requiring a GPU. This…

Machine Learning Platforms

Ranked #44 in AI GitHub Repos

View Tool

AI GitHub Repos

Open-source AI engine that allows users to run various models, including LLMs, vision, voice, image, and video, on any hardware without requiring a GPU. This…LocalAI is an open-source AI engine that allows users to run various models, including LLMs, vision, voice, image, and video, on any hardware without requiring a GPU. This…

FeaturedMachine Learning Platforms
Ranked #44 in AI GitHub Repos

DJL is an engine-agnostic deep learning framework for Java. It simplifies the process of building, training, and deploying machine learning models using Java. DJL supports various…

Machine Learning Platforms

Ranked #41 in AI Frameworks

View Tool

DJL is an engine-agnostic deep learning framework for Java. It simplifies the process of building, training, and deploying machine learning models using Java. DJL supports various…

Machine Learning Platforms
Ranked #41 in AI Frameworks
1 of 8