Skip to content
orchestra-research avatar

Quantizing Models Bitsandbytes

Memory-saving LLM quantization to 8-bit or 4-bit with bitsandbytes for constrained GPUs and QLoRA training.

CCM score
61 of 100
skills.sh installs
1.2K
GitHub stars
14.9K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers 8-bit (INT8) and 4-bit (NF4, FP4) loading of HuggingFace Transformers models via BitsAndBytesConfig, with memory-sizing guidance by GPU VRAM
  • Includes QLoRA fine-tuning with LoRA adapters, plus 8-bit optimizers such as paged_adamw_8bit and AdamW8bit for training
  • Guides memory estimation from parameter count and checks allocated GPU memory before and after loading or optimizer steps
  • Designed for inference or training on limited GPU memory, and compared against GPTQ, AWQ, GGUF, and FP8 for other needs

Install

$ npx -y skills add orchestra-research/ai-research-skills --skill quantizing-models-bitsandbytes -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

bitsandbytes - LLM Quantization

Quick start

bitsandbytes reduces LLM memory by 50% (8-bit) or 75% (4-bit) with <1% accuracy loss.

Installation:

pip install bitsandbytes transformers accelerate

8-bit quantization (50% memory reduction):

from transformers import AutoModelForCausalLM, BitsAndBytesConfig

config = BitsAndBytesConfig(load_in_8bit=True)
model = AutoModelForCausalLM.from_pretrained(
    "meta-llama/Llama-2-7b-hf",
    quantization_config=config,
    device_map="auto"
)

# Memory: 14GB → 7GB

4-bit quantization (75% memory reduction):

config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_compute_dtype=torch.float16
)
model = AutoModelForCausalLM.from_pretrained(
    "meta-llama/Llama-2-7b-hf",
    quantization_config=config,
    device_map="auto"
)

# Memory: 14GB → 3.5GB

Common workflows

Workflow 1: Load large model in limited GPU memory

Copy this checklist:

Quantization Loading:
- [ ] Step 1: Calculate memory requirements
- [ ] Step 2: Choose quantization level (4-bit or 8-bit)
- [ ] Step 3: Configure quantization
- [ ] Step 4: Load and verify model

Details

Repository
github.com/orchestra-research/ai-research-skills
Categories
Data Science & Analytics, AI Agents & LLM Apps
First seen
Jun 3, 2026

Questions

What does the quantizing-models-bitsandbytes skill do?

The quantizing-models-bitsandbytes skill quantizes LLMs to 8-bit or 4-bit, cutting memory use by 50-75% with minimal accuracy loss. It supports INT8, NF4 and FP4 formats, QLoRA training and 8-bit optimizers, and works with HuggingFace Transformers.

When should I use quantizing-models-bitsandbytes instead of other quantization tools?

Use quantizing-models-bitsandbytes when GPU memory is limited, you need to fit a larger model, or you want faster inference with HuggingFace Transformers. For production serving, the skill points to GPTQ or AWQ as faster alternatives, and to GGUF for CPU inference.

How do I install the quantizing-models-bitsandbytes skill?

Run npx -y skills add orchestra-research/ai-research-skills --skill quantizing-models-bitsandbytes -y in your project. Once installed, the agent can quantize models, set up QLoRA fine-tuning and use 8-bit optimizers with bitsandbytes.

Which category does quantizing-models-bitsandbytes belong to?

The quantizing-models-bitsandbytes skill is listed under Data Science & Analytics on Claude Marketplaces. It covers LLM quantization for loading large models in limited GPU memory.

More from orchestra-research/ai-research-skills

All 92

Similar to Quantizing Models Bitsandbytes

More Data Science & Analytics