Text Generation
Transformers
Safetensors
llama
awq
quantized
4-bit precision
conversational
text-generation-inference
compressed-tensors
Instructions to use yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit") model = AutoModelForCausalLM.from_pretrained("yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit
- SGLang
How to use yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit with Docker Model Runner:
docker model run hf.co/yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit
Meta-Llama-3.1-8B-Instruct AWQ 4-bit
This repository contains an AWQ-style weight-only quantized derivative of meta-llama/Meta-Llama-3.1-8B-Instruct.
Quantization
- Method: AWQ
- Weight bits: 4
- Activation precision: 16-bit
- Scheme: W4A16 asymmetric group quantization
- Group size: 128
- Calibration dataset:
c4 - Backend path: Hugging Face
transformers+llm-compressor - Experimental low-bit AWQ: no
Validation
Validation has not been run yet.
License and Use
This model is derived from Meta Llama 3.1 materials. Use and redistribution must comply with the Llama 3.1 Community License, the Acceptable Use Policy, and any Hugging Face gated-model terms for the base checkpoint.
Run Metadata
{
"activation_dtype": "float16_or_bfloat16",
"base_model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"bits": 4,
"config": "/nas/longleaf/home/yuanwu/Bias_Compressed_LLM/Quantization/AWQ/configs/llama31_8b_instruct.yaml",
"created_at": "2026-06-22T07:26:30.995077+00:00",
"elapsed_seconds": 618.13,
"environment": {
"cuda_available": true,
"cuda_devices": [
{
"capability": "8.9",
"index": 0,
"name": "NVIDIA L40S",
"total_memory_gb": 44.39
}
],
"platform": "Linux-5.14.0-611.16.1.el9_7.x86_64-x86_64-with-glibc2.34",
"python": "3.10.20",
"torch": "2.11.0+cu130",
"torch_cuda": "13.0"
},
"experimental_low_bit_awq": false,
"method": "AWQ",
"output_dir": "/users/y/u/yuanwu/Bias_Compressed_LLM/awq_outputs/Meta-Llama-3.1-8B-Instruct-AWQ-4bit",
"scheme": "W4A16"
}
- Downloads last month
- 45
Model tree for yw223/Meta-Llama-3.1-8B-Instruct-AWQ-4bit
Base model
meta-llama/Llama-3.1-8B Finetuned
meta-llama/Llama-3.1-8B-Instruct