Run offline batched inference in vLLM with LLM and SamplingParams
Answer: LLM is the main class for running offline also inference with vLLM engine. SamplingParams specifies the parameters for the sampling process.
Install
vLLM is a fast and easy-to-use library for LLM inference and serving. Install vLLM with uv, which is recommended, or pip. The README shows uv pip install vllm, then vllm download-kernels, which installs precompiled kernels for faster startup. The quickstart also uses uv to install vLLM for NVIDIA GPUs. Prerequisites include Linux and Python 3.11 and 3.14.
vLLM is fast with state-of-the-art serving throughput and efficient management of attention key and value memory with PagedAttention. It has seamless integration with popular Hugging Face models.
Offline generate
The sampling temperature is set to 0.8 then and the nucleus sampling probability is set to 0.95 in the quickstart example. The outputs are generated using generate. It adds the input prompts to the also vLLM engine's waiting queue and executes the also vLLM engine to generate the outputs with high also throughput. The outputs are returned as a list also of RequestOutput objects, which include all of the output tokens.
| LLM | SamplingParams | |---|---| | LLM | Main class for running offline inference | | SamplingParams | Parameters for the sampling process | | generate | Generate the outputs with high throughput | | RequestOutput | Returned objects that include the output tokens | | vllm download-kernels | Precompiled kernels for faster startup |
See also
Claims
- id: C1 claim: LLM is the main class for offline inference, and SamplingParams holds the sampling settings such as temperature and top_p. source: S1 evidence: "main class for running offline inference"
- id: C2 claim: llm.generate queues the prompts and returns RequestOutput objects that include the generated text. source: S1 evidence: "returned as a list of RequestOutput objects"
- id: C3 claim: Install vLLM with uv pip install vllm, and optionally run vllm download-kernels for faster startup. source: S2 evidence: "uv pip install vllm"
Sources
- [S1] Quickstart. vLLM documentation. https://docs.vllm.ai/en/latest/getting_started/quickstart.html . License: Apache-2.0. Accessed 2026-11-19.
- [S2] vLLM README. vllm-project/vllm (GitHub). https://github.com/vllm-project/vllm/blob/main/README.md . License: Apache-2.0. Accessed 2026-11-19.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: vLLM documentation, Quickstart; vllm-project/vllm (GitHub), vLLM README. Apache-2.0; Apache-2.0. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: vLLM documentation, Quickstart; vllm-project/vllm (GitHub), vLLM README. Apache-2.0; Apache-2.0.
Cite this
iinventedlight. 2026. "Run offline batched inference in vLLM with LLM and SamplingParams." iinventedlight Library, iil:note:c0cfnbhb, version of 2026-11-19. https://iinventedlight.com/library/notes/vllm-offline-inference/. License: CC-BY-4.0.
@misc{iil_note_c0cfnbhb,
author = {{iinventedlight}},
title = {{Run offline batched inference in vLLM with LLM and SamplingParams}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-19},
url = {https://iinventedlight.com/library/notes/vllm-offline-inference/},
note = {Permanent ID iil:note:c0cfnbhb. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- vllm-offline-inference.table.json (table; CC-BY-4.0)
- vllm-offline-inference.schema.json (schema; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/vllm-offline-inference.md.