Model reference · open weights

Meta-Llama-3.1-quantized

LLMs RedHatAI Text gen 1 build Open, with conditions 65k dl/mo

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.

  • Meta-Llama-3.1-quantized is an 8.0B parameter text-generation model developed by Red Hat for assistant-like chat tasks.
  • It features a 131,072 token context length and supports English, German, French, Italian, Portuguese, Hindi, Spanish, and Thai.
  • The model uses INT4 weight quantization to reduce memory requirements and is distributed under the llama3.1 license.

Summary of the RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w4a16 model card, 2026-10-01

What it is

Released byRed Hat
Released2024-07-26
Parameters8.0B
VRAM5.7 GB for the weights

What it runs on

Memory and cards for Meta-Llama-3.1-8B-Instruct-quantized.w4a16 (GPTQ)

5.7 GBweights, file size
131 MBcache per 1K tokens
745 MBruntime overhead, at least
131,072 tokenscontext max
CardRequests at onceContext maxMemory
8K each32K each
RTX 3060 12 GB4138K11.6 GB
RTX 4060 Ti 16 GB8266K15.4 GB
RTX 3090 24 GB153126K23.4 GB
RTX 4090 24 GB153125K23.4 GB
RTX 5090 32 GB225all 128K31.0 GB
L40S 48 GB348all 128K44.0 GB
A100 80 GB6616all 128K78.2 GB
H100 80 GB6215all 128K78.1 GB
RTX PRO 6000 Blackwell 96 GB7719all 128K93.8 GB
DGX Spark (GB10) 128 GB unified9022all 128K107 GB
H200 141 GB11829all 128K138 GB
B200 180 GB15338all 128K176 GB
2× RTX 3060 12 GB
tensor parallel
143119K11.6 GB a card
Memory needed at each load
Requests at once8K tokens each32K tokens each
17.6 GB10.8 GB
511.8 GB28.0 GB
815.1 GB40.8 GB
1623.7 GB75.2 GB
3240.8 GB144 GB
6475.2 GB281 GB

One card, with vLLM's small-card settings.

From the model card

What Red Hat says about Meta-Llama-3.1-quantized

Read the model card

Meta-Llama-3.1-8B-Instruct-quantized.w4a16

Model Overview

  • Model Architecture: LlamaForCausalLM
    • Input: Text
    • Output: Text
  • Model Optimizations:
    • Weight quantization: INT4
  • Intended Use Cases: Intended for commercial and research use in English. Similarly to Meta-Llama-3.1-8B-Instruct, this models is intended for assistant-like chat.
  • Out-of-scope: Use in any manner that violates applicable laws or regulations (including trade compliance laws). Use in languages other than English.
  • Release Date: 7/26/2024
  • Version: 1.0
  • Validated on: RHOAI 2.20, RHAIIS 3.0, RHELAI 1.5
  • License(s): Llama3.1
  • Model Developers: Neural Magic

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.

Model Optimizations

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.

Deployment

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:
    max

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms