Skip to main content
You can use vLLM with Curator in two ways.
  • Offline mode. vLLM loads the model on your machine, inside your Python process.
  • Online mode. vLLM runs as a separate server, and Curator sends requests to it.
This guide generates recipes in both modes. Offline mode uses structured output, and online mode uses plain text.

Prerequisites

  • Python 3.10 or later.
  • Curator and vLLM, installed with pip install "bespokelabs-curator[vllm]".
  • A GPU.

Define the model and the generator

Run this code first. Offline mode uses Recipe and RecipeGenerator, and both modes use the cuisines list.

Offline mode

Set backend="vllm" and pass the vLLM settings in backend_params.
Curator uses guided decoding in vLLM for structured output. If the model does not support guided decoding, Curator raises an error before it generates any responses.

Offline settings

Online mode

1

Start the vLLM server

2

Connect Curator to the server

Use the LiteLLM backend with the hosted_vllm/ prefix on the model name. This example asks for plain text, so it uses its own LLM subclass.

Example output

In offline mode, each row holds one structured recipe, like this one.