SleeperGenerator
Mock a Generator component for benchmarks and load testing. This component sleeps for a configurable duration and returns a placeholder answer.
Key Features
- Simulates Generator latency without calling an external LLM API.
- Sleep duration follows a normal distribution around a configurable mean.
- Returns a configurable placeholder answer and metadata.
- Useful for pipeline performance testing and benchmarking.
Configuration
- Drag the
SleeperGeneratorcomponent onto the canvas from the Component Library. - Click the component to open the configuration panel.
- Set
mean_sleep_in_seconds,sleep_scale,answer, and optionalmetavalues.
Connections
SleeperGenerator accepts a prompt string as input. It outputs replies — a list containing the placeholder answer — and meta — optional metadata.
Connect a PromptBuilder to the prompt input. Connect the replies output to DeepsetAnswerBuilder or a pipeline output, the same way you would connect a real Generator.
Usage Example
This example replaces a real Generator with SleeperGenerator for load testing:
components:
sleeper:
type: deepset_cloud_custom_nodes.generators.sleeper.SleeperGenerator
init_parameters:
mean_sleep_in_seconds: 5
sleep_scale: 1.0
answer: Placeholder response
meta: {}
inputs:
prompt:
- sleeper.prompt
outputs:
replies: sleeper.replies
Parameters
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| prompt | str | Prompt input. The component does not use this value but accepts it to match the Generator interface. | |
| generation_kwargs | Optional[Dict[str, Any]] | None | Generation kwargs. The component does not use this value but accepts it to match the Generator interface. |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| replies | List[str] | List containing the placeholder answer. | |
| meta | List[Dict[str, Any]] | Metadata returned with the answer. |
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
| mean_sleep_in_seconds | float | 10 | Mean sleep duration in seconds before returning the answer. |
| sleep_scale | float | 1.0 | Standard deviation for the sleep duration. |
| answer | str | Placeholder | Text returned as the Generator reply. |
| meta | Optional[Dict[str, Any]] | None | Metadata returned with the answer. |
Run Method Parameters
These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.
| Parameter | Type | Default | Description |
|---|---|---|---|
| prompt | str | Prompt input. | |
| generation_kwargs | Optional[Dict[str, Any]] | None | Generation kwargs. |
Was this page helpful?