vLLM is a high-throughput and memory-efficient inference and serving engine for large language models (LLMs). It utilizes various optimization techniques, such as PagedAttention, to significantly improve LLM serving performance. Currently at version 0.19.0, vLLM maintains a rapid release cadence with frequent updates and new feature additions.
pip install vllmVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the vLLM engine with a specified model and generate text for multiple prompts using custom sampling parameters. Ensure you have a CUDA-enabled GPU and adequate VRAM for the chosen model. The model will be downloaded from Hugging Face if not available locally.
To disable async scheduling and revert to the synchronous behavior, use the `--no-async-scheduling` flag when running the vLLM server or set `enable_async=False` in Python API calls where applicable.
Ensure your PyTorch installation matches the required version and CUDA compatibility. Consider using `pip install vllm --extra-index-url https://download.pytorch.org/whl/cuXX` where `XX` is your CUDA version (e.g., `cu121`, `cu122`, `cu129`).
Try removing system CUDA paths from `LD_LIBRARY_PATH` (e.g., `unset LD_LIBRARY_PATH`), or install vLLM with `uv pip install vllm --torch-backend=auto`, or specify the PyTorch CUDA wheel during installation (e.g., `pip install vllm --extra-index-url https://download.pytorch.org/whl/cu129`).
Upgrade your `transformers` library to the recommended version. For Gemma 4, `transformers>=5.5.0` is required. Always check the release notes for specific model requirements.
If encountering accuracy issues with this specific model/hardware/quantization combination, consider using a different KV cache precision (e.g., FP16) or consult later patch releases for potential fixes.
Ensure the appropriate NVIDIA CUDA Toolkit version (compatible with your GPU and PyTorch) is installed and its `bin` directory is added to your system's PATH. Verify with `nvcc --version`.
Update your import statement from `from vllm.entrypoints.llm import LLM` to `from vllm import LLM`.
Reduce the `max_model_len`, `max_num_batched_tokens`, `max_seqs`, or `gpu_memory_utilization` parameters when initializing `LLM`, or use a smaller model.