# Mamba

> PyTorch library for Mamba selective state space models (Mamba, Mamba-2, Mamba-3), with hardware-aware kernels and pretrained checkpoints

Source: https://talira.ai/catalog/mamba-gvrg6d1v
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [ai / ml / model libraries](https://talira.ai/categories/ai/ml/model-libraries), [ai / ml / gpu kernels](https://talira.ai/categories/ai/ml/gpu-kernels)
- Platforms: linux[^1]
- Licence: Apache-2.0[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Backed by: [state-spaces](https://talira.ai/orgs/state-spaces.md)

Mamba (the `mamba-ssm` package) is the reference PyTorch implementation of the Mamba state space model architecture by Albert Gu and Tri Dao: a subquadratic alternative to Transformers for sequence modeling, with a hardware-aware selective-scan design in the spirit of [FlashAttention](https://talira.ai/catalog/flashattention-7z5qwqsr.md). It provides the selective SSM layer, the Mamba, Mamba-2 and Mamba-3 blocks, a full language model with generation scripts, and pretrained checkpoints from 130M to 2.8B parameters on Hugging Face. It builds on [PyTorch](https://talira.ai/catalog/pytorch-95ycaf9h.md). Not to be confused with the Mamba package manager.

## Links

- GitHub: https://github.com/state-spaces/mamba

## Problems it solves

- train a sequence model that scales linearly with length instead of a Transformer
- try a state space model architecture in my PyTorch research code
- run long-context language modeling without quadratic attention cost

## Features

- selective state space (SSM) layer with a fused CUDA scan
- Mamba, Mamba-2 and Mamba-3 blocks
- full language model and generation scripts
- pretrained Mamba and Mamba-2 checkpoints up to 2.8B parameters
- NVIDIA CUDA and AMD ROCm support

## Limitations

- Runs on Linux with PyTorch; the fast selective-scan kernels need an NVIDIA GPU with CUDA 11.6+ (or an AMD GPU with ROCm) and are compiled or downloaded only when you opt in.[^1]
- The pretrained checkpoints are research models trained on the Pile (up to 2.8B parameters), not instruction-tuned assistants.[^1]

## Trust

Overall: 0.46 out of 1.
Signals: maintenance 0.27, adoption 0.86, momentum 0.82, community 0.71, backing 0.30, extensibility 0.00.

- latest release v2.3.2.post1 6 months ago
- 19.0k GitHub stars
- 58 contributors
- backed by state-spaces

Warnings:

- last commit 4 months ago

## Alternatives

- [RWKV](https://talira.ai/catalog/rwkv-dsmsfkcm.md): An attention-free RNN language model architecture that trains like a transformer, with its reference code

## Sources

[^1]: https://github.com/state-spaces/mamba/blob/main/README.md (checked 29 Nov 2026)
[^2]: https://github.com/state-spaces/mamba/blob/main/LICENSE (checked 29 Nov 2026)
