---
title: "Train an AI model using Rust!"
source_url: https://youtube.com/shorts/28hnC42fVBc
captured_at: 2026-04-24
author: "Arnitly"
contributor: "ชิดชนก"
platform: youtube
---
# Train an AI model using Rust!

youtube video by **Arnitly**, 1m05s, uploaded 2026-04-20. URL: https://youtube.com/shorts/28hnC42fVBc

## Shared in LINE Note+
- 2026-04-24 10:57 by ชิดชนก

## Description
Aadi Kulshrestha and Reese Chong, built the ML framework before training the model.


The model itself is a 6-layer decoder-only transformer with 384-dimensional embeddings, 6 attention heads, and a GELU feed-forward block. The BPE tokenizer was trained from scratch on roughly 33 million tokens pulled from YouTube video transcripts.


The framework (mni-ml) runs on three backends: native Rust for CPU, cudarc with custom .cu kernels for CUDA, and WebGPU shaders for the browser. The entire dataset is uploaded to GPU memory once at the start of training. Batches are sampled directly via a CUDA kernel — zero CPU-GPU transfer during the run.

One command to install: 'npm install @mni-ml/ framework'.

Prebuilt binaries for every platform.
Browser demo at mni-ml.github.io/demos/transformer shows next-token probability distributions in real time, no GPU required.
Built using Modal A100 credits.


Blog at mni-ml.github.io covers gradient descent, CUDA parallelism, and the transformer architecture end to end - written for someone starting from zero.
