Text Generation
Transformers
Safetensors
llama
gptq
quantized
2-bit
conversational
text-generation-inference
Instructions to use yw223/Meta-Llama-3.1-8B-Instruct-GPTQ-2bit 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-GPTQ-2bit 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-GPTQ-2bit") 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-GPTQ-2bit") model = AutoModelForCausalLM.from_pretrained("yw223/Meta-Llama-3.1-8B-Instruct-GPTQ-2bit") 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-GPTQ-2bit 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-GPTQ-2bit" # 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-GPTQ-2bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yw223/Meta-Llama-3.1-8B-Instruct-GPTQ-2bit
- SGLang
How to use yw223/Meta-Llama-3.1-8B-Instruct-GPTQ-2bit 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-GPTQ-2bit" \ --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-GPTQ-2bit", "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-GPTQ-2bit" \ --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-GPTQ-2bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yw223/Meta-Llama-3.1-8B-Instruct-GPTQ-2bit with Docker Model Runner:
docker model run hf.co/yw223/Meta-Llama-3.1-8B-Instruct-GPTQ-2bit
Meta-Llama-3.1-8B-Instruct GPTQ 2-bit
This repository contains a GPTQ-quantized derivative of meta-llama/Meta-Llama-3.1-8B-Instruct.
Quantization
- Method: GPTQ
- Bits: 2
- Group size: 128
- Calibration dataset:
c4 - Backend path: Hugging Face
transformers+gptqmodel
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
{
"base_model": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"bits": 2,
"config": "/nas/longleaf/home/yuanwu/Bias_Compressed_LLM/Quantization/GPTQ/configs/llama31_8b_instruct.yaml",
"created_at": "2026-06-22T03:48:09.082370+00:00",
"elapsed_seconds": 565.48,
"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.12.0+cu126",
"torch_cuda": "12.6"
},
"output_dir": "/users/y/u/yuanwu/Bias_Compressed_LLM/gptq_outputs/Meta-Llama-3.1-8B-Instruct-GPTQ-2bit",
"quantization_config": {
"backend": "auto",
"batch_size": 1,
"bits": 2,
"block_name_to_quantize": null,
"cache_block_outputs": true,
"dataset": "c4",
"desc_act": true,
"group_size": 128,
"max_input_length": 512,
"model_seqlen": 512,
"modules_in_block_to_quantize": null,
"sym": true,
"true_sequential": true
}
}
- Downloads last month
- 57
Model tree for yw223/Meta-Llama-3.1-8B-Instruct-GPTQ-2bit
Base model
meta-llama/Llama-3.1-8B Finetuned
meta-llama/Llama-3.1-8B-Instruct