Serve Qwen2.5-0.5B with vLLM on a T4 and read the logs
Colab T4 · freenotebook90 minrequiredGoal · A running vLLM OpenAI-compatible server on Colab, queried with the openai client, with every startup log line explained in your own words.
- 1In a Colab T4 runtime run pip install vllm openai; check nvidia-smi shows about 15 GB free.
- 2Launch in the background with nohup vllm serve Qwen/Qwen2.5-0.5B-Instruct --dtype half --max-model-len 4096 --gpu-memory-utilization 0.85 --port 8000 and tail the log.
- 3Copy the log lines for weight loading time, KV cache memory, number of GPU blocks and maximum concurrency into a markdown cell and explain each.
- 4Verify the KV block count against your p3-llm-serving-architecture-l2 formula (block size 16 tokens).
- 5Query /v1/chat/completions with the openai client using stream=True and print tokens as they arrive.
- 6Restart with --max-model-len 1024 and then --gpu-memory-utilization 0.6; record how the block count and max concurrency change.
- 7Curl http://localhost:8000/metrics and list vllm:num_requests_running, vllm:gpu_cache_usage_perc and the TTFT histogram.
- Deliverable
- A notebook with the annotated startup log, three configurations in a table, and a saved /metrics dump.
- Check
- Your computed KV bytes per token matches the log-derived value within 5 percent; lowering gpu-memory-utilization lowers the block count proportionally.
- Fallback
- If no GPU is available, run vLLM's CPU backend in Docker (docs.vllm.ai CPU installation) or read the same log lines from a saved log in a vLLM GitHub issue and annotate those.