guidellm.schemas.benchmark
Centralized benchmark argument schemas for GuideLLM.
AsyncProfileArgs
Bases: ProfileArgs
Pydantic model for asynchronous profile creation arguments.
Source code in src/guidellm/schemas/benchmark/profiles/asynchronous.py
BenchmarkArgs
Bases: ReloadableBaseModel
Common benchmark configuration arguments.
Source code in src/guidellm/schemas/benchmark/entrypoints.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | |
BenchmarkMetadata
Bases: StandardBaseModel
Metadata about the benchmark scenario.
Contains information such as name, description, and tags that describe the benchmark scenario. This metadata is used for reporting and organizational purposes but does not affect benchmark execution.
Source code in src/guidellm/schemas/benchmark/entrypoints.py
BenchmarkOutputArgs
Bases: PydanticClassRegistryMixin['BenchmarkOutputArgs'], ABC
Base class for output creation arguments.
This class serves as a base for defining argument models used in the creation of output instances. It inherits from PydanticClassRegistryMixin to enable automatic registration of subclasses, allowing for flexible and extensible output configurations.
Attributes:
| Name | Type | Description |
|---|---|---|
schema_discriminator | str | Field name for polymorphic deserialization |
Source code in src/guidellm/schemas/benchmark/outputs/output.py
__pydantic_schema_base_type__() classmethod
Return base type for polymorphic validation hierarchy.
Returns:
| Type | Description |
|---|---|
type[BenchmarkOutputArgs] | Base BenchmarkOutputArgs class for schema validation |
Source code in src/guidellm/schemas/benchmark/outputs/output.py
BenchmarkScenario
Bases: ReloadableBaseModel, BaseSettings
Configuration arguments for generative text benchmark execution.
Defines all parameters for benchmark setup including target endpoint, data sources, backend configuration, processing pipeline, output formatting, and execution constraints. Supports loading from scenario files and merging with runtime overrides for flexible benchmark construction from multiple sources.
Example::
# Load from built-in scenario with overrides
args = BenchmarkScenario.create(
scenario="chat",
spec={"backend": {"kind": "openai_http", "target": "http://localhost:8000/v1"}},
)
# Create from keyword arguments only
args = BenchmarkScenario(
spec=BenchmarkArgs(
backend={"kind": "openai_http", "target": "http://localhost:8000/v1"},
data=[{"kind": "synthetic_text"}],
),
)
Source code in src/guidellm/schemas/benchmark/entrypoints.py
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | |
create(scenario, **kwargs) classmethod
Create benchmark args from scenario file and keyword arguments.
Loads base configuration from scenario file (built-in or custom) and merges with provided keyword arguments. Arguments explicitly set via kwargs override scenario values, while defaulted kwargs are ignored to preserve scenario settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario | Path | str | None | Path to scenario file, built-in scenario name, or None | required |
kwargs | Any | Keyword arguments to override scenario values | {} |
Returns:
| Type | Description |
|---|---|
BenchmarkScenario | Configured benchmark args instance |
Raises:
| Type | Description |
|---|---|
ValueError | If scenario is not found or file format is unsupported |
Source code in src/guidellm/schemas/benchmark/entrypoints.py
get_benchmarks()
Get list of benchmark argument instances for each individual benchmark.
Combines global arguments with individual benchmark overrides to produce a list of fully configured benchmark argument instances for execution.
Returns:
| Type | Description |
|---|---|
list[BenchmarkArgs] | List of benchmark argument instances |
Source code in src/guidellm/schemas/benchmark/entrypoints.py
insert_first_benchmark(data) classmethod
Inserts the first benchmark into the common args.
This allows users to ommit fields from the common args if they have overrides in the first benchmark.
Source code in src/guidellm/schemas/benchmark/entrypoints.py
CSVBenchmarkOutputArgs
Bases: BenchmarkOutputArgs
Model for CSV benchmark output arguments.
Source code in src/guidellm/schemas/benchmark/outputs/csv.py
ConcurrentProfileArgs
Bases: ProfileArgs
Pydantic model for concurrent profile creation arguments.
Source code in src/guidellm/schemas/benchmark/profiles/concurrent.py
ConsoleBenchmarkOutputArgs
Bases: BenchmarkOutputArgs
Base class for console benchmark output arguments.
Source code in src/guidellm/schemas/benchmark/outputs/console.py
GenerativeMetricsArgs
Bases: MetricsArgs
Metrics configuration for generative (autoregressive) benchmarks.
Source code in src/guidellm/schemas/benchmark/entrypoints.py
GoodputProfileArgs
Bases: ProfileArgs
Pydantic model for goodput search profile creation arguments.
Source code in src/guidellm/schemas/benchmark/profiles/goodput.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
validate_metrics(metrics)
Require latency objectives for the search to search against.
Without this the run fails only once the first probe has finished and its attainment turns out to be unmeasurable, wasting a full probe duration on a configuration error.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metrics | Any | Validated metrics arguments for the run | required |
Raises:
| Type | Description |
|---|---|
ValueError | If no latency objectives are configured |
Source code in src/guidellm/schemas/benchmark/profiles/goodput.py
GoodputSLO
Bases: StandardBaseModel
Per-request latency objectives defining which requests count as conforming.
Every objective left unset is ignored. A request conforms when it satisfies all objectives that are set; a benchmark with no objectives set has no meaningful goodput and reports it as None.
Note the mapping between objective names and GuideLLM metrics. tpot is compared against :attr:GenerativeRequestStats.inter_token_latency_ms, which excludes the first token, and not against GuideLLM's time_per_output_token_ms, which includes it. This is the closest GuideLLM metric to vLLM's tpot but is not identical: vLLM divides by the interval ending at the request's completion, while inter-token latency ends at the last token received.
Example: :: slo = GoodputSLO(ttft_ms=2000, tpot_ms=100) conforming = slo.is_conforming(ttft_ms=150.0, tpot_ms=12.0, e2el_ms=None)
Source code in src/guidellm/schemas/benchmark/goodput.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
is_conforming(ttft_ms, tpot_ms, e2el_ms)
Determine whether one request's measured latencies satisfy the objectives.
A request is undetermined as soon as any configured objective has no corresponding measurement, even if another objective is already breached. Deciding such a request on its measurable objectives alone would bias the population it is averaged over: on a workload where an objective is never measurable, only the requests that happen to breach a different objective would remain, driving attainment to zero.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ttft_ms | float | None | Measured time to first token in milliseconds | required |
tpot_ms | float | None | Measured inter-token latency in milliseconds | required |
e2el_ms | float | None | Measured end-to-end latency in milliseconds | required |
Returns:
| Type | Description |
|---|---|
bool | None | True if conforming, False if violating, None if undetermined |
Source code in src/guidellm/schemas/benchmark/goodput.py
HTMLBenchmarkOutputArgs
Bases: BenchmarkOutputArgs
Model for HTML benchmark output arguments.
Source code in src/guidellm/schemas/benchmark/outputs/html.py
JSONBenchmarkOutputArgs
Bases: BenchmarkOutputArgs
Model for JSON benchmark output arguments.
Source code in src/guidellm/schemas/benchmark/outputs/serialized.py
MetricsArgs
Bases: PydanticClassRegistryMixin['MetricsArgs'], ABC
Base class for metrics collection arguments.
Attributes:
| Name | Type | Description |
|---|---|---|
schema_discriminator | str | Field name for polymorphic deserialization |
Source code in src/guidellm/schemas/benchmark/entrypoints.py
__pydantic_schema_base_type__() classmethod
Return base type for polymorphic validation hierarchy.
Returns:
| Type | Description |
|---|---|
type[MetricsArgs] | Base MetricsArgs class for schema validation |
Source code in src/guidellm/schemas/benchmark/entrypoints.py
PlotBenchmarkOutputArgs
Bases: BenchmarkOutputArgs
Model for Plot benchmark output arguments.
Defines parameters for generating static image visualizations, enforcing image output suffix.
Source code in src/guidellm/schemas/benchmark/outputs/plot.py
validate_plot_suffix(v) classmethod
Ensures the output file path ends with a supported plotting format extension.
If the suffix is missing, it defaults to .png. If an unsupported suffix is provided, it raises a ValueError.
Source code in src/guidellm/schemas/benchmark/outputs/plot.py
ProfileArgs
Bases: PydanticClassRegistryMixin['ProfileArgs'], ABC
Base class for profile creation arguments.
This class serves as a base for defining argument models used in the creation of profile instances. It inherits from PydanticClassRegistryMixin to enable automatic registration of subclasses, allowing for flexible and extensible profile configurations.
Attributes:
| Name | Type | Description |
|---|---|---|
schema_discriminator | str | Field name for polymorphic deserialization |
Source code in src/guidellm/schemas/benchmark/profiles/profile.py
__pydantic_schema_base_type__() classmethod
Return base type for polymorphic validation hierarchy.
Returns:
| Type | Description |
|---|---|
type[ProfileArgs] | Base ProfileArgs class for schema validation |
Source code in src/guidellm/schemas/benchmark/profiles/profile.py
validate_metrics(metrics)
Check the metrics configuration supports this profile.
Called once the whole benchmark configuration has validated, so a profile that needs a particular metric configured can say so before the run starts rather than failing partway through. Defaults to accepting any configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
metrics | Any | Validated metrics arguments for the run | required |
Raises:
| Type | Description |
|---|---|
ValueError | If the metrics configuration cannot support this profile |
Source code in src/guidellm/schemas/benchmark/profiles/profile.py
RandomArgs
Bases: PydanticClassRegistryMixin['RandomArgs'], ABC
Base class for random initialization arguments.
Attributes:
| Name | Type | Description |
|---|---|---|
schema_discriminator | str | Field name for polymorphic deserialization |
Source code in src/guidellm/schemas/benchmark/random.py
__pydantic_schema_base_type__() classmethod
Return base type for polymorphic validation hierarchy.
Returns:
| Type | Description |
|---|---|
type[RandomArgs] | Base RandomArgs class for schema validation |
Source code in src/guidellm/schemas/benchmark/random.py
ReplayProfileArgs
Bases: ProfileArgs
Pydantic model for trace replay profile creation arguments.
Source code in src/guidellm/schemas/benchmark/profiles/replay.py
SweepProfileArgs
Bases: ProfileArgs
Pydantic model for sweep profile creation arguments.
Source code in src/guidellm/schemas/benchmark/profiles/sweep.py
SynchronousProfileArgs
Bases: ProfileArgs
Pydantic model for synchronous profile creation arguments.
Source code in src/guidellm/schemas/benchmark/profiles/synchronous.py
ThroughputProfileArgs
Bases: ProfileArgs
Pydantic model for throughput profile creation arguments.
Source code in src/guidellm/schemas/benchmark/profiles/throughput.py
TransientPhaseConfig
Bases: StandardBaseModel
Configure warmup and cooldown phases for benchmark execution.
Supports flexible phase definition through percentage or absolute value specifications with multiple interpretation modes. Phases can be bounded by duration, request count, or both, enabling precise control over transient periods that should be excluded from final benchmark metrics.
Source code in src/guidellm/schemas/benchmark/transient.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
compute_limits(max_requests, max_seconds, enforce_preference=True)
Calculate phase boundaries from benchmark constraints.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_requests | int | float | None | Total request budget for benchmark execution | required |
max_seconds | float | None | Total duration budget for benchmark execution | required |
enforce_preference | bool | Whether to enforce preferred mode when both duration and request constraints are available | True |
Returns:
| Type | Description |
|---|---|
tuple[float | None, int | None] | Tuple of (phase duration in seconds, phase request count) |
Source code in src/guidellm/schemas/benchmark/transient.py
compute_transition_time(info, state, period)
Determine transition timestamp for entering or exiting phase.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
info | RequestInfo | RequestInfo for current request to calculate against | required |
state | SchedulerState | SchedulerState with current progress metrics and scheduler info | required |
period | Literal['start', 'end'] | Phase period, either "start" for warmup or "end" for cooldown | required |
Returns:
| Type | Description |
|---|---|
tuple[bool, float | None] | Tuple of (phase active flag, transition timestamp if applicable) |
Source code in src/guidellm/schemas/benchmark/transient.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
create_from_value(value) classmethod
Create configuration from flexible input formats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value | int | float | dict | TransientPhaseConfig | None | Configuration as int/float (percent if <1.0, absolute otherwise), dict (validated to model), TransientPhaseConfig instance, or None for defaults | required |
Returns:
| Type | Description |
|---|---|
TransientPhaseConfig | Configured TransientPhaseConfig instance |
Raises:
| Type | Description |
|---|---|
ValueError | If value type is unsupported |
Source code in src/guidellm/schemas/benchmark/transient.py
YAMLBenchmarkOutputArgs
Bases: BenchmarkOutputArgs
Model for YAML benchmark output arguments.
Source code in src/guidellm/schemas/benchmark/outputs/serialized.py
default_kind(kind)
default_kind_list(*kinds)
Default factory for lists of argument models to set the 'kind' field.
get_builtin_scenarios() cached
Retrieve all builtin scenario definitions from the scenarios directory.
Scans the scenarios directory for JSON files and returns a mapping of scenario names to their file paths. Each scenario is indexed by both its stem name (filename without extension) for convenient lookup.
Returns:
| Type | Description |
|---|---|
dict[str, Path] | Dictionary mapping scenario names and filenames to their Path objects |