Model reference · open weights
Meta-Llama-3.1-quantized is an open-weight language model from Red Hat. Meta-Llama-3.1-8B-Instruct-quantized.w4a16 (GPTQ) weighs 5.7 GB; the smallest configuration that runs it is RTX 3060 12 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w4a16 model card, 2026-10-01
What it is
| Released by | Red Hat |
|---|---|
| Released | 2024-07-26 |
| Parameters | 8.0B |
| VRAM | 5.7 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB | 4 | 1 | 38K | 11.6 GB |
| RTX 4060 Ti 16 GB | 8 | 2 | 66K | 15.4 GB |
| RTX 3090 24 GB | 15 | 3 | 126K | 23.4 GB |
| RTX 4090 24 GB | 15 | 3 | 125K | 23.4 GB |
| RTX 5090 32 GB | 22 | 5 | all 128K | 31.0 GB |
| L40S 48 GB | 34 | 8 | all 128K | 44.0 GB |
| A100 80 GB | 66 | 16 | all 128K | 78.2 GB |
| H100 80 GB | 62 | 15 | all 128K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 77 | 19 | all 128K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 90 | 22 | all 128K | 107 GB |
| H200 141 GB | 118 | 29 | all 128K | 138 GB |
| B200 180 GB | 153 | 38 | all 128K | 176 GB |
| 2× RTX 3060 12 GB tensor parallel | 14 | 3 | 119K | 11.6 GB a card |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 7.6 GB | 10.8 GB |
| 5 | 11.8 GB | 28.0 GB |
| 8 | 15.1 GB | 40.8 GB |
| 16 | 23.7 GB | 75.2 GB |
| 32 | 40.8 GB | 144 GB |
| 64 | 75.2 GB | 281 GB |
One card, with vLLM's small-card settings.
From the model card
Meta-Llama-3.1-8B-Instruct-quantized.w4a16
This model is a quantized version of Meta-Llama-3.1-8B-Instruct. It was evaluated on a several tasks to assess the its quality in comparison to the unquatized model, including multiple-choice, math reasoning, and open-ended text generation. Meta-Llama-3.1-8B-Instruct-quantized.w4a16 achieves 93.0% recovery for the Arena-Hard evaluation, 98.9% for OpenLLM v1 (using Meta's prompting when available), 96.1% for OpenLLM v2, 99.7% for HumanEval pass@1, and 97.4% for HumanEval+ pass@1.
This model was obtained by quantizing the weights of Meta-Llama-3.1-8B-Instruct to INT4 data type. This optimization reduces the number of bits per parameter from 16 to 4, reducing the disk size and GPU memory requirements by approximately 75%.
Only the weights of the linear operators within transformers blocks are quantized. Symmetric per-group quantization is applied, in which a linear scaling per group of 128 parameters maps the INT4 and floating point representations of the quantized weights. AutoGPTQ is used for quantization with 10% damping factor and 768 sequences taken from Neural Magic's LLM compression calibration dataset.
This model can be deployed efficiently using the vLLM backend, as shown in the example below.
from vllm import LLM, SamplingParams
from transformers import AutoTokenizer
model_id = "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w4a16"
number_gpus = 1
max_model_len = 8192
sampling_params = SamplingParams(temperature=0.6, top_p=0.9, max_tokens=256)
tokenizer = AutoTokenizer.from_pretrained(model_id)
messages = [
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
{"role": "user", "content": "Who are you?"},
]
prompts = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
llm = LLM(model=model_id, tensor_parallel_size=number_gpus, max_model_len=max_model_len)
outputs = llm.generate(prompts, sampling_params)
generated_text = outputs[0].outputs[0].text
print(generated_text)
vLLM also supports OpenAI-compatible serving. See the documentation for more details.
podman run --rm -it --device nvidia.com/gpu=all -p 8000:8000 \
--ipc=host \
--env "HUGGING_FACE_HUB_TOKEN=$HF_TOKEN" \
--env "HF_HUB_OFFLINE=0" -v ~/.cache/vllm:/home/vllm/.cache \
--name=vllm \
registry.access.redhat.com/rhaiis/rh-vllm-cuda \
vllm serve \
--tensor-parallel-size 8 \
--max-model-len 32768 \
--enforce-eager --model RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w4a16
See Red Hat AI Inference Server documentation for more details.
# Download model from Red Hat Registry via docker
# Note: This downloads the model to ~/.cache/instructlab/models unless --model-dir is specified.
ilab model download --repository docker://registry.redhat.io/rhelai1/llama-3-1-8b-instruct-quantized-w4a16:1.5
# Serve model via ilab
ilab model serve --model-path ~/.cache/instructlab/models/llama-3-1-8b-instruct-quantized-w4a16
# Chat with model
ilab model chat --model ~/.cache/instructlab/models/llama-3-1-8b-instruct-quantized-w4a16
See Red Hat Enterprise Linux AI documentation for more details.
# Setting up vllm server with ServingRuntime
# Save as: vllm-servingruntime.yaml
apiVersion: serving.kserve.io/v1alpha1
kind: ServingRuntime
metadata:
name: vllm-cuda-runtime # OPTIONAL CHANGE: set a unique name
annotations:
openshift.io/display-name: vLLM NVIDIA GPU ServingRuntime for KServe
opendatahub.io/recommended-accelerators: '["nvidia.com/gpu"]'
labels:
opendatahub.io/dashboard: 'true'
spec:
annotations:
prometheus.io/port: '8080'
prometheus.io/path: '/metrics'
multiModel: false
supportedModelFormats:
- autoSelect: true
name: vLLM
containers:
- name: kserve-container
image: quay.io/modh/vllm:rhoai-2.20-cuda # CHANGE if needed. If AMD: quay.io/modh/vllm:rhoai-2.20-rocm
command:
- python
- -m
- vllm.entrypoints.openai.api_server
args:
- "--port=8080"
- "--model=/mnt/models"
- "--served-model-name={{.Name}}"
env:
- name: HF_HOME
value: /tmp/hf_home
ports:
- containerPort: 8080
protocol: TCP
# Attach model to vllm server. This is an NVIDIA template
# Save as: inferenceservice.yaml
apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
annotations:
openshift.io/display-name: llama-3-1-8b-instruct-quantized-w4a16 # OPTIONAL CHANGE
serving.kserve.io/deploymentMode: RawDeployment
name: llama-3-1-8b-instruct-quantized-w4a16 # specify model name. This value will be used to invoke the model in the payload
labels:
opendatahub.io/dashboard: 'true'
spec:
predictor:
maxQuoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.