Skip to content
Back to skills

Transformers Integrations

ASecurity

"Use bitsandbytes through Hugging Face Transformers, Diffusers,

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
developmentpythonapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill transformers-integrations --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Transformers Integrations?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Transformers Integrations
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-transformers-integrations/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-transformers-integrations)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: transformers-integrations
description: "Use bitsandbytes through Hugging Face Transformers, Diffusers,
  PEFT, and Accelerate for LLM.int8 inference, 4-bit/NF4 loading, QLoRA
  preparation, and FSDP-QLoRA planning."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Transformers Integrations

Use this sub-skill when the task is about loading or preparing models through Hugging Face ecosystem APIs with bitsandbytes quantization. The key API is usually `transformers.BitsAndBytesConfig`; it is provided by Transformers, not by the `bitsandbytes` Python package.

## Route Here

- Build `BitsAndBytesConfig` for `load_in_8bit`, `load_in_4bit`, NF4, double quantization, compute dtype, or quantized storage dtype.
- Load a model with `AutoModelForCausalLM.from_pretrained(..., quantization_config=..., device_map=...)`.
- Prepare QLoRA with PEFT using `prepare_model_for_kbit_training`, `LoraConfig`, and `get_peft_model`.
- Plan FSDP-QLoRA, especially `bnb_4bit_quant_storage` and dtype alignment.
- Explain Diffusers, Accelerate, or Transformers integration decisions without direct layer replacement.
- Validate a quantization config in CI without downloading model weights.

## Route Elsewhere

- For install, import, missing native library, backend visibility, `python -m bitsandbytes`, or CUDA/XPU/HPU/MPS/CPU diagnostics, use `installation-diagnostics`.
- For direct `bitsandbytes.nn.Linear8bitLt`, `Linear4bit`, `Params4bit`, `QuantState`, or low-level functional APIs, use `quantized-modules-functions`.
- For standalone 8-bit or paged optimizer training loops, `Trainer(optim=...)`, or `bitsandbytes.optim`, use `optimizers-training`.

## Start Points

- Read `references/integration-workflows.md` for 8-bit inference, 4-bit/NF4 loading, QLoRA, Diffusers/Accelerate notes, validation, and model-download safety.
- Read `references/fsdp-qlora.md` for FSDP-QLoRA dtype, storage, sharding, and state-dict caveats.
- Read `references/troubleshooting.md` when integrations fail at import, model loading, device mapping, dtype, offload, or distributed save time.
- Run `scripts/transformers-bnb-config-check.py --mode qlora` to validate optional dependency imports and print no-download config snippets.

## Working Rules

- Separate config construction from execution: `BitsAndBytesConfig` can often be constructed on CPU-only CI, but actual quantized model loading may require a compatible accelerator, memory plan, model access, and network/cache availability.
- Prefer `quantization_config=BitsAndBytesConfig(...)` over legacy direct `load_in_8bit=True` or `load_in_4bit=True` arguments to `from_pretrained`.
- Treat model IDs, tokens, gated repositories, and remote code as deployment inputs; never assume downloads are allowed.
- Keep backend failures routed to installation diagnostics before changing model-loading code.

Files in this skill

  • SKILL.md2.8 KB
  • references/fsdp-qlora.md3.9 KB
  • references/integration-workflows.md6.9 KB
  • references/troubleshooting.md4.5 KB
  • scripts/transformers-bnb-config-check.py7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.