RolloutEngine provides an abstraction for model inference across different backends (OpenAI, vLLM, etc.).
RolloutEngine
Base class for all rollout engines.Methods
get_model_response
Generate a model response for the given messages.List of chat messages in OpenAI format.
Unique identifier for tracking requests.
Additional sampling parameters (temperature, top_p, max_tokens, etc.).
Model output containing text, tokens, and metadata.
wake_up
Initialize or warm up the engine (implementation-specific).sleep
Shutdown or clean up the engine (implementation-specific).ModelOutput
Dataclass containing model generation output.Fields
Complete generated text (may include reasoning).
Content portion of the response (excluding reasoning).
Reasoning or thought process (if model supports it).
List of tool calls made by the model.
Token IDs for the input prompt.
Token IDs for the completion.
Multimodal inputs (e.g., images).
Log probabilities for completion tokens.
Log probabilities for prompt tokens (aligned to prompt_ids).
Length of prompt in tokens.
Length of completion in tokens.
Reason generation stopped (“stop”, “length”, etc.).
Methods
OpenAIEngine
Rollout engine using OpenAI-compatible APIs.Constructor
Base URL for the API endpoint.
API key for authentication.
Model identifier.

