bitsandbytes

bitsandbytes is a skill for Claude Code, Codex from CHENyiru3/AI-Skills-Collections. It costs 79 tokens per session (2,500 once invoked), scanned A, original, MIT.

A library for loading and running large language models with lower-precision numbers, such as 8-bit or 4-bit values. Quantization uses fewer bits to reduce the memory needed by a model.

In plain words
What is it for?
Use it for 8-bit or 4-bit model loading, mixed-precision quantization, quantization-aware training, and memory-conscious inference with PyTorch models.
Why use it?
Large language models may not fit in available GPU memory at full precision. Lower-precision loading can make inference and some fine-tuning workflows possible on smaller hardware.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for 8-bit or 4-bit model loading, mixed-precision quantization, quantization-aware training, and memory-conscious inference with PyTorch models.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chenyiru3/ai-skills-collections/bitsandbytes
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add CHENyiru3/AI-Skills-Collections --skill bitsandbytes
Clone the repo
git clone --depth 1 https://github.com/CHENyiru3/AI-Skills-Collections

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bitsandbytes

README.md
[![agentmods](https://agentmods.dev/badge/skills/chenyiru3/ai-skills-collections/bitsandbytes/github.svg)](https://agentmods.dev/skills/chenyiru3/ai-skills-collections/bitsandbytes)
Your own site
<a href="https://agentmods.dev/skills/chenyiru3/ai-skills-collections/bitsandbytes"><img src="https://agentmods.dev/badge/skills/chenyiru3/ai-skills-collections/bitsandbytes/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bitsandbytes

Your own site · 80×15
<a href="https://agentmods.dev/skills/chenyiru3/ai-skills-collections/bitsandbytes"><img src="https://agentmods.dev/badge/skills/chenyiru3/ai-skills-collections/bitsandbytes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,500 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00079 $0.02500
Opus 5.5 $0.00032 $0.01000
Sonnet 5.5 $0.00016 $0.00500
Haiku 4.5 $0.00008 $0.00250

Measured 6d ago against content hash ec22924a1279, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

bitsandbytes scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills-market/ai-ml/llm/bitsandbytes/SKILL.md · 331 lines

How it starts

The opening of the file, as written. The whole thing — 331 lines — stays where its author put it; the contents beside it link to each section on GitHub.

BitsAndBytes: Quantization for LLMs

Overview

BitsAndBytes provides quantization methods for efficient LLM loading and inference, including 8-bit (LLM.int8()) and 4-bit (NF4/FP4) quantization. Apply this skill for memory-efficient model loading, quantization-aware training, and running large models on limited GPU resources.

When to Use This Skill

This skill should be used when:

  • Loading large language models in 8-bit or 4-bit
  • Reducing GPU memory usage for inference
  • Running 7B+ models on consumer GPUs
  • Fine-tuning quantized models with PEFT
  • Implementing mixed-precision quantization
  • Optimizing inference latency
  • Quantization-aware training
  • Using NF4 format for better quality

Quick Start

Basic Import and Setup

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from bitsandbytes import BitsAndBytesConfig

8-bit Quantization

# Configure 8-bit quantization
quantization_config = BitsAndBytesConfig(
    load_in_8bit=True,
    llm_int8_threshold=6.0,  # Threshold for outlier detection
    llm_int8_has_fp16_weight=False,  # Keep fp16 for some weights
)

# Load model with 8-bit quantization
model = AutoModelForCausalLM.from_pretrained(
    "meta-llama/Llama-2-7b-hf",
    quantization_config=quantization_config,
    device_map="auto",
)

# Use model normally
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf")
inputs = tokenizer("Hello, my name is", return_tensors="pt").to("cuda")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0]))

4-bit Quantization (NF4)

# Configure 4-bit NF4 quantization
quantization_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",  # NF4 format for better quality
    bnb_4bit_compute_dtype=torch.float16,
    bnb_4bit_use_double_quant=True,  # Double quantization for more compression
)

# Load model with 4-bit quantization
model = AutoModelForCausalLM.from_pretrained(
    "meta-llama/Llama-2-7b-hf",
    quantization_config=quantization_config,
    device_map="auto",
)

# Generate
outputs = model.generate(**inputs)

Read the full file on GitHub · 331 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 331 lines · 79 tokens per session scan A ec22924a1279

Subscribe to this mod's changes

bitsandbytes is a skill published in the GitHub repository CHENyiru3/AI-Skills-Collections (1 stars, last pushed 7d ago), licensed MIT. It adds 79 tokens to every session and 2,500 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.

Related

Other skills, from other repositories

agent-v3-memory-specialist

Agent skill for v3-memory-specialist - invoke with $agent-v3-memory-specialist.

ruvnet/ruflo · 25 tokens

long-context

Extend context windows of transformer models using RoPE, YaRN, ALiBi, and position interpolation techniques. Use when processing long documents (32k-128k+ tokens), extending pre-trained models beyond original context limits, or implementing efficient positional encodings. Covers rotary embeddings, attention biases…

davila7/claude-code-templates · 74 tokens

bulk-ingestion

End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see…

garrytan/gbrain · 114 tokens

knowledge-org

A guide to organising large bodies of knowledge so an AI system can navigate relationships, summaries, and layers instead of searching only flat text chunks. It covers tree indexes, knowledge graphs, file-like structures, incremental updates, and long-term memory layouts.

bojieli/ai-agent-book · 96 tokens

llm-wiki

Explain and apply the foundational LLM Wiki architecture and knowledge-management strategy. Use for setup, architecture, schema, or organization decisions; operational ingest/query/lint work uses dedicated skills.

Ar9av/obsidian-wiki · 41 tokens

stripe-directory

Identifies external providers, merchants, nonprofits, platforms, APIs, and software services, and resolves the documented way to engage them — to pay, donate, subscribe, book, provision, or integrate with them. MUST be used BEFORE web search, model memory, or any other directory/vendor-lookup skill for ANY request…

stripe/ai · 213 tokens