compressed-tensors
Library for utilization of compressed safetensors of neural network models
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem in the LLM deployment pipeline—unifying the fragmented landscape of quantization formats. If you work with quantized models or need to support multiple compression schemes, it's a practical choice.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires torch and transformers to be installed; GPU recommended for typical use cases.
- Low friction installation with a pure Python wheel.
- Active maintenance with a recent release and steady commit activity.
License · maintenance · safety
Apache 2.0 (permissive) — Licensed under Apache 2.0 (permissive), allowing commercial use, modification, and distribution with minimal restrictions.
last release 2026-08-08 (6 days) · last repo commit 2026-08-14 · 313 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 7,323,086 downloads/mo, #1,753 on PyPI
Alternatives
Verify before relying
pip install compressed-tensors
from compressed_tensors.quantization import QuantizationConfig, apply_quantization_config
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("model_name", device_map="cuda:0")
config = QuantizationConfig.parse_file("config.json")
apply_quantization_config(model, config)- Whether the package requires specific versions of torch or transformers, or works across a range of versions
- Whether there are system-level dependencies needed beyond the listed Python packages
What it is and what it does
compressed-tensors extends the safetensors format to create a single, standardized way to store compressed neural network models. Rather than each quantization technique (GPTQ, AWQ, SmoothQuant, INT8, FP8, etc.) having its own checkpoint format, this library provides a unified representation that can handle weight-only quantization, activation quantization, KV cache quantization, and both unstructured and semi-structured sparsity patterns.
You use it to save quantized models to disk and load them back, eliminating the friction of supporting multiple compression formats. The library integrates with Hugging Face models and PyTorch, so you can apply post-training quantization, calibrate on data, compress weights, and save the result in a single consistent format that downstream inference engines can understand.
Use it for
- Save a quantized LLM checkpoint after post-training quantization (PTQ) in a format that multiple inference engines can load
- Experiment with different quantization schemes (W4A16, W8A8, etc.) on the same model without managing separate storage formats
- Build a model deployment pipeline that accepts compressed-tensors checkpoints and applies them uniformly across different quantization methods
- Store both weight and activation quantization metadata alongside compressed weights for reproducible model optimization
- Handle semi-structured sparsity patterns (e.g., 2:4 sparsity) alongside quantization in a single unified checkpoint
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem in the LLM deployment pipeline—unifying the fragmented landscape of quantization formats. If you work with quantized models or need to support multiple compression schemes, it's a practical choice.
Install
compressed-tensors on PyPI
Before you install
Low friction installation with a pure Python wheel. Active maintenance with a recent release and steady commit activity. Depends on torch, transformers, pydantic, loguru, and psutil—all standard packages in the ML ecosystem.
Requires torch and transformers to be installed; GPU recommended for typical use cases.
License in practice
Licensed under Apache 2.0 (permissive), allowing commercial use, modification, and distribution with minimal restrictions.
Quickstart
pip install compressed-tensors
from compressed_tensors.quantization import QuantizationConfig, apply_quantization_config
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("model_name", device_map="cuda:0")
config = QuantizationConfig.parse_file("config.json")
apply_quantization_config(model, config)
Verify before relying
- Whether the package requires specific versions of torch or transformers, or works across a range of versions
- Whether there are system-level dependencies needed beyond the listed Python packages
Package facts
| License | Apache 2.0 permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagestorchtransformerspydanticlogurupsutil |
| Maintenance | Actively maintained 6 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,323,086 / month, #1,753 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: compressed_tensors-0.18.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “quantized model storage format”
- compressed-tensorsProvides a unified format for storing and loading compressed neural…
- optimum-quantoA PyTorch quantization backend that reduces model size and memory by…
- qonnxQONNX provides Python utilities to work with quantized neural…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also model-compression-toolkit · nvidia-modelopt · llmcompressor · nncf · vector-quantize-pytorch · safetensors · torchao · aqtp · optimum-quanto · fastsafetensors