A CLI tool designed to simply recommend (conservative), and/or profile (to maximize resource utilization) vLLM engine arguments for any HuggingFace model on the user's current hardware.
- Static Estimation: Instant parameter recommendations from model config
- Dynamic Profiling: Tests real memory usage to find actual limits
- Multi-GPU Support: Automatic tensor parallel configuration
- Smart Fail Handling: Graceful errors when VRAM insufficient
- Optimized Output: Clean logs without vLLM noise
# Create and activate uv environment
uv venv --seed --python 3.10
source .venv/bin/activate
# Install vLLM
uv pip install vllm --torch-backend=auto
# Install vllm-fit
uv pip install git+https://github.com/jranaraki/vllm-fitvllm-fit recommend <model_id> [--gpuid <ids>]
Returns estimated optimal parameters without running the model.
vllm-fit profile <model_id> [--gpuid <ids>]
Tests different configurations to find what actually fits your GPU.
vllm-fit serve <model_id> [--gpuid <ids>]
Profiles then start an optimized vLLM OpenAI-compatible server.
Use --gpuid to control which GPUs are used:
--gpuid 0- Use GPU 0 only--gpuid 0,1,2- Use GPUs 0, 1, and 2--gpuid all(default) - Use all available GPUs
Running vllm-fit recommend Qwen/Qwen3-0.6B generates the following output:
GPU VRAM: 4.0 GB
╭────────────────────────────────── Static Estimation ──────────────────────────────────╮
│ Recommended Parameters │ │
╰───────────────────────────────────────────────────────────────────────────────────────╯
model_id: Qwen/Qwen3-0.6B
gpu_memory_utilization: 0.65
max_model_len: 2444
tensor_parallel_size: 1
max_num_seqs: 8
estimated_weights_memory_gb: 1.26
Run this command:
vllm serve Qwen/Qwen3-0.6B --gpu_memory_utilization 0.65 --tensor_parallel_size 1 --max_model_len 2444 --max_num_seqs 8
Running vllm-fit profile Qwen/Qwen2.5-7B-Instruct generates the following output:
✓ Profiling completed successfully!
Summary:
• Attempted 3 configurations
• Final test: Memory=0.80, Len=4096
• Strategy: Used --enforce-eager mode for memory efficiency
• Time elapsed: 45s
╭────────────────────────────────── Dynamic Profiling ──────────────────────────────────╮
│ Optimized Parameters │
╰───────────────────────────────────────────────────────────────────────────────────────╯
model_id: Qwen/Qwen2.5-7B-Instruct
gpu_memory_utilization: 0.80
max_model_len: 4096
tensor_parallel_size: 1
max_num_seqs: 16
enforce_eager: True
Run this command:
vllm serve Qwen/Qwen2.5-7B-Instruct --gpu_memory_utilization 0.80 --max_model_len 4096 --tensor_parallel_size 1 --max_num_seqs 16 --enforce-eager
- vLLM - Install separately (GPU or CPU version, see vLLM installation docs)
- Hardware:
- GPU: NVIDIA GPU with CUDA support, 4GB+ VRAM recommended
- CPU: 16GB+ RAM recommended (varies by model size)
- Python 3.9+
- Check
nvidia-smishows your GPU - Verify CUDA:
python -c "import torch; print(torch.cuda.is_available())" - Install PyTorch with CUDA:
pip install torch --index-url https://download.pytorch.org/whl/cu118 - Update NVIDIA drivers from https://developer.nvidia.com/cuda-downloads
- Ensure vLLM CPU version is installed (not GPU version)
- Check available RAM:
python -c "import psutil; print(psutil.virtual_memory().total / 1024**3)"(need 16GB+ recommended) - Try a smaller model or quantized GGUF format
Try:
- Use
--enforce-eagerflag (added automatically by vllm-fit) - Try a quantized model (AWQ, GPTQ, 4-bit/8-bit)
- Use a smaller model variant
- Get more GPUs for larger models
Try:
- For some of the older GGUF models on HuggingFace, there might be ones that did not follow the naming convention accurately. Therefore, you might need to rename them before deployment. For instance, when you run
vllm-fit recommend Qwen/Qwen3-0.6B-GGUF:Q8_0, the recommended argumentsvllm serve Qwen/Qwen3-0.6B-GGUF:Q8_0 --gpu_memory_utilization 0.65 --max_model_len 3914 --tensor_parallel_size 1 --max_num_seqs 8 --hf-config-path Qwen/Qwen3-0.6B --tokenizer Qwen/Qwen3-0.6B --enforce-eagerworks just fine since the model name in the~/.cache/huggingface/hub/models--Qwen--Qwen3-0.6B-GGUF/snapshots/23749fefcc72300e3a2ad315e1317431b06b590ais as expected (seeQwen3-0.6B-Q8_0.gguf), where the quantization substring isQ8_0. However, when you runvllm-fit recommend Qwen/Qwen2-0.5B-Instruct-GGUF:Q8_0, although the provided recommendation is correct,vllm serve Qwen/Qwen2-0.5B-Instruct-GGUF:Q8_0 --gpu_memory_utilization 0.65 --max_model_len 6098 --tensor_parallel_size 1 --max_num_seqs 8 --hf-config-path Qwen/Qwen2-0.5B-Instruct --tokenizer Qwen/Qwen2-0.5B-Instruct --enforce-eager, since the downloaded model's name did not follow the naming convention, you will get this error from vLLMValueError: Downloaded GGUF files not found in /home/USER/.cache/huggingface/hub/models--Qwen--Qwen2-0.5B-Instruct-GGUF/snapshots/198f08841147e5196a6a69bd0053690fb1fd3857 for quant_type Q8_0since the model name isqwen2-0_5b-instruct-q8_0.gguf. To fix this, rename the model, in the cache/home/USER/.cache/huggingface/hub/models--Qwen--Qwen2-0.5B-Instruct-GGUF/snapshots/198f08841147e5196a6a69bd0053690fb1fd3857, fromqwen2-0_5b-instruct-q8_0.gguftoqwen2-0_5b-instruct-Q8_0.gguf.
- Fetches model config from Hugging Face
- Estimates parameters based on model architecture and available VRAM
- Profiles by testing the actual vLLM engine with different settings
- Iteratively adjusts memory, sequence length, and batch size until successful
- Returns exact command to run with optimal parameters
If you find vllm-fit useful and are interested in citing this work, please use the following BibTex entry:
@software{vllmfit2026,
author = {Javad Anaraki},
title = {vllm-fit: Hardware-Aware vLLM Argument Recommendation and Profiling},
url = {https://github.com/jranaraki/vllm-fit},
version = {0.3.0},
year = {2026},
}
- llmfit for the inspiration
