The full file
The yaml is the platform's side of the deal: it describes the hardware your job needs so the scheduler can pick matching workers. Runtime behavior (which model, context, batching) stays in serve_module.py. A typical single-GPU job:
engine: vllm_openai
model:
module: "serve_module" # scripts/serve_module.py — must export `app`
vllm: # must mirror engine_kwargs in the module
tensor_parallel_size: 1
pipeline_parallel_size: 1
cluster:
num_workers: 1 # worker machines to reserve
device: "gpu"
gpus_per_worker: 1
cpus_per_worker: 8
min_vram_gb_per_worker: 22 # free VRAM each selected worker must have
# Advisory — dashboard labels only:
mode: "data_parallel"
max_ongoing_requests: 32
# No `requirements:` — the prebuilt image owns the vLLM stack.Field reference
model.class_name and model.init_args belong to the custom /predict contract. In vLLM mode they are ignored, so leave them out.Sizing min_vram_gb_per_worker
The scheduler filters workers by this number, so set it from what your model actually needs: weights + KV cache + about 1 GB of overhead, rounded up. Weights for a 4-bit AWQ checkpoint are roughly 0.55 bytes × parameter count (an 8B model ≈ 5.5 GB); fp16 is 2 bytes × parameters. The examples spell the arithmetic out in a comment next to the field, per job.
max_model_len in the module are the two numbers to re-derive. The napkin math lives in LLMConfig options.With tensor_parallel_size above 1 the check is per GPU: every card on the worker needs min_vram_gb_per_worker ÷ gpus_per_worker free, because vLLM shards evenly and the smallest card gates the whole group.
The sync rule
The vllm: block exists because the scheduler reads only the yaml. It cannot execute your Python, yet the parallel sizes decide which hardware qualifies: TP=2 needs a two-GPU worker, PP=2 needs two workers per replica. So the two values are declared here and enforced in the module, and submit fails fast if they disagree:
vllm.tensor_parallel_size == engine_kwargs.tensor_parallel_size
vllm.pipeline_parallel_size == engine_kwargs.pipeline_parallel_sizeBoth are whole numbers ≥ 1; they count physical GPUs. Most jobs run 1/1 and can omit the block entirely.