vllm-optimizer 0.1.0a11__tar.gz

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.
Files changed (104) hide show
  1. vllm_optimizer-0.1.0a11/LICENSE +21 -0
  2. vllm_optimizer-0.1.0a11/PKG-INFO +224 -0
  3. vllm_optimizer-0.1.0a11/README.md +197 -0
  4. vllm_optimizer-0.1.0a11/pyproject.toml +38 -0
  5. vllm_optimizer-0.1.0a11/setup.cfg +4 -0
  6. vllm_optimizer-0.1.0a11/src/vllm_optimizer/__init__.py +7 -0
  7. vllm_optimizer-0.1.0a11/src/vllm_optimizer/benchmarks/__init__.py +13 -0
  8. vllm_optimizer-0.1.0a11/src/vllm_optimizer/benchmarks/configuration.py +84 -0
  9. vllm_optimizer-0.1.0a11/src/vllm_optimizer/benchmarks/guidellm.py +126 -0
  10. vllm_optimizer-0.1.0a11/src/vllm_optimizer/benchmarks/metrics.py +122 -0
  11. vllm_optimizer-0.1.0a11/src/vllm_optimizer/benchmarks/timing.py +77 -0
  12. vllm_optimizer-0.1.0a11/src/vllm_optimizer/benchmarks/vllm.py +92 -0
  13. vllm_optimizer-0.1.0a11/src/vllm_optimizer/cli.py +117 -0
  14. vllm_optimizer-0.1.0a11/src/vllm_optimizer/cli_options.py +46 -0
  15. vllm_optimizer-0.1.0a11/src/vllm_optimizer/config/__init__.py +6 -0
  16. vllm_optimizer-0.1.0a11/src/vllm_optimizer/config/errors.py +17 -0
  17. vllm_optimizer-0.1.0a11/src/vllm_optimizer/config/loader.py +145 -0
  18. vllm_optimizer-0.1.0a11/src/vllm_optimizer/config/models.py +31 -0
  19. vllm_optimizer-0.1.0a11/src/vllm_optimizer/config/preflight.py +95 -0
  20. vllm_optimizer-0.1.0a11/src/vllm_optimizer/config/runtime.py +69 -0
  21. vllm_optimizer-0.1.0a11/src/vllm_optimizer/domain/__init__.py +25 -0
  22. vllm_optimizer-0.1.0a11/src/vllm_optimizer/domain/attempt_report.py +18 -0
  23. vllm_optimizer-0.1.0a11/src/vllm_optimizer/domain/benchmark.py +52 -0
  24. vllm_optimizer-0.1.0a11/src/vllm_optimizer/domain/models.py +69 -0
  25. vllm_optimizer-0.1.0a11/src/vllm_optimizer/domain/results.py +59 -0
  26. vllm_optimizer-0.1.0a11/src/vllm_optimizer/domain/states.py +31 -0
  27. vllm_optimizer-0.1.0a11/src/vllm_optimizer/domain/trial_report.py +73 -0
  28. vllm_optimizer-0.1.0a11/src/vllm_optimizer/execution/__init__.py +10 -0
  29. vllm_optimizer-0.1.0a11/src/vllm_optimizer/execution/finalist_validation.py +46 -0
  30. vllm_optimizer-0.1.0a11/src/vllm_optimizer/execution/scheduler.py +93 -0
  31. vllm_optimizer-0.1.0a11/src/vllm_optimizer/execution/slots.py +118 -0
  32. vllm_optimizer-0.1.0a11/src/vllm_optimizer/execution/trial_executor.py +97 -0
  33. vllm_optimizer-0.1.0a11/src/vllm_optimizer/lifecycle/__init__.py +5 -0
  34. vllm_optimizer-0.1.0a11/src/vllm_optimizer/lifecycle/integrity.py +102 -0
  35. vllm_optimizer-0.1.0a11/src/vllm_optimizer/lifecycle/retry.py +105 -0
  36. vllm_optimizer-0.1.0a11/src/vllm_optimizer/managers/__init__.py +9 -0
  37. vllm_optimizer-0.1.0a11/src/vllm_optimizer/managers/results.py +68 -0
  38. vllm_optimizer-0.1.0a11/src/vllm_optimizer/managers/run_results.py +143 -0
  39. vllm_optimizer-0.1.0a11/src/vllm_optimizer/managers/run_session.py +90 -0
  40. vllm_optimizer-0.1.0a11/src/vllm_optimizer/managers/scoring.py +123 -0
  41. vllm_optimizer-0.1.0a11/src/vllm_optimizer/managers/trial.py +106 -0
  42. vllm_optimizer-0.1.0a11/src/vllm_optimizer/measurement.py +78 -0
  43. vllm_optimizer-0.1.0a11/src/vllm_optimizer/orchestrator.py +199 -0
  44. vllm_optimizer-0.1.0a11/src/vllm_optimizer/py.typed +1 -0
  45. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/__init__.py +6 -0
  46. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/analysis.py +149 -0
  47. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/benchmark_details.py +59 -0
  48. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/charts.py +97 -0
  49. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/context.py +23 -0
  50. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/dashboard.py +140 -0
  51. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/importance.py +23 -0
  52. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/llm_summary.py +123 -0
  53. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/measurement.py +67 -0
  54. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/methodology.py +16 -0
  55. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/offline.py +179 -0
  56. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/reporter.py +67 -0
  57. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/styles.py +11 -0
  58. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/tables.py +122 -0
  59. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reporting/validation.py +58 -0
  60. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reproduction/__init__.py +1 -0
  61. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reproduction/display.py +63 -0
  62. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reproduction/export.py +13 -0
  63. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reproduction/manifest.py +77 -0
  64. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reproduction/metadata.py +66 -0
  65. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reproduction/models.py +36 -0
  66. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reproduction/reader.py +48 -0
  67. vllm_optimizer-0.1.0a11/src/vllm_optimizer/reproduction/redaction.py +40 -0
  68. vllm_optimizer-0.1.0a11/src/vllm_optimizer/search/__init__.py +8 -0
  69. vllm_optimizer-0.1.0a11/src/vllm_optimizer/search/factory.py +44 -0
  70. vllm_optimizer-0.1.0a11/src/vllm_optimizer/search/fixed_session.py +26 -0
  71. vllm_optimizer-0.1.0a11/src/vllm_optimizer/search/grid.py +65 -0
  72. vllm_optimizer-0.1.0a11/src/vllm_optimizer/search/grid_session.py +29 -0
  73. vllm_optimizer-0.1.0a11/src/vllm_optimizer/search/optuna_session.py +121 -0
  74. vllm_optimizer-0.1.0a11/src/vllm_optimizer/search/strategy.py +18 -0
  75. vllm_optimizer-0.1.0a11/src/vllm_optimizer/terminal.py +140 -0
  76. vllm_optimizer-0.1.0a11/src/vllm_optimizer/terminal_style.py +30 -0
  77. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/__init__.py +23 -0
  78. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/attempts.py +15 -0
  79. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/base.py +33 -0
  80. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/benchmark.py +140 -0
  81. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/completion.py +96 -0
  82. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/configuration.py +115 -0
  83. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/drain.py +139 -0
  84. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/factory.py +75 -0
  85. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/failure_details.py +50 -0
  86. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/process.py +147 -0
  87. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/readiness.py +119 -0
  88. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/vllm.py +73 -0
  89. vllm_optimizer-0.1.0a11/src/vllm_optimizer/workers/vllm_benchmark.py +127 -0
  90. vllm_optimizer-0.1.0a11/src/vllm_optimizer.egg-info/PKG-INFO +224 -0
  91. vllm_optimizer-0.1.0a11/src/vllm_optimizer.egg-info/SOURCES.txt +102 -0
  92. vllm_optimizer-0.1.0a11/src/vllm_optimizer.egg-info/dependency_links.txt +1 -0
  93. vllm_optimizer-0.1.0a11/src/vllm_optimizer.egg-info/entry_points.txt +3 -0
  94. vllm_optimizer-0.1.0a11/src/vllm_optimizer.egg-info/requires.txt +9 -0
  95. vllm_optimizer-0.1.0a11/src/vllm_optimizer.egg-info/top_level.txt +2 -0
  96. vllm_optimizer-0.1.0a11/src/vtune/__init__.py +11 -0
  97. vllm_optimizer-0.1.0a11/tests/test_brand_compatibility.py +27 -0
  98. vllm_optimizer-0.1.0a11/tests/test_commands.py +39 -0
  99. vllm_optimizer-0.1.0a11/tests/test_configuration.py +58 -0
  100. vllm_optimizer-0.1.0a11/tests/test_drain.py +56 -0
  101. vllm_optimizer-0.1.0a11/tests/test_finalist_validation.py +40 -0
  102. vllm_optimizer-0.1.0a11/tests/test_reporting.py +31 -0
  103. vllm_optimizer-0.1.0a11/tests/test_results_and_scoring.py +137 -0
  104. vllm_optimizer-0.1.0a11/tests/test_vllm_completion.py +50 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 vLLM Optimizer contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,224 @@
1
+ Metadata-Version: 2.4
2
+ Name: vllm-optimizer
3
+ Version: 0.1.0a11
4
+ Summary: Benchmark-driven configuration optimization for vLLM inference servers
5
+ License-Expression: MIT
6
+ Project-URL: Repository, https://github.com/brtydse100/vllm-optimizer
7
+ Project-URL: Issues, https://github.com/brtydse100/vllm-optimizer/issues
8
+ Keywords: vllm,ai,llm,guidellm,benchmark,optimization,inference
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Typing :: Typed
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: Optuna<5,>=4.0
20
+ Requires-Dist: PyYAML>=6.0
21
+ Provides-Extra: runtime
22
+ Requires-Dist: vllm<0.29,>=0.28; extra == "runtime"
23
+ Requires-Dist: guidellm<0.8,>=0.7.3; extra == "runtime"
24
+ Provides-Extra: test
25
+ Requires-Dist: pytest<9,>=8; extra == "test"
26
+ Dynamic: license-file
27
+
28
+ # vLLM Optimizer
29
+
30
+ vLLM Optimizer is a local-first benchmarking and optimization tool for vLLM
31
+ serving configurations. Users define the parameters and workloads they care
32
+ about; the `vllm-opt` CLI manages the server lifecycle, runs repeatable benchmarks,
33
+ explores the search space, and reports which configurations performed best.
34
+
35
+ vLLM Optimizer is alpha software targeting Linux with NVIDIA GPUs and
36
+ Python 3.11–3.12. Install `vllm-optimizer`, import `vllm_optimizer`, and run
37
+ `vllm-opt`. The former `vtune` aliases remain available for one release cycle.
38
+
39
+ This independent community project is not affiliated with the vLLM project.
40
+
41
+ **[Documentation](https://brtydse100.github.io/vllm-optimizer/)** ·
42
+ **[Quick start](https://brtydse100.github.io/vllm-optimizer/getting-started/)** ·
43
+ **[PyPI](https://pypi.org/project/vllm-optimizer/)**
44
+
45
+ The current code is verified with vLLM 0.28.0 and GuideLLM 0.7.3 on WSL2
46
+ with an RTX 3080. That host required
47
+ `VLLM_USE_V2_MODEL_RUNNER: "0"` because UVA was unavailable and
48
+ `VLLM_USE_FLASHINFER_SAMPLER: "0"` because the CUDA compiler toolkit was
49
+ not installed. Native Linux systems may not require these settings.
50
+
51
+ Other combinations may work but are not yet verified.
52
+
53
+ Each new trial stores a typed `execution` assignment in its trial result and
54
+ manifest. a5/a6 runs may lack it. Reports show only statistics supplied by the
55
+ benchmark backend; a7 offline regeneration corrects derived a6 summaries in a
56
+ new destination without changing the source run.
57
+
58
+ The published `py3-none-any` wheel installs on Linux and Windows. Configuration
59
+ validation and stored-result inspection work on Windows, but starting an
60
+ experiment is supported only on Linux because vLLM has no native Windows
61
+ runtime.
62
+
63
+ ## Installation
64
+
65
+ Choose the installation that matches what you want to do:
66
+
67
+ | Goal | Command | Platform |
68
+ | --- | --- | --- |
69
+ | Run complete experiments | `pip install "vllm-optimizer[runtime]"` | Linux/WSL with NVIDIA GPU |
70
+ | Read configs, results, and reports | `pip install vllm-optimizer` | Linux, Windows, or macOS |
71
+
72
+ The core package intentionally does not install GPU frameworks. The `runtime`
73
+ extra adds vLLM and GuideLLM, which select large PyTorch/CUDA dependencies for
74
+ the machine. See the [installation guide](https://brtydse100.github.io/vllm-optimizer/installation/)
75
+ for virtual environments, CUDA guidance, and verification commands.
76
+
77
+ ## Quick start
78
+
79
+ Create and activate a Python 3.11 or 3.12 virtual environment on Linux or WSL,
80
+ then install the complete experiment runtime:
81
+
82
+ ```bash
83
+ python3 -m venv .venv
84
+ source .venv/bin/activate
85
+ python -m pip install "vllm-optimizer[runtime]"
86
+ vllm --help
87
+ guidellm --help
88
+ ```
89
+
90
+ Create `experiment.yaml`:
91
+
92
+ ```yaml
93
+ experiment:
94
+ name: first-run
95
+ server:
96
+ model: /models/opt-125m
97
+ gpu-memory-utilization: 0.8
98
+ tune:
99
+ max-num-seqs:
100
+ values: [8, 16]
101
+ benchmark:
102
+ engine: guidellm # Default. Use vllm for `vllm bench serve`.
103
+ runs:
104
+ - name: throughput
105
+ profile:
106
+ kind: throughput
107
+ max_concurrency: 16
108
+ constraints:
109
+ - kind: max_requests
110
+ count: 10
111
+ data:
112
+ - kind: synthetic_text
113
+ prompt_tokens: 32
114
+ output_tokens: 16
115
+ optimization:
116
+ maximize: output_tokens_per_second
117
+ sampler: tpe
118
+ trials: 2
119
+ timeouts:
120
+ benchmark: 20m
121
+ ```
122
+
123
+ Run it:
124
+
125
+ ```bash
126
+ vllm-opt --config experiment.yaml
127
+ ```
128
+
129
+ The short form is `vllm-opt -c experiment.yaml`. The command validates the file,
130
+ runs the experiment, persists results, and generates its exports and report.
131
+ The `vllm-opt` CLI binds vLLM to `127.0.0.1` by default. Set `server.host` explicitly
132
+ only when the benchmark server must be reachable from another host.
133
+
134
+ Fixed vLLM flags go directly under `server`; tunable flags use top-level
135
+ `tune`. Fixed and tunable environment variables use `env` and `tune_env`.
136
+ See the [configuration guide](https://brtydse100.github.io/vllm-optimizer/configuration/)
137
+ for categorical, boolean, integer-range, float-range, list, and environment
138
+ examples. The [complete YAML](https://brtydse100.github.io/vllm-optimizer/full-example/)
139
+ and [benchmark guide](https://brtydse100.github.io/vllm-optimizer/benchmarking/) show
140
+ every supported control with copyable examples.
141
+
142
+ To use vLLM's native benchmark, set `benchmark.engine: vllm`. Its `args`
143
+ map directly to `vllm bench serve` flags; the `vllm-opt` CLI supplies the model, server
144
+ address, and JSON output path:
145
+
146
+ ```yaml
147
+ benchmark:
148
+ engine: vllm
149
+ runs:
150
+ - name: throughput
151
+ args:
152
+ dataset-name: random
153
+ random-input-len: 32
154
+ random-output-len: 16
155
+ num-prompts: 100
156
+ request-rate: inf
157
+ max-concurrency: 16
158
+ ```
159
+
160
+ Interactive terminal output uses color and remains concise by default. Set the
161
+ standard `NO_COLOR` environment variable to disable color. To stream server and
162
+ benchmark logs:
163
+
164
+ ```bash
165
+ vllm-opt --config experiment.yaml --verbose
166
+ ```
167
+
168
+ The persistent equivalent uses GuideLLM's logging level names:
169
+
170
+ ```yaml
171
+ logging:
172
+ level: DEBUG
173
+ ```
174
+
175
+ Supported levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL`.
176
+ Full per-trial log files are always saved. `--verbose` overrides the configured
177
+ level with `DEBUG` for that invocation.
178
+
179
+ Retry one or more selected trials into a new immutable linked run:
180
+
181
+ ```bash
182
+ vllm-opt retry --run runs/EXPERIMENT/RUN_ID \
183
+ --trial trial-0001 --trial trial-0004
184
+ ```
185
+
186
+ The source run is never modified.
187
+
188
+ Display every stored vLLM and GuideLLM command for a trial without executing
189
+ anything:
190
+
191
+ ```bash
192
+ vllm-opt reproduce --run runs/EXPERIMENT/RUN_ID --trial trial-0001
193
+ ```
194
+
195
+ Each completed run also contains a self-contained `report.html` decision
196
+ dashboard with the best observed configuration, per-benchmark elapsed time,
197
+ average/median/P99 latency, baseline comparison, score history,
198
+ throughput/latency tradeoff, metric definitions, and observed parameter effects.
199
+
200
+ Random and TPE runs never execute the same resolved configuration twice. If
201
+ `optimization.trials` exceeds the unique search space, the `vllm-opt` CLI warns and runs
202
+ every unique configuration once.
203
+
204
+ Multiple independent trials can run on explicitly assigned, non-overlapping
205
+ GPU sets and ports. A sequential or tensor-parallel server receives port 8000
206
+ unless `server.port` overrides it; local-parallel trials use their configured
207
+ port range. Sequential execution remains the default. See
208
+ [parallel trials](https://brtydse100.github.io/vllm-optimizer/parallel-trials/) for the
209
+ YAML and measurement caveats.
210
+
211
+ ## Product documents
212
+
213
+ - [First MVP specification](docs/MVP_SPEC.md)
214
+ - [Future implementation roadmap](docs/ROADMAP.md)
215
+ - [Architecture overview and early sketch](docs/ARCHITECTURE.md)
216
+ - [Editable Draw.io architecture diagram](docs/vllm-optimizer-architecture.drawio)
217
+ - [Contributor guide](CONTRIBUTING.md)
218
+ - [Release notes](CHANGELOG.md)
219
+
220
+ The MVP specification defines the first releasable version and its acceptance
221
+ criteria. The roadmap describes capabilities that should be designed for now
222
+ but implemented after the core experiment loop is reliable.
223
+
224
+ vLLM Optimizer is available under the [MIT License](LICENSE).
@@ -0,0 +1,197 @@
1
+ # vLLM Optimizer
2
+
3
+ vLLM Optimizer is a local-first benchmarking and optimization tool for vLLM
4
+ serving configurations. Users define the parameters and workloads they care
5
+ about; the `vllm-opt` CLI manages the server lifecycle, runs repeatable benchmarks,
6
+ explores the search space, and reports which configurations performed best.
7
+
8
+ vLLM Optimizer is alpha software targeting Linux with NVIDIA GPUs and
9
+ Python 3.11–3.12. Install `vllm-optimizer`, import `vllm_optimizer`, and run
10
+ `vllm-opt`. The former `vtune` aliases remain available for one release cycle.
11
+
12
+ This independent community project is not affiliated with the vLLM project.
13
+
14
+ **[Documentation](https://brtydse100.github.io/vllm-optimizer/)** ·
15
+ **[Quick start](https://brtydse100.github.io/vllm-optimizer/getting-started/)** ·
16
+ **[PyPI](https://pypi.org/project/vllm-optimizer/)**
17
+
18
+ The current code is verified with vLLM 0.28.0 and GuideLLM 0.7.3 on WSL2
19
+ with an RTX 3080. That host required
20
+ `VLLM_USE_V2_MODEL_RUNNER: "0"` because UVA was unavailable and
21
+ `VLLM_USE_FLASHINFER_SAMPLER: "0"` because the CUDA compiler toolkit was
22
+ not installed. Native Linux systems may not require these settings.
23
+
24
+ Other combinations may work but are not yet verified.
25
+
26
+ Each new trial stores a typed `execution` assignment in its trial result and
27
+ manifest. a5/a6 runs may lack it. Reports show only statistics supplied by the
28
+ benchmark backend; a7 offline regeneration corrects derived a6 summaries in a
29
+ new destination without changing the source run.
30
+
31
+ The published `py3-none-any` wheel installs on Linux and Windows. Configuration
32
+ validation and stored-result inspection work on Windows, but starting an
33
+ experiment is supported only on Linux because vLLM has no native Windows
34
+ runtime.
35
+
36
+ ## Installation
37
+
38
+ Choose the installation that matches what you want to do:
39
+
40
+ | Goal | Command | Platform |
41
+ | --- | --- | --- |
42
+ | Run complete experiments | `pip install "vllm-optimizer[runtime]"` | Linux/WSL with NVIDIA GPU |
43
+ | Read configs, results, and reports | `pip install vllm-optimizer` | Linux, Windows, or macOS |
44
+
45
+ The core package intentionally does not install GPU frameworks. The `runtime`
46
+ extra adds vLLM and GuideLLM, which select large PyTorch/CUDA dependencies for
47
+ the machine. See the [installation guide](https://brtydse100.github.io/vllm-optimizer/installation/)
48
+ for virtual environments, CUDA guidance, and verification commands.
49
+
50
+ ## Quick start
51
+
52
+ Create and activate a Python 3.11 or 3.12 virtual environment on Linux or WSL,
53
+ then install the complete experiment runtime:
54
+
55
+ ```bash
56
+ python3 -m venv .venv
57
+ source .venv/bin/activate
58
+ python -m pip install "vllm-optimizer[runtime]"
59
+ vllm --help
60
+ guidellm --help
61
+ ```
62
+
63
+ Create `experiment.yaml`:
64
+
65
+ ```yaml
66
+ experiment:
67
+ name: first-run
68
+ server:
69
+ model: /models/opt-125m
70
+ gpu-memory-utilization: 0.8
71
+ tune:
72
+ max-num-seqs:
73
+ values: [8, 16]
74
+ benchmark:
75
+ engine: guidellm # Default. Use vllm for `vllm bench serve`.
76
+ runs:
77
+ - name: throughput
78
+ profile:
79
+ kind: throughput
80
+ max_concurrency: 16
81
+ constraints:
82
+ - kind: max_requests
83
+ count: 10
84
+ data:
85
+ - kind: synthetic_text
86
+ prompt_tokens: 32
87
+ output_tokens: 16
88
+ optimization:
89
+ maximize: output_tokens_per_second
90
+ sampler: tpe
91
+ trials: 2
92
+ timeouts:
93
+ benchmark: 20m
94
+ ```
95
+
96
+ Run it:
97
+
98
+ ```bash
99
+ vllm-opt --config experiment.yaml
100
+ ```
101
+
102
+ The short form is `vllm-opt -c experiment.yaml`. The command validates the file,
103
+ runs the experiment, persists results, and generates its exports and report.
104
+ The `vllm-opt` CLI binds vLLM to `127.0.0.1` by default. Set `server.host` explicitly
105
+ only when the benchmark server must be reachable from another host.
106
+
107
+ Fixed vLLM flags go directly under `server`; tunable flags use top-level
108
+ `tune`. Fixed and tunable environment variables use `env` and `tune_env`.
109
+ See the [configuration guide](https://brtydse100.github.io/vllm-optimizer/configuration/)
110
+ for categorical, boolean, integer-range, float-range, list, and environment
111
+ examples. The [complete YAML](https://brtydse100.github.io/vllm-optimizer/full-example/)
112
+ and [benchmark guide](https://brtydse100.github.io/vllm-optimizer/benchmarking/) show
113
+ every supported control with copyable examples.
114
+
115
+ To use vLLM's native benchmark, set `benchmark.engine: vllm`. Its `args`
116
+ map directly to `vllm bench serve` flags; the `vllm-opt` CLI supplies the model, server
117
+ address, and JSON output path:
118
+
119
+ ```yaml
120
+ benchmark:
121
+ engine: vllm
122
+ runs:
123
+ - name: throughput
124
+ args:
125
+ dataset-name: random
126
+ random-input-len: 32
127
+ random-output-len: 16
128
+ num-prompts: 100
129
+ request-rate: inf
130
+ max-concurrency: 16
131
+ ```
132
+
133
+ Interactive terminal output uses color and remains concise by default. Set the
134
+ standard `NO_COLOR` environment variable to disable color. To stream server and
135
+ benchmark logs:
136
+
137
+ ```bash
138
+ vllm-opt --config experiment.yaml --verbose
139
+ ```
140
+
141
+ The persistent equivalent uses GuideLLM's logging level names:
142
+
143
+ ```yaml
144
+ logging:
145
+ level: DEBUG
146
+ ```
147
+
148
+ Supported levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL`.
149
+ Full per-trial log files are always saved. `--verbose` overrides the configured
150
+ level with `DEBUG` for that invocation.
151
+
152
+ Retry one or more selected trials into a new immutable linked run:
153
+
154
+ ```bash
155
+ vllm-opt retry --run runs/EXPERIMENT/RUN_ID \
156
+ --trial trial-0001 --trial trial-0004
157
+ ```
158
+
159
+ The source run is never modified.
160
+
161
+ Display every stored vLLM and GuideLLM command for a trial without executing
162
+ anything:
163
+
164
+ ```bash
165
+ vllm-opt reproduce --run runs/EXPERIMENT/RUN_ID --trial trial-0001
166
+ ```
167
+
168
+ Each completed run also contains a self-contained `report.html` decision
169
+ dashboard with the best observed configuration, per-benchmark elapsed time,
170
+ average/median/P99 latency, baseline comparison, score history,
171
+ throughput/latency tradeoff, metric definitions, and observed parameter effects.
172
+
173
+ Random and TPE runs never execute the same resolved configuration twice. If
174
+ `optimization.trials` exceeds the unique search space, the `vllm-opt` CLI warns and runs
175
+ every unique configuration once.
176
+
177
+ Multiple independent trials can run on explicitly assigned, non-overlapping
178
+ GPU sets and ports. A sequential or tensor-parallel server receives port 8000
179
+ unless `server.port` overrides it; local-parallel trials use their configured
180
+ port range. Sequential execution remains the default. See
181
+ [parallel trials](https://brtydse100.github.io/vllm-optimizer/parallel-trials/) for the
182
+ YAML and measurement caveats.
183
+
184
+ ## Product documents
185
+
186
+ - [First MVP specification](docs/MVP_SPEC.md)
187
+ - [Future implementation roadmap](docs/ROADMAP.md)
188
+ - [Architecture overview and early sketch](docs/ARCHITECTURE.md)
189
+ - [Editable Draw.io architecture diagram](docs/vllm-optimizer-architecture.drawio)
190
+ - [Contributor guide](CONTRIBUTING.md)
191
+ - [Release notes](CHANGELOG.md)
192
+
193
+ The MVP specification defines the first releasable version and its acceptance
194
+ criteria. The roadmap describes capabilities that should be designed for now
195
+ but implemented after the core experiment loop is reliable.
196
+
197
+ vLLM Optimizer is available under the [MIT License](LICENSE).
@@ -0,0 +1,38 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "vllm-optimizer"
7
+ version = "0.1.0a11"
8
+ description = "Benchmark-driven configuration optimization for vLLM inference servers"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ keywords = ["vllm", "ai", "llm", "guidellm", "benchmark", "optimization", "inference"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Environment :: Console",
17
+ "Operating System :: POSIX :: Linux",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Typing :: Typed",
22
+ ]
23
+ dependencies = ["Optuna>=4.0,<5", "PyYAML>=6.0"]
24
+
25
+ [project.optional-dependencies]
26
+ runtime = ["vllm>=0.28,<0.29", "guidellm>=0.7.3,<0.8"]
27
+ test = ["pytest>=8,<9"]
28
+
29
+ [project.urls]
30
+ Repository = "https://github.com/brtydse100/vllm-optimizer"
31
+ Issues = "https://github.com/brtydse100/vllm-optimizer/issues"
32
+
33
+ [project.scripts]
34
+ vllm-opt = "vllm_optimizer.cli:main"
35
+ vtune = "vllm_optimizer.cli:legacy_main"
36
+
37
+ [tool.setuptools.packages.find]
38
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,7 @@
1
+ """vLLM Optimizer package."""
2
+
3
+ __version__ = "0.1.0a11"
4
+
5
+ from .orchestrator import Orchestrator, RunOutcome
6
+
7
+ __all__ = ["Orchestrator", "RunOutcome"]
@@ -0,0 +1,13 @@
1
+ """Benchmark backend adapters."""
2
+
3
+ from .configuration import (
4
+ configured_engine, configured_min_repeats, configured_repeats,
5
+ configured_runs, configured_warmup_repeats,
6
+ )
7
+ from .guidellm import GuideLLMPlan, build_plan, parse_result
8
+
9
+ __all__ = [
10
+ "GuideLLMPlan", "build_plan", "configured_engine", "configured_min_repeats",
11
+ "configured_repeats", "configured_runs", "configured_warmup_repeats",
12
+ "parse_result",
13
+ ]
@@ -0,0 +1,84 @@
1
+ """Shared benchmark configuration validation."""
2
+
3
+ from collections.abc import Mapping
4
+ import re
5
+
6
+ from vllm_optimizer.config.models import VTuneConfig
7
+
8
+ _RUN_NAME = re.compile(r"^[A-Za-z0-9][A-Za-z0-9_-]*$")
9
+ _ENGINES = {"guidellm", "vllm"}
10
+
11
+
12
+ def configured_engine(config: VTuneConfig) -> str:
13
+ value = config.benchmark.get("engine", "guidellm")
14
+ if not isinstance(value, str) or value not in _ENGINES:
15
+ raise ValueError("benchmark.engine must be 'guidellm' or 'vllm'")
16
+ return value
17
+
18
+
19
+ def configured_repeats(config: VTuneConfig) -> int:
20
+ value = config.benchmark.get("repeats", 1)
21
+ if isinstance(value, bool) or not isinstance(value, int) or value < 1:
22
+ raise ValueError("benchmark.repeats must be a positive integer")
23
+ return value
24
+
25
+
26
+ def configured_warmup_repeats(config: VTuneConfig) -> int:
27
+ value = config.benchmark.get("warmup_repeats", 0)
28
+ if isinstance(value, bool) or not isinstance(value, int) or value < 0:
29
+ raise ValueError("benchmark.warmup_repeats must be a non-negative integer")
30
+ return value
31
+
32
+
33
+ def configured_min_repeats(config: VTuneConfig) -> int:
34
+ value = config.benchmark.get("min_repeats", 1)
35
+ if isinstance(value, bool) or not isinstance(value, int) or value < 1:
36
+ raise ValueError("benchmark.min_repeats must be a positive integer")
37
+ if value > configured_repeats(config):
38
+ raise ValueError("benchmark.min_repeats cannot exceed benchmark.repeats")
39
+ return value
40
+
41
+
42
+ def configured_runs(config: VTuneConfig) -> tuple[Mapping[str, object], ...]:
43
+ unknown = set(config.benchmark) - {
44
+ "engine", "runs", "repeats", "warmup_repeats", "min_repeats",
45
+ }
46
+ if unknown:
47
+ raise ValueError(f"Unsupported benchmark setting(s): {', '.join(sorted(unknown))}")
48
+ values = config.benchmark.get("runs")
49
+ if not isinstance(values, list) or not values:
50
+ raise ValueError("'benchmark.runs' must be a non-empty list")
51
+ engine, names = configured_engine(config), set()
52
+ runs: list[Mapping[str, object]] = []
53
+ for index, value in enumerate(values):
54
+ run = _mapping(value, f"run {index}")
55
+ name = run.get("name")
56
+ if not isinstance(name, str) or not _RUN_NAME.fullmatch(name):
57
+ raise ValueError("benchmark run names must use letters, numbers, '_' or '-'")
58
+ if name in names:
59
+ raise ValueError(f"duplicate benchmark run name: {name}")
60
+ names.add(name)
61
+ _validate_run(engine, run, index, name)
62
+ runs.append(run)
63
+ return tuple(runs)
64
+
65
+
66
+ def _validate_run(engine: str, run: Mapping[str, object], index: int, name: str) -> None:
67
+ allowed = ({"name", "request_format", "profile", "constraints", "data"}
68
+ if engine == "guidellm" else {"name", "args"})
69
+ if unknown := set(run) - allowed:
70
+ raise ValueError(
71
+ f"Unsupported setting(s) in benchmark run {index}: {', '.join(sorted(unknown))}"
72
+ )
73
+ if engine == "guidellm":
74
+ data = run.get("data")
75
+ if not isinstance(data, list) or len(data) != 1:
76
+ raise ValueError(f"benchmark run '{name}' must configure exactly one dataset")
77
+ else:
78
+ _mapping(run.get("args", {}), f"vllm benchmark run '{name}' args")
79
+
80
+
81
+ def _mapping(value: object, label: str) -> Mapping[str, object]:
82
+ if not isinstance(value, dict) or any(not isinstance(key, str) for key in value):
83
+ raise ValueError(f"{label} must be an object")
84
+ return value