Model reference · open weights

mamba

LLMs state-spaces Text gen 5 builds Licence not stated 322k dl/mo

mamba is an open-weight language model from state-spaces. mamba-2.8b-hf (FP32) weighs 5.5 GB; the smallest configuration that runs it is RTX 3060 12 GB.

  • Mamba is a text-generation model developed by state-spaces and published as state-spaces/mamba-130m-hf.
  • It contains 129M parameters and is compatible with the transformers library, requiring version 4.39.0 or later for standard usage.
  • The model supports causal language modeling tasks and can be fine-tuned using PEFT techniques such as LoRA.

Summary of the state-spaces/mamba-130m-hf model card, 2026-10-01. The estimate below is for another build of the family.

What it is

Released bystate-spaces
Released2024-03-06
Parameters129M
VRAM5.5 GB for the weights

What it runs on

Memory and cards for mamba-2.8b-hf (FP32)

5.5 GBweights, file size
0 MBcache per 1K tokens
25 MBfixed state per request
565 MBruntime overhead, at least
CardRequests at onceContext maxMemory
8K each32K each
RTX 3060 12 GB221221128K11.6 GB
RTX 4060 Ti 16 GB373373128K15.4 GB
RTX 3090 24 GB694694128K23.4 GB
RTX 4090 24 GB692692128K23.4 GB
RTX 5090 32 GB1000+1000+128K31.0 GB
L40S 48 GB1000+1000+128K44.0 GB
A100 80 GB1000+1000+128K78.2 GB
H100 80 GB1000+1000+128K78.1 GB
RTX PRO 6000 Blackwell 96 GB1000+1000+128K93.8 GB
DGX Spark (GB10) 128 GB unified1000+1000+128K107 GB
H200 141 GB1000+1000+128K138 GB
B200 180 GB1000+1000+128K176 GB
Memory needed at each load
Requests at once8K tokens each32K tokens each
16.1 GB6.1 GB
56.2 GB6.2 GB
86.3 GB6.3 GB
166.5 GB6.5 GB
326.9 GB6.9 GB
647.7 GB7.7 GB

One card, with vLLM's small-card settings.

Builds

Sizes, precisions & builds

BuildParamsPrecisionWeightsSmallest setup
mamba-130m-hf ↗ 129MFP32 258 MBRTX 3060 12 GB
mamba-2.8b-hf (above) ↗ 2.8BFP32 5.5 GBRTX 3060 12 GB
mamba-1.4b-hf ↗ 1.4BFP32 2.7 GBRTX 3060 12 GB
mamba-370m-hf ↗ 372MFP32 743 MBRTX 3060 12 GB
mamba-790m-hf ↗ 793MFP32 1.6 GBRTX 3060 12 GB

From the model card

What state-spaces says about mamba

Read the model card

This repository contains the transfromers compatible mamba-2.8b. The checkpoints are untouched, but the full config.json and tokenizer are pushed to this repo.

Usage

You need to install transformers from main until transformers=4.39.0 is released.

pip install git+https://github.com/huggingface/transformers@main

We also recommend you to install both causal_conv_1d and mamba-ssm using:

pip install causal-conv1d>=1.2.0
pip install mamba-ssm

If any of these two is not installed, the "eager" implementation will be used. Otherwise the more optimised cuda kernels will be used.

Generation

You can use the classic generate API:

>>> from transformers import MambaConfig, MambaForCausalLM, AutoTokenizer
>>> import torch

>>> tokenizer = AutoTokenizer.from_pretrained("state-spaces/mamba-130m-hf")
>>> model = MambaForCausalLM.from_pretrained("state-spaces/mamba-130m-hf")
>>> input_ids = tokenizer("Hey how are you doing?", return_tensors="pt")["input_ids"]

>>> out = model.generate(input_ids, max_new_tokens=10)
>>> print(tokenizer.batch_decode(out))
["Hey how are you doing?\n\nI'm so glad you're here."]

PEFT finetuning example

In order to finetune using the peft library, we recommend keeping the model in float32!

from datasets import load_dataset
from trl import SFTTrainer
from peft import LoraConfig
from transformers import AutoTokenizer, AutoModelForCausalLM, TrainingArguments
tokenizer = AutoTokenizer.from_pretrained("state-spaces/mamba-130m-hf")
model = AutoModelForCausalLM.from_pretrained("state-spaces/mamba-130m-hf")
dataset = load_dataset("Abirate/english_quotes", split="train")
training_args = TrainingArguments(
    output_dir="./results",
    num_train_epochs=3,
    per_device_train_batch_size=4,
    logging_dir='./logs',
    logging_steps=10,
    learning_rate=2e-3
)
lora_config =  LoraConfig(
        r=8,
        target_modules=["x_proj", "embeddings", "in_proj", "out_proj"],
        task_type="CAUSAL_LM",
        bias="none"
)
trainer = SFTTrainer(
    model=model,
    tokenizer=tokenizer,
    args=training_args,
    peft_config=lora_config,
    train_dataset=dataset,
    dataset_text_field="quote",
)
trainer.train()

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms