vLLMTopic 37, installable

Topic 41 of 90Module 5: Local AI Ecosystem2 min read

You already know vLLM's soul: PagedAttention and continuous batching — it's the reference implementation of half of Lesson 8. The practical layer:

pip install vllm
vllm serve Qwen/Qwen2.5-7B-Instruct --max-model-len 8192
# → OpenAI-compatible server on :8000

Note what it pulls: standard Hugging Face repos (safetensors) — vLLM lives in the GPU/datacenter world, not the GGUF world (its quant formats are GPTQ, AWQ, FP8 from Topic 24). The flags that matter are your Module 4 concepts wearing names: --max-model-len (caps per-request KV budget — your Topic 31 purple segment, now a dial), --gpu-memory-utilization (how much of the pantry to claim), --tensor-parallel-size (Topic 37's layer-splitting across GPUs, for 70B+), --enable-lora (Topic 22's wardrobe: many adapters, one base, per-request), and prefix caching for shared system prompts.

Its second face is just as important: the offline batch engine for Topic 36's bulk work —

from vllm import LLM, SamplingParams
llm = LLM("Qwen/Qwen2.5-7B-Instruct")
outputs = llm.generate(list_of_50k_prompts, SamplingParams(max_tokens=400))

— which is exactly how you'd run your Lesson 3 synthetic-data pipeline at real scale, or a 100K-item classification job overnight.

Summary

The open-source GPU serving standard: paged KV, continuous batching, multi-LoRA, OpenAI-compatible — plus a max-throughput offline mode for bulk jobs.

Mental model

The restaurant operations system from Topic 37, shipped as a pip package.

Mistakes to avoid

Trying to run it on your Mac (it's CUDA-centric; Mac is MLX/llama.cpp territory), and leaving --max-model-len at a model's full 128K default — you'll allocate pantry for context nobody uses and wonder where your batch size went.

Exercise

No GPU needed for this one — write the launch command for serving your Lesson 6 model to ~30 concurrent users on a rented 24 GB GPU, choosing --max-model-len and justifying it with your Topic 37 exercise arithmetic. Command + three sentences = a deployment plan.