hqq-quantization

Quantize LLM weights to 8/4/3/2/1-bit using calibration-free HQQ.

Updated May 2, 2026
One-click install
npx skills add https://github.com/qcmuu/AI-Research-Skills --skill hqq-quantization-qcmuu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hqq-quantization
Source: https://github.com/qcmuu/AI-Research-Skills/tree/main/10-optimization/hqq
Command: npx skills add https://github.com/qcmuu/AI-Research-Skills --skill hqq-quantization-qcmuu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires hqq, torch, transformers, peft, vllm, and includes references (resource) components.

What problem does it solve?

This Skill solves the slow, dataset-dependent quantization problem by enabling fast calibration-free weight quantization for LLMs, so you can reduce memory and improve inference efficiency without running expensive calibration passes.

Core Features & Use Cases

  • Calibration-free HQQ quantization: Quantize models directly to 8/4/3/2/1-bit precision without needing calibration data.
  • Configurable quantization behavior: Control precision, group size, axis, symmetric/asymmetric options, and per-layer mixed precision.
  • Production-focused deployment paths: Use optimized inference backends (e.g., Marlin, TorchAO, BitBlas, ATEN) and integrate with HuggingFace Transformers and vLLM.

Use case example: When you need to deploy a large LLM on limited GPU memory, quantize a Llama model to 4-bit using HQQ, choose an optimized backend for your hardware, and serve it with vLLM for faster, lower-cost generation.

Quick Start

Use the hqq-quantization skill to quantize a model to 4-bit with a single instruction: pip install hqq, then load the model with an HqqConfig(nbits=4, group_size=64) and generate text to verify quality.

Frequently Asked Questions about hqq-quantization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I quantize an LLM without calibration data?

Calibration-free LLM quantization uses half-quadratic quantization to directly reduce model weights to 8/4/3/2/1-bit precision without needing a calibration dataset. This allows immediate memory reduction for inference without running expensive calibration passes.

Can I deploy a 4-bit quantized model with vLLM?

Yes, you can deploy 4-bit quantized models with vLLM by configuring HqqConfig with nbits and group_size. Selecting optimized runtime backends like Marlin or TorchAO ensures efficient matrix multiplication for faster, lower-cost inference generation.

What's the best way to reduce GPU memory for large language models?

Using half-quadratic quantization to compress model weights into 8/4/3/2/1-bit representations effectively reduces GPU memory usage. Applying per-layer mixed precision and serving the quantized model via vLLM maximizes inference efficiency on limited hardware.

Does HQQ quantization support LoRA fine-tuning?

Yes, HQQ quantization supports optional LoRA fine-tuning on quantized models. This allows you to apply parameter-efficient fine-tuning to your 8/4/3/2/1-bit quantized LLMs within your existing HuggingFace Transformers and PEFT workflows.

How do I configure per-layer mixed precision during LLM quantization?

You configure per-layer mixed precision by adjusting the BaseQuantizeConfig or HqqConfig settings. This allows you to specify symmetric or asymmetric options, group size, axis, and varying bit depths across different layers for optimized inference performance.

What dependencies do I need to install for calibration-free quantization?

You need to install HQQ, alongside Torch, Transformers, PEFT, and vLLM. These dependencies enable you to load the model with HqqConfig, apply half-quadratic quantization, and execute efficient generation using available runtime backends.