# Run all testspytest tests/# Run tests for a single test file with detailed outputpytest -s -v tests/test_logger.py# Run tests matching a specific patternpytest -k "test_model" tests/
# Install the test dependencies used in CI (CUDA only)uv pip install -r requirements/common.txt -r requirements/dev.txt --torch-backend=auto# Install common test dependencies (hardware agnostic)uv pip install pytest pytest-asyncio
Known limitations:
The repository is not fully checked by mypy
Not all unit tests pass when run on CPU platforms. If you don’t have access to a GPU platform to run unit tests locally, rely on the continuous integration system
Include an example HuggingFace repository for your model in tests/models/registry.py. This enables a unit test that loads dummy weights to ensure that the model can be initialized in vLLM.
1
Add model to registry
Edit tests/models/registry.py and add your model:
tests/models/registry.py
# Example entry"YourModelForCausalLM": ModelInfo( model_name="organization/your-model", description="Your model description",),
2
Maintain alphabetical order
The list of models in each section should be maintained in alphabetical order.
If your model requires a development version of HF Transformers, you can set min_transformers_version to skip the test in CI until the model is released.
For generative models, there are two levels of correctness tests (defined in tests/models/utils.py):
# The text outputted by vLLM should exactly match the text outputted by HFcheck_outputs_equal( outputs_0_lst=hf_outputs, outputs_1_lst=vllm_outputs, name_0="hf", name_1="vllm",)
Add your model to tests/models/multimodal/processing/test_common.py to verify that the following input combinations result in the same outputs:
Text + multi-modal data
Tokens + multi-modal data
Text + cached multi-modal data
Tokens + cached multi-modal data
tests/models/multimodal/processing/test_common.py
@pytest.mark.parametrize("model_id", [ "llava-hf/llava-1.5-7b-hf", "organization/your-multimodal-model", # Add your model here])def test_input_combinations(model_id): # Test runs automatically for all models ...
You can add a new file under tests/models/multimodal/processing to run tests that only apply to your model.For example, if the HF processor for your model accepts user-specified keyword arguments, you can verify that the keyword arguments are being applied correctly:
Unit tests - Run relevant test suites based on changed files
Not all CI checks will be executed initially due to limited computational resources. The reviewer will add the ready label when a full CI run is needed.