To use GGUF models with vLLM's official Docker image, you'll need to follow these steps:
Prerequisites
First, ensure you have a GGUF model file and the vLLM Docker image. Note that vLLM's GGUF support requires version 0.6.0 or later.
Running GGUF Models with vLLM Docker
Here's the basic command structure to run a GGUF model:
bash
docker run --runtime nvidia --gpus all \
-v /path/to/your/models:/models \
-p 8000:8000 \
--ipc=host \
vllm/vllm-openai:latest \
--model /models/your-model.gguf \
--tokenizer <tokenizer-name-or-path> \
--dtype auto \
--max-model-len <context-length>
Important Considerations
Tokenizer Specification: GGUF files don't always include tokenizer information, so you typically need to specify the tokenizer explicitly. You can either:
Use the original model's tokenizer from Hugging Face (e.g., --tokenizer meta-llama/Llama-2-7b-hf)
Mount a local tokenizer directory and point to it
Quantization Support: vLLM supports various GGUF quantization formats including Q4_0, Q4_1, Q5_0, Q5_1, Q8_0, and others. The quantization type is automatically detected from the GGUF file.
Memory Requirements: GGUF models can be memory-efficient due to quantization, but you still need sufficient GPU memory for the model and KV cache.