CoolFace
Modelpublic

textclf/Llama-3.1-8B-Instruct-TQ-4bit

sourceHugging Facellama3.1updated 12d agoView on Hugging Face
0likes495downloads
Model Card

Llama-3.1-8B-Instruct-TQ-4bit

8B-parameter base model · TextCLF Quant (TQ) 4-bit Note on Hugging Face's model-size display: Hugging Face may report a smaller stored parameter count for this repository because TQ stores the weights in a packed 4-bit representation. The underlying model is Llama 3.1 8B Instruct (8B parameters). The smaller number reflects the packed storage tensors counted by the Hub, not the parameter count of the original model architecture.

Llama 3.1 8B Instruct quantized to 4-bit with TextCLF Quant (TQ).

TextCLF Quant: https://textclf.com

TQ is a calibration-free 4-bit quantization method designed to preserve the behavior of the original model without requiring a calibration dataset. Because TQ does not optimize the quantization around a fixed calibration corpus, it is designed to generalize beyond calibration-specific data and workloads.

This repository contains the 8B-parameter Llama 3.1 Instruct model quantized with TextCLF Quant (TQ) 4-bit.

Why TQ?

Calibration-free. TQ does not require a representative calibration dataset before quantization.

This avoids tying the quantization procedure to a particular calibration corpus and is intended to provide better generalization beyond the data that would otherwise have been used for calibration.

4-bit inference. Model weights are quantized to 4-bit for substantially lower weight memory requirements than BF16/FP16 deployment.

Native vLLM integration. TQ models run through the TQ vLLM quantization plugin and custom CUDA kernels included in the TextCLF TQ Docker image.

Model

Base modelmeta-llama/Llama-3.1-8B-Instruct
Original model parameters8B
QuantizationTextCLF Quant (TQ) 4-bit
CalibrationNone — calibration-free
RuntimevLLM + TQ custom kernels
Quantization nametq

Run with Docker

The recommended way to run this model is with the TQ Docker image, which contains the compatible vLLM installation, TQ quantization plugin, and TQ CUDA kernels.

1. Make sure NVIDIA Docker support works

bash
docker run --rm --gpus all \
  nvidia/cuda:13.0.2-base-ubuntu22.04 \
  nvidia-smi

Your GPU should appear in the output.

2. Start Llama-3.1-8B-Instruct-TQ-4bit

bash
docker run --rm --gpus all \
  -p 8000:8000 \
  docker.io/textclf/tq-quant:4bit-main \
  vllm serve textclf/Llama-3.1-8B-Instruct-TQ-4bit \
  --quantization tq

The model is then available through vLLM's OpenAI-compatible API on port 8000.

WSL2

If you are running Docker through WSL2 and vLLM reports that UVA is unavailable, enable vLLM's WSL2 pinned-memory support:

bash
docker run --rm --gpus all \
  -e VLLM_WSL2_ENABLE_PIN_MEMORY=1 \
  -p 8000:8000 \
  docker.io/textclf/tq-quant:4bit-main \
  vllm serve textclf/Llama-3.1-8B-Instruct-TQ-4bit \
  --quantization tq

Send a request

Once the server is ready:

bash
curl http://localhost:8000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "textclf/Llama-3.1-8B-Instruct-TQ-4bit",
    "messages": [
      {
        "role": "user",
        "content": "Explain quantization in one paragraph."
      }
    ]
  }'

Hugging Face authentication

For higher Hugging Face Hub rate limits, pass your Hugging Face token into the container:

bash
docker run --rm --gpus all \
  -e HF_TOKEN="$HF_TOKEN" \
  -p 8000:8000 \
  docker.io/textclf/tq-quant:4bit-main \
  vllm serve textclf/Llama-3.1-8B-Instruct-TQ-4bit \
  --quantization tq

On WSL2, combine it with:

bash
-e VLLM_WSL2_ENABLE_PIN_MEMORY=1

About TextCLF Quant (TQ)

Learn more at https://textclf.com.

TextCLF Quant (TQ) is a calibration-free quantization approach for efficient LLM inference.

Traditional post-training quantization methods can depend on a calibration dataset to estimate quantization parameters. The resulting quantization can therefore be influenced by the distribution and composition of that calibration data.

TQ removes that calibration-data requirement. The goal is to retain strong fidelity to the original model while allowing the quantized representation to generalize beyond any particular calibration corpus.

Base model

This checkpoint is derived from meta-llama/Llama-3.1-8B-Instruct, an 8B-parameter instruction-tuned Llama 3.1 model.

Please refer to the original Meta Llama model card for architecture details, capabilities, usage guidance, limitations, acceptable-use requirements, and upstream licensing information.

License

The base model is released under the Llama 3.1 Community License Agreement. See the repository license and the original Meta Llama model card for applicable terms.