# alxndrTL/mamba.py

A simple and efficient Mamba implementation in pure PyTorch and MLX.

Repository: https://github.com/alxndrTL/mamba.py
Canonical: https://ross.abutalabs.com/products/mambapy
Language: Python
License: MIT
License Family: permissive
Last push: 2026-05-03T07:15:11+00:00

## Health v2 (maintenance only)
Score: 53/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 80, release rhythm 8, longevity 69
- inputs: {"age_days": 968, "days_push": 122, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1478, forks 130 (observed 2026-08-28T04:04:50.485055+00:00)

## What it is
A simple, readable pure-PyTorch (plus MLX) implementation of the Mamba state-space model architecture with a parallel scan for efficient training. It also includes Jamba, Vision Mamba, and muP variants, and has been integrated into Hugging Face Transformers.

## Use cases
- implement mamba in pytorch
- train a mamba model from scratch
- run mamba inference on a mac with mlx
- understand how the mamba selective scan works
- try the jamba architecture mixing mamba and attention
- transfer hyperparameters from small to large models with muP

## When to choose
- you want readable, hackable Mamba code for learning or research
- you train on PyTorch without the official CUDA kernels or on Apple Silicon with MLX
- you need Jamba or Vision Mamba variants in a simple codebase

## When to avoid
- you need maximum training throughput on NVIDIA GPUs - the official CUDA implementation is faster
- you want a production-hardened, feature-complete library rather than an educational implementation

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, deep-learning, llm-training, llm-inference
- domain: deep-learning, machine-learning, large-language-models
- platform: python
- tags: mamba, state-space-models, pytorch, mlx, parallel-scan, jamba, educational, natural-language-processing, macos, gpu

## Member repositories
- alxndrTL/mamba.py (main) score 53

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:50.485055+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:34:20.883632+00:00, confidence not recorded.
  - readme: https://github.com/alxndrTL/mamba.py (fetched 2026-08-28T04:04:50.485055+00:00, sha 9d78d7da964c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
