quantizing-models-bitsandbytes
Quantizes LLMs to 8-bit or 4-bit for 50-75% memory reduction with minimal accuracy loss.
Skill by Orchestra-Research
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/orchestra-research-quantizing-models-bitsandbytes
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/quantizing-models-bitsandbytes
What's inside
- Skill name
quantizing-models-bitsandbytes- Description
- Quantizes LLMs to 8-bit or 4-bit for 50-75% memory reduction with minimal accuracy loss. Use when GPU memory is limited, need to fit larger models, or want faster inference. Supports INT8, NF4, FP4 formats, QLoRA training, and 8-bit optimizers. Works with HuggingFace Transformers.
- License
- MIT
- Instructions
- 403 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- name: "quantizing-models-bitsandbytes" does not match folder "bitsandbytes"
Files (4)
- SKILL.md
- memory-optimization.md · references/
- qlora-training.md · references/
- quantization-formats.md · references/
SKILL.md (first lines)
# bitsandbytes - LLM Quantization
## Quick start
bitsandbytes reduces LLM memory by 50% (8-bit) or 75% (4-bit) with <1% accuracy loss.
**Installation**:
```bash
pip install bitsandbytes transformers accelerate
```
**8-bit quantization** (50% memory reduction):
```python
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):
```python
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
```
**Step 1: Calculate memory requirements**
Estimate model memory:
```
FP16 memory (GB) = Parameters × 2 bytes / 1e9
INT8 memory (GB) = Parameters × 1 byte / 1e9
INT4 memory (GB) = Parameters × 0.5 bytes / 1e9
Example (Llama 2 7B):
FP16: 7B × 2 / 1e9 = 14 GB
INT8: 7B × 1 / 1e9 = 7 GB
INT4: 7B × 0.5 / 1e9 = 3.5 GB
```
**Step 2: Choose quantization level**
| GPU VRAM | Model Size | Recommended |
|----------|------------|-------------|
| 8 GB | 3B | 4-bit |
| 12 GB | 7B | 4-bit |
| 16 GB | 7B | 8-bit or 4-bit |
| 24 GB | 13B | 8-bit or 70B 4-bit |
| 40+ GB | 70B | 8-bit |
**Step 3: Configure quantization**
For 8-bit (better accuracy):
```python
from transformers import BitsAndBytesConfig
import torch
config = BitsAndBytesConfig(
load_in_8bit=True,
llm_int8_threshold=6.0, # Outlier threshold
llm_int8_has_fp16_weight=False
)
```
For 4-bit (maximum memory savings):
```python
config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_compute_dtype=torch.float16, # Compute in FP16
bnb_4bit_quant_type="nf4", # NormalFloat4 (recommended)
bnb_4bit_use_double_quant=True # Nested quantization
)
```
**Step 4: Load and verify model**
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"meta-llama/Llama-2-13b-hf",
quantization_config=config,
device_map="auto", # Automatic device placement
torch_dtype=torch.float16
)
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-13b-hf")
# Test inference
inputs = tokenizer("Hello, how are you?", return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_length=50)From Orchestra-Research/AI-Research-SKILLs, MIT.
More from Orchestra-Research/AI-Research-SKILLs
- 0.686score
pinecone
Orchestra-Research
Managed vector database for production AI applications.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
ml-training-recipes
Orchestra-Research
Battle-tested PyTorch training recipes for all domains — LLMs, vision, diffusion, medical imaging, protein/drug discovery, spatial omics, genomics.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
chroma
Orchestra-Research
Open-source embedding database for AI applications.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
faiss
Orchestra-Research
Facebook's library for efficient similarity search and clustering of dense vectors.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
pytorch-lightning
Orchestra-Research
High-level PyTorch framework with Trainer class, automatic distributed training (DDP/FSDP/DeepSpeed), callbacks system, and minimal boilerplate.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
gptq
Orchestra-Research
Post-training 4-bit quantization for LLMs with minimal accuracy loss.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
sentencepiece
Orchestra-Research
Language-independent tokenizer treating text as raw Unicode.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
langchain
Orchestra-Research
Framework for building LLM-powered applications with agents, chains, and RAG.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
ray-data
Orchestra-Research
Scalable data processing for ML workloads.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
nemo-curator
Orchestra-Research
GPU-accelerated data curation for LLM training.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
pytorch-fsdp2
Orchestra-Research
Adds PyTorch FSDP2 (fully_shard) to training scripts with correct init, sharding, mixed precision/offload config, and distributed checkpointing.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
sentence-transformers
Orchestra-Research
Framework for state-of-the-art sentence, text, and image embeddings.
SkillCFreshness: C★ 13.9KClaude Code +9
Signals
- Stars
- 13,906
- Forks
- 973
- Open issues
- 11
- Last commit (this folder)
- Nov 20, 2025 (11 months ago)
- Last release
- Jun 16, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Website
- orchestra-research.com
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.306score
quantizing-models-bitsandbytes
ovachiever
Quantizes LLMs to 8-bit or 4-bit for 50-75% memory reduction with minimal accuracy loss.
SkillDFreshness: D★ 55Claude Code +9 - 0.260score
quantizing-models-bitsandbytes
zhuangbiaowei
Quantizes LLMs to 8-bit or 4-bit for 50-75% memory reduction with minimal accuracy loss.
SkillDFreshness: D★ 1Claude Code +9
More from Orchestra-Research
- 0.686score
pytorch-lightning
Orchestra-Research
High-level PyTorch framework with Trainer class, automatic distributed training (DDP/FSDP/DeepSpeed), callbacks system, and minimal boilerplate.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
nemo-curator
Orchestra-Research
GPU-accelerated data curation for LLM training.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
ray-data
Orchestra-Research
Scalable data processing for ML workloads.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
pytorch-fsdp2
Orchestra-Research
Adds PyTorch FSDP2 (fully_shard) to training scripts with correct init, sharding, mixed precision/offload config, and distributed checkpointing.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
sentencepiece
Orchestra-Research
Language-independent tokenizer treating text as raw Unicode.
SkillCFreshness: C★ 13.9KClaude Code +9 - 0.686score
gptq
Orchestra-Research
Post-training 4-bit quantization for LLMs with minimal accuracy loss.
SkillCFreshness: C★ 13.9KClaude Code +9
Cite this page
quantizing-models-bitsandbytes skill. Agent Mart. https://agentmart.dev/skills/orchestra-research-quantizing-models-bitsandbytes (last updated 2026-10-24)