Text Generation
Transformers
Safetensors
llama
facebook
meta
llama-3
int8
vllm
chat
neuralmagic
llmcompressor
conversational
8-bit precision
compressed-tensors
text-generation-inference
8-bit precision
Instructions to use RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8") model = AutoModelForCausalLM.from_pretrained("RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8
- SGLang
How to use RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8 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 "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8" \ --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": "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8", "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 "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8" \ --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": "RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8 with Docker Model Runner:
docker model run hf.co/RedHatAI/Meta-Llama-3.1-8B-Instruct-quantized.w8a8
Commit History
-
fix: quantization_status frozen -> compressed
Verified signature024e24c
-
Remove sparsity_config fields from config.json
Verified signature0b61d8e
-
Update README.md
Verified signatureee1d45a
-
Update README.md
Verified signaturefc26695
-
corrected typo: from: "...to assess the its quality..." (#4)
- corrected typo: from: "...to assess the its quality..." (820eff3eacb6ee12c3f3a9cc9d6b2b3f9cacffb6) Co-authored-by: Bertrand <braultathf@users.noreply.huggingface.co>663170e
-
Update README.md
Verified signaturea2127dd
-
Update README.md
Verified signaturee2bfb7d
-
Update README.md
Verified signature2dc9aa6
-
Update README.md
Verified signatureabfb1f5 -
Update README.md
Verified signature60ab6d3
-
Update README.md
Verified signature0fe06b1
-
Update README.md (#3)
Verified signature- Update README.md (9811037b3bdd0e39bd4c5e8ff039e97bb4da453d) Co-authored-by: Jenny Y <jennyyyi@users.noreply.huggingface.co>3791930
-
Update README.md
Verified signaturee6a4ff7
-
Update README.md
Verified signatured292013
-
Updated compression_config to quantization_config
Verified signaturef2c944e
-
Update README.md
Verified signature6aa0e7f -
Update README.md
Verified signature9495321 -
Upload tokenizer.json with huggingface_hub
Verified signaturebe1f41f -
Update README.md
Verified signatured7ac0b1
-
Update README.md
Verified signature1343a1c -
Upload tokenizer_config.json with huggingface_hub
Verified signaturef40c407
-
Update README.md
Verified signature2bfe93f
-
Update README.md
Verified signature44910a5 -
Update README.md
Verified signaturee94a1df -
Update README.md
Verified signature41fa77c
-
Update README.md
Verified signaturee191b8d
-
Update README.md
Verified signature8f89d5f
-
Update README.md
Verified signaturea5278f0 -
Update README.md
Verified signaturebe01205 -
Update README.md
Verified signature8e4a37a -
Create README.md
Verified signaturefa37030 -
Upload folder using huggingface_hub
Verified signature25b9a14 -
initial commit
Verified signature8599c95