Instructions to use ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16") model = AutoModelForCausalLM.from_pretrained("ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16
- SGLang
How to use ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16 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 "ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16" \ --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": "ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16", "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 "ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16" \ --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": "ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16 with Docker Model Runner:
docker model run hf.co/ISTA-DASLab/Meta-Llama-3-8B-AQLM-PV-1Bit-1x16
An official quantization of meta-llama/Meta-Llama-3-8B using PV-Tuning on top of AQLM . For this quantization, we used 1 codebook of 16 bits for groups of 16 weights.
The 1x16g16 models require aqlm inference library v1.1.6 or newer:
pip install aqlm[gpu,cpu]>=1.1.6
Note that a large portion of this model are the 16-bit embeddings/logits matrices. You can significantly reduce the model footprint by quantizing these matrices, e.g. using bitsandbytes LLM.int8 or NF4 formats. This does not require additional training.
| Model | AQLM scheme | WikiText 2 PPL | Model size, Gb | Hub link |
|---|---|---|---|---|
| meta-llama/Meta-Llama-3-8B | 1x16g8 | 6.99 | 4.1 | Link |
| meta-llama/Meta-Llama-3-8B (this) | 1x16g16 | 9.43 | 3.9 | Link |
| meta-llama/Meta-Llama-3-70B | 1x16g8 | 4.57 | 21.9 | Link |
To learn more about the inference, as well as the information on how to quantize models yourself, please refer to the official GitHub repo. The original code for PV-Tuning can be found in the AQLM@pv-tuning branch.
- Downloads last month
- 7