explaingit

autumnai/leaf

5,543RustAudience · researcherComplexity · 5/5LicenseSetup · hard

TLDR

An archived early-stage machine learning framework written in Rust that can train and run neural networks on CPUs, GPUs, and FPGAs, designed as a fast alternative to TensorFlow and Caffe.

Mindmap

mindmap
  root((leaf))
    What it does
      Trains neural networks
      Runs on CPU GPU FPGA
      Hardware abstraction
    Tech Stack
      Rust
      CUDA
      OpenCL
      Collenchyma library
    Use Cases
      Neural network research
      Embedded ML workloads
      Portable inference
    Ecosystem
      Cuticula preprocessor
      Hacker ML book
      Apache and MIT license
    Status
      Archived
      Early stage
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build and train neural network models in Rust without depending on Python-based frameworks like TensorFlow.

USE CASE 2

Run machine learning inference on embedded hardware or FPGAs using OpenCL without a full CUDA setup.

USE CASE 3

Study the architecture of an early Rust ML framework as a reference for building portable compute abstractions.

Tech stack

RustCUDAOpenCL

Getting it running

Difficulty · hard Time to first run · 1day+

Requires CUDA for the bundled examples, project is archived and may not compile with current Rust toolchain versions.

Dual-licensed under Apache 2.0 and MIT, use, modify, and distribute freely for any purpose including commercial use.

In plain English

Leaf is an early-stage machine learning framework written in Rust, intended for building applications that train and run neural networks. It was created by the team behind the Autumn platform as an alternative to tools like TensorFlow and Caffe, with a focus on portability and speed. The README notes it was a few months old at the time of writing and describes itself as one of the faster available options for this type of work. The framework is designed to run on CPUs, GPUs, and FPGAs, and supports both CUDA (used with NVIDIA graphics cards) and OpenCL (a broader standard that works across more hardware). This makes it usable on a range of machines, including those without a traditional operating system. The actual hardware abstraction is handled by a separate companion library called Collenchyma. You use Leaf by adding it to a Rust project as a dependency. Feature flags in the configuration file let you select which hardware backends to include, so you can build a version that uses only the CPU if CUDA is not available. The project includes example implementations of well-known neural network architectures that can be run from the command line, though the README notes CUDA support is currently required for those examples. The project is part of a broader ecosystem that includes a preprocessing library called Cuticula for preparing data before training. Documentation is available through a book titled "Leaf - Machine Learning for Hackers." The code is dual-licensed under Apache 2.0 and MIT. The repository appears to be archived or no longer actively developed based on the early-stage notices in the README.

Copy-paste prompts

Prompt 1
I want to train a simple neural network using the Leaf framework in Rust. Show me how to add it as a dependency and run one of the included example architectures.
Prompt 2
How do I configure Leaf to use OpenCL instead of CUDA so I can run it on non-NVIDIA hardware?
Prompt 3
Explain how Leaf uses the Collenchyma library to abstract away hardware differences between CPU, GPU, and FPGA backends.
Prompt 4
What does the Cuticula preprocessing library do in the Leaf ecosystem and how do I use it to prepare image data before training?
Prompt 5
Leaf is archived, what modern Rust machine learning libraries have replaced it and how do their APIs compare?
Open on GitHub → Explain another repo

← autumnai on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.