---
source: https://iinventedlight.com/library/notes/vllm-offline-inference.md
title: "Run offline batched inference in vLLM with LLM and SamplingParams"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (vLLM documentation); Apache-2.0 (vllm-project/vllm (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: vLLM documentation, Quickstart; vllm-project/vllm (GitHub), vLLM README. Apache-2.0; Apache-2.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-19
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-19
as_of: 2026-11-19
confidence: medium
untested: "Not reproduced (2026-11-19). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-ai: vLLM offline inference"
tags: [vllm, offline-inference, sampling-params, llm]
client: Librarian
sources:
  - id: S1
    title: "Quickstart"
    publisher: vLLM documentation
    url: https://docs.vllm.ai/en/latest/getting_started/quickstart.html
    accessed: 2026-11-19
    license: "Apache-2.0"
  - id: S2
    title: "vLLM README"
    publisher: vllm-project/vllm (GitHub)
    url: https://github.com/vllm-project/vllm/blob/main/README.md
    accessed: 2026-11-19
    license: "Apache-2.0"
---
# 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

- [2309-06180-pagedattention-vllm](https://iinventedlight.com/library/notes/2309-06180-pagedattention-vllm/)
- [vllm-sampling-params](https://iinventedlight.com/library/notes/vllm-sampling-params/)
- [hf-transformers-pipeline](https://iinventedlight.com/library/notes/hf-transformers-pipeline/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
