guidellm 0.4.0a21__py3-none-any.whl → 0.4.0a155__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of guidellm might be problematic. Click here for more details.
- guidellm/__init__.py +5 -2
- guidellm/__main__.py +451 -252
- guidellm/backends/__init__.py +33 -0
- guidellm/backends/backend.py +110 -0
- guidellm/backends/openai.py +355 -0
- guidellm/backends/response_handlers.py +455 -0
- guidellm/benchmark/__init__.py +53 -39
- guidellm/benchmark/benchmarker.py +148 -317
- guidellm/benchmark/entrypoints.py +466 -128
- guidellm/benchmark/output.py +517 -771
- guidellm/benchmark/profile.py +580 -280
- guidellm/benchmark/progress.py +568 -549
- guidellm/benchmark/scenarios/__init__.py +40 -0
- guidellm/benchmark/scenarios/chat.json +6 -0
- guidellm/benchmark/scenarios/rag.json +6 -0
- guidellm/benchmark/schemas.py +2085 -0
- guidellm/data/__init__.py +28 -4
- guidellm/data/collators.py +16 -0
- guidellm/data/deserializers/__init__.py +53 -0
- guidellm/data/deserializers/deserializer.py +109 -0
- guidellm/data/deserializers/file.py +222 -0
- guidellm/data/deserializers/huggingface.py +94 -0
- guidellm/data/deserializers/memory.py +192 -0
- guidellm/data/deserializers/synthetic.py +346 -0
- guidellm/data/loaders.py +145 -0
- guidellm/data/preprocessors/__init__.py +25 -0
- guidellm/data/preprocessors/formatters.py +412 -0
- guidellm/data/preprocessors/mappers.py +198 -0
- guidellm/data/preprocessors/preprocessor.py +29 -0
- guidellm/data/processor.py +30 -0
- guidellm/data/schemas.py +13 -0
- guidellm/data/utils/__init__.py +10 -0
- guidellm/data/utils/dataset.py +94 -0
- guidellm/data/utils/functions.py +18 -0
- guidellm/extras/__init__.py +4 -0
- guidellm/extras/audio.py +215 -0
- guidellm/extras/vision.py +242 -0
- guidellm/logger.py +2 -2
- guidellm/mock_server/__init__.py +8 -0
- guidellm/mock_server/config.py +84 -0
- guidellm/mock_server/handlers/__init__.py +17 -0
- guidellm/mock_server/handlers/chat_completions.py +280 -0
- guidellm/mock_server/handlers/completions.py +280 -0
- guidellm/mock_server/handlers/tokenizer.py +142 -0
- guidellm/mock_server/models.py +510 -0
- guidellm/mock_server/server.py +168 -0
- guidellm/mock_server/utils.py +302 -0
- guidellm/preprocess/dataset.py +23 -26
- guidellm/presentation/builder.py +2 -2
- guidellm/presentation/data_models.py +25 -21
- guidellm/presentation/injector.py +2 -3
- guidellm/scheduler/__init__.py +65 -26
- guidellm/scheduler/constraints.py +1035 -0
- guidellm/scheduler/environments.py +252 -0
- guidellm/scheduler/scheduler.py +140 -368
- guidellm/scheduler/schemas.py +272 -0
- guidellm/scheduler/strategies.py +519 -0
- guidellm/scheduler/worker.py +391 -420
- guidellm/scheduler/worker_group.py +707 -0
- guidellm/schemas/__init__.py +31 -0
- guidellm/schemas/info.py +159 -0
- guidellm/schemas/request.py +216 -0
- guidellm/schemas/response.py +119 -0
- guidellm/schemas/stats.py +228 -0
- guidellm/{config.py → settings.py} +32 -21
- guidellm/utils/__init__.py +95 -8
- guidellm/utils/auto_importer.py +98 -0
- guidellm/utils/cli.py +46 -2
- guidellm/utils/console.py +183 -0
- guidellm/utils/encoding.py +778 -0
- guidellm/utils/functions.py +134 -0
- guidellm/utils/hf_datasets.py +1 -2
- guidellm/utils/hf_transformers.py +4 -4
- guidellm/utils/imports.py +9 -0
- guidellm/utils/messaging.py +1118 -0
- guidellm/utils/mixins.py +115 -0
- guidellm/utils/pydantic_utils.py +411 -0
- guidellm/utils/random.py +3 -4
- guidellm/utils/registry.py +220 -0
- guidellm/utils/singleton.py +133 -0
- guidellm/{objects → utils}/statistics.py +341 -247
- guidellm/utils/synchronous.py +159 -0
- guidellm/utils/text.py +163 -50
- guidellm/utils/typing.py +41 -0
- guidellm/version.py +1 -1
- {guidellm-0.4.0a21.dist-info → guidellm-0.4.0a155.dist-info}/METADATA +33 -10
- guidellm-0.4.0a155.dist-info/RECORD +96 -0
- guidellm/backend/__init__.py +0 -23
- guidellm/backend/backend.py +0 -259
- guidellm/backend/openai.py +0 -705
- guidellm/backend/response.py +0 -136
- guidellm/benchmark/aggregator.py +0 -760
- guidellm/benchmark/benchmark.py +0 -837
- guidellm/benchmark/scenario.py +0 -104
- guidellm/data/prideandprejudice.txt.gz +0 -0
- guidellm/dataset/__init__.py +0 -22
- guidellm/dataset/creator.py +0 -213
- guidellm/dataset/entrypoints.py +0 -42
- guidellm/dataset/file.py +0 -92
- guidellm/dataset/hf_datasets.py +0 -62
- guidellm/dataset/in_memory.py +0 -132
- guidellm/dataset/synthetic.py +0 -287
- guidellm/objects/__init__.py +0 -18
- guidellm/objects/pydantic.py +0 -89
- guidellm/request/__init__.py +0 -18
- guidellm/request/loader.py +0 -284
- guidellm/request/request.py +0 -79
- guidellm/request/types.py +0 -10
- guidellm/scheduler/queues.py +0 -25
- guidellm/scheduler/result.py +0 -155
- guidellm/scheduler/strategy.py +0 -495
- guidellm-0.4.0a21.dist-info/RECORD +0 -62
- {guidellm-0.4.0a21.dist-info → guidellm-0.4.0a155.dist-info}/WHEEL +0 -0
- {guidellm-0.4.0a21.dist-info → guidellm-0.4.0a155.dist-info}/entry_points.txt +0 -0
- {guidellm-0.4.0a21.dist-info → guidellm-0.4.0a155.dist-info}/licenses/LICENSE +0 -0
- {guidellm-0.4.0a21.dist-info → guidellm-0.4.0a155.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import Any, Literal
|
|
6
|
+
|
|
7
|
+
from rich.console import Console as RichConsole
|
|
8
|
+
from rich.padding import Padding
|
|
9
|
+
from rich.status import Status
|
|
10
|
+
from rich.text import Text
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"Colors",
|
|
14
|
+
"Console",
|
|
15
|
+
"ConsoleUpdateStep",
|
|
16
|
+
"StatusIcons",
|
|
17
|
+
"StatusStyles",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Colors:
|
|
22
|
+
# Core states
|
|
23
|
+
info: str = "light_steel_blue"
|
|
24
|
+
progress: str = "dark_slate_gray1"
|
|
25
|
+
success: str = "chartreuse1"
|
|
26
|
+
warning: str = "#FDB516"
|
|
27
|
+
error: str = "orange_red1"
|
|
28
|
+
|
|
29
|
+
# Branding
|
|
30
|
+
primary: str = "#30A2FF"
|
|
31
|
+
secondary: str = "#FDB516"
|
|
32
|
+
tertiary: str = "#008080"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
StatusIcons: Mapping[str, str] = {
|
|
36
|
+
"debug": "…",
|
|
37
|
+
"info": "ℹ",
|
|
38
|
+
"warning": "⚠",
|
|
39
|
+
"error": "✖",
|
|
40
|
+
"critical": "‼",
|
|
41
|
+
"notset": "⟳",
|
|
42
|
+
"success": "✔",
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
StatusStyles: Mapping[str, str] = {
|
|
46
|
+
"debug": "dim",
|
|
47
|
+
"info": f"bold {Colors.info}",
|
|
48
|
+
"warning": f"bold {Colors.warning}",
|
|
49
|
+
"error": f"bold {Colors.error}",
|
|
50
|
+
"critical": "bold red reverse",
|
|
51
|
+
"notset": f"bold {Colors.progress}",
|
|
52
|
+
"success": f"bold {Colors.success}",
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@dataclass
|
|
57
|
+
class ConsoleUpdateStep:
|
|
58
|
+
console: Console
|
|
59
|
+
title: str
|
|
60
|
+
details: Any | None = None
|
|
61
|
+
status_level: Literal[
|
|
62
|
+
"debug",
|
|
63
|
+
"info",
|
|
64
|
+
"warning",
|
|
65
|
+
"error",
|
|
66
|
+
"critical",
|
|
67
|
+
"notset",
|
|
68
|
+
"success",
|
|
69
|
+
] = "info"
|
|
70
|
+
spinner: str = "dots"
|
|
71
|
+
_status: Status | None = None
|
|
72
|
+
|
|
73
|
+
def __enter__(self):
|
|
74
|
+
if self.console.quiet:
|
|
75
|
+
return self
|
|
76
|
+
|
|
77
|
+
self._status = self.console.status(
|
|
78
|
+
f"[{StatusStyles.get(self.status_level, 'bold')}]{self.title}[/]",
|
|
79
|
+
spinner=self.spinner,
|
|
80
|
+
)
|
|
81
|
+
self._status.__enter__()
|
|
82
|
+
return self
|
|
83
|
+
|
|
84
|
+
def update(
|
|
85
|
+
self,
|
|
86
|
+
title: str,
|
|
87
|
+
status_level: Literal[
|
|
88
|
+
"debug",
|
|
89
|
+
"info",
|
|
90
|
+
"warning",
|
|
91
|
+
"error",
|
|
92
|
+
"critical",
|
|
93
|
+
"notset",
|
|
94
|
+
"success",
|
|
95
|
+
]
|
|
96
|
+
| None = None,
|
|
97
|
+
):
|
|
98
|
+
self.title = title
|
|
99
|
+
if status_level is not None:
|
|
100
|
+
self.status_level = status_level
|
|
101
|
+
if self._status:
|
|
102
|
+
self._status.update(
|
|
103
|
+
status=f"[{StatusStyles.get(self.status_level, 'bold')}]{title}[/]"
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
def finish(
|
|
107
|
+
self,
|
|
108
|
+
title: str,
|
|
109
|
+
details: Any | None = None,
|
|
110
|
+
status_level: Literal[
|
|
111
|
+
"debug",
|
|
112
|
+
"info",
|
|
113
|
+
"warning",
|
|
114
|
+
"error",
|
|
115
|
+
"critical",
|
|
116
|
+
"notset",
|
|
117
|
+
"success",
|
|
118
|
+
] = "info",
|
|
119
|
+
):
|
|
120
|
+
self.title = title
|
|
121
|
+
self.status_level = status_level
|
|
122
|
+
if self._status:
|
|
123
|
+
self._status.stop()
|
|
124
|
+
self.console.print_update(title, details, status_level)
|
|
125
|
+
|
|
126
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
127
|
+
if self._status:
|
|
128
|
+
return self._status.__exit__(exc_type, exc_val, exc_tb)
|
|
129
|
+
return False
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class Console(RichConsole):
|
|
133
|
+
def print_update(
|
|
134
|
+
self,
|
|
135
|
+
title: str,
|
|
136
|
+
details: str | None = None,
|
|
137
|
+
status: Literal[
|
|
138
|
+
"debug",
|
|
139
|
+
"info",
|
|
140
|
+
"warning",
|
|
141
|
+
"error",
|
|
142
|
+
"critical",
|
|
143
|
+
"notset",
|
|
144
|
+
"success",
|
|
145
|
+
] = "info",
|
|
146
|
+
) -> None:
|
|
147
|
+
icon = StatusIcons.get(status, "•")
|
|
148
|
+
style = StatusStyles.get(status, "bold")
|
|
149
|
+
line = Text.assemble(f"{icon} ", (title, style))
|
|
150
|
+
self.print(line)
|
|
151
|
+
self.print_update_details(details)
|
|
152
|
+
|
|
153
|
+
def print_update_details(self, details: Any | None):
|
|
154
|
+
if details:
|
|
155
|
+
block = Padding(
|
|
156
|
+
Text.from_markup(str(details)),
|
|
157
|
+
(0, 0, 0, 2),
|
|
158
|
+
style=StatusStyles.get("debug", "dim"),
|
|
159
|
+
)
|
|
160
|
+
self.print(block)
|
|
161
|
+
|
|
162
|
+
def print_update_step(
|
|
163
|
+
self,
|
|
164
|
+
title: str,
|
|
165
|
+
status: Literal[
|
|
166
|
+
"debug",
|
|
167
|
+
"info",
|
|
168
|
+
"warning",
|
|
169
|
+
"error",
|
|
170
|
+
"critical",
|
|
171
|
+
"notset",
|
|
172
|
+
"success",
|
|
173
|
+
] = "info",
|
|
174
|
+
details: Any | None = None,
|
|
175
|
+
spinner: str = "dots",
|
|
176
|
+
) -> ConsoleUpdateStep:
|
|
177
|
+
return ConsoleUpdateStep(
|
|
178
|
+
console=self,
|
|
179
|
+
title=title,
|
|
180
|
+
details=details,
|
|
181
|
+
status_level=status,
|
|
182
|
+
spinner=spinner,
|
|
183
|
+
)
|