Mamba Architecture (Selective State Space Models)
Hands-on skill for installing, running and benchmarking Mamba-1/Mamba-2 linear-complexity SSMs.
Dev & CodingAdvanced★ 11,926⑂ 867AI score 8/10Last updated: Jun 16, 2026
What it does
Helps you actually run Mamba, a state space model with O(n) complexity instead of the Transformer's O(n²) attention.
- Install steps for
mamba-ssm/causal-conv1dplus prerequisites (Linux, NVIDIA GPU, CUDA 11.6+) - Code for Mamba blocks and full LMs via
MambaLMHeadModel, including text generation - Loading pretrained HuggingFace checkpoints (
state-spaces/mamba-130m…mamba-2.8b) - Mamba-1 (d_state=16) vs Mamba-2 (d_state=128, multi-head, RMSNorm, tensor parallelism) comparison
- Benchmark commands against a Transformer baseline (Pythia) and a per-model VRAM table
- Fixes for common issues: OOM, slow builds, HuggingFace loading errors
Who it's for
- ML engineers needing very long contexts (100K+ tokens) or streaming inference
- LLM serving teams trying to cut KV-cache memory
- Researchers comparing Transformer alternatives (RWKV, RetNet, Hyena)
Examples
- "Load mamba-2.8b on GPU and generate from this prompt" → gives pretrained loading + generate code
- "Swap my block for Mamba-2" → explains
headdim,ngroupsand the differences from Mamba-1 - "Measure whether Mamba beats Pythia on generation speed" → provides matched benchmark commands
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/Orchestra-Research/AI-Research-SKILLs/HEAD/01-model-architecture/mamba/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the 01-model-architecture/mamba folder from the GitHub repo Orchestra-Research/AI-Research-SKILLs into my ~/.claude/skills/mamba-architecture/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/Orchestra-Research/AI-Research-SKILLs.git /tmp/ai-research-skills && mkdir -p ~/.claude/skills/mamba-architecture && cp -r /tmp/ai-research-skills/01-model-architecture/mamba/* ~/.claude/skills/mamba-architecture/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal (Linux with an NVIDIA GPU recommended).
- Clone the skill repo:
git clone https://github.com/Orchestra-Research/AI-Research-SKILLs.git - Create the skill folder:
mkdir -p ~/.claude/skills/mamba-architecture - Copy the files:
cp -r AI-Research-SKILLs/01-model-architecture/mamba/* ~/.claude/skills/mamba-architecture/ - Restart Claude Code and ask something like "use Mamba for a long-context model" to confirm the skill loads.
- Before running real code, install the packages:
pip install causal-conv1d>=1.4.0 && pip install mamba-ssm --no-build-isolation - Verify CUDA 11.6+ / PyTorch 1.12+ and available VRAM (the 2.8B model needs ~28GB in FP16).
View source on GitHub ↗License: MIT