Skip to content

Instantly share code, notes, and snippets.

View Mo0nbase's full-sized avatar
🧿
brainstorming...

Julian Carrier Mo0nbase

🧿
brainstorming...
View GitHub Profile
@Mo0nbase
Mo0nbase / micromamba.py
Created February 22, 2026 23:45
micromamba
"""
The most atomic way to train and inference a Mamba SSM in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
Inspired by @karpathy's microgpt and Gu & Dao's Mamba (arXiv:2312.00752).
"""
import os # os.path.exists
import math # math.log, math.exp
import random # random.seed, random.choices, random.gauss, random.shuffle