Favicon of Mamba

Mamba

An open-source sequence modeling library with reusable neural network blocks, pretrained language models and local inference through PyTorch.

Mamba is a Python library for researchers and developers building sequence models, including language models. Its selective state space architecture processes sequences in linear time and is designed for efficient GPU execution.

  • Reusable model blocks: Build neural networks with Mamba, Mamba-2 or Mamba-3 blocks, or work directly with the selective state space layer.
  • Pretrained language models: Generate text with Hugging Face checkpoints such as mamba-2.8b, mamba2-2.7b and mamba-2.8b-slimpj, trained on the Pile or SlimPajama.
  • Architecture research: Study simplified blocks and a minimal structured state space duality implementation, alongside an example of a complete language model.
  • Evaluation and benchmarking: Measure generation latency and throughput, and evaluate language models with lm-evaluation-harness.

The pretrained checkpoints are base models without instruction tuning. They're suited to text completion and model research rather than ready-made chat assistants. Generation downloads weights from Hugging Face and runs inference on your hardware.

Mamba is open source under Apache 2.0 and uses PyTorch. Its GPU implementation supports NVIDIA CUDA, with AMD support through ROCm.

Similar to Mamba