You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(backend): Add custom header and SSL verification support
This commit enhances the OpenAIHTTPBackend to allow for more flexible
configuration via the `--backend-args` CLI option and environment
variables.
Key changes include:
- Support for passing custom request headers. Headers are merged from the
CLI, scenario files, and environment variables, with the CLI taking
highest precedence.
- Headers can be removed by setting their value to `null` in the
`--backend-args` JSON string.
- The `verify` flag for disabling SSL certificate verification is now
correctly handled.
- New documentation for the CLI, configuration, and data formats.
- New unit tests for the backend logic and CLI argument parsing.
Signed-off-by: Elijah DeLee <[email protected]>
This page provides a reference for the `guidellm` command-line interface. For more advanced configuration, including environment variables and `.env` files, see the [Configuration Guide](./configuration.md).
4
+
5
+
## `guidellm benchmark run`
6
+
7
+
This command is the primary entrypoint for running benchmarks. It has many options that can be specified on the command line or in a scenario file.
|`--scenario <PATH or NAME>`| The name of a builtin scenario or path to a scenario configuration file. Options specified on the command line will override the scenario file. |
14
+
15
+
### Target and Backend Configuration
16
+
17
+
These options configure how `guidellm` connects to the system under test.
|`--target <URL>`|**Required.** The endpoint of the target system, e.g., `http://localhost:8080`. Can also be set with the `GUIDELLM__OPENAI__BASE_URL` environment variable. |
22
+
|`--backend-type <TYPE>`| The type of backend to use. Defaults to `openai_http`. |
23
+
|`--backend-args <JSON>`| A JSON string for backend-specific arguments. For example: `--backend-args '{"headers": {"Authorization": "Bearer my-token"}, "verify": false}'` to pass custom headers and disable certificate verification. |
24
+
|`--model <NAME>`| The ID of the model to benchmark within the backend. |
25
+
26
+
### Data and Request Configuration
27
+
28
+
These options define the data to be used for benchmarking and how requests will be generated.
|`--data <SOURCE>`| The data source. This can be a HuggingFace dataset ID, a path to a local data file, or a synthetic data configuration. See the [Data Formats Guide](./data_formats.md) for more details. |
33
+
|`--rate-type <TYPE>`| The type of request generation strategy to use (e.g., `constant`, `poisson`, `sweep`). |
34
+
|`--rate <NUMBER>`| The rate of requests per second for `constant` or `poisson` strategies, or the number of steps for a `sweep`. |
35
+
|`--max-requests <NUMBER>`| The maximum number of requests to run for each benchmark. |
36
+
|`--max-seconds <NUMBER>`| The maximum number of seconds to run each benchmark for. |
The `guidellm` application can be configured using command-line arguments, environment variables, or a `.env` file. This page details the file-based and environment variable configuration options.
4
+
5
+
## Configuration Methods
6
+
7
+
Settings are loaded with the following priority (highest priority first):
8
+
9
+
1. Command-line arguments.
10
+
2. Environment variables.
11
+
3. Values in a `.env` file in the directory where the command is run.
12
+
4. Default values.
13
+
14
+
## Environment Variable Format
15
+
16
+
All settings can be configured using environment variables. The variables must be prefixed with `GUIDELLM__`, and nested settings are separated by a double underscore `__`.
17
+
18
+
For example, to set the `api_key` for the `openai` backend, you would use the following environment variable:
19
+
20
+
```bash
21
+
export GUIDELLM__OPENAI__API_KEY="your-api-key"
22
+
```
23
+
24
+
### Target and Backend Configuration
25
+
26
+
You can configure the connection to the target system using environment variables. This is an alternative to using the `--target-*` command-line flags.
|`GUIDELLM__OPENAI__BASE_URL`| The endpoint of the target system. Equivalent to the `--target` CLI option. |`export GUIDELLM__OPENAI__BASE_URL="http://localhost:8080"`|
31
+
|`GUIDELLM__OPENAI__API_KEY`| The API key to use for bearer token authentication. |`export GUIDELLM__OPENAI__API_KEY="your-secret-api-key"`|
32
+
|`GUIDELLM__OPENAI__BEARER_TOKEN`| The full bearer token to use for authentication. |`export GUIDELLM__OPENAI__BEARER_TOKEN="Bearer your-secret-token"`|
33
+
|`GUIDELLM__OPENAI__HEADERS`| A JSON string representing a dictionary of headers to send to the target. These headers will override any default headers. |`export GUIDELLM__OPENAI__HEADERS='{"Authorization": "Bearer my-token"}'`|
34
+
|`GUIDELLM__OPENAI__ORGANIZATION`| The OpenAI organization to use for requests. |`export GUIDELLM__OPENAI__ORGANIZATION="org-12345"`|
35
+
|`GUIDELLM__OPENAI__PROJECT`| The OpenAI project to use for requests. |`export GUIDELLM__OPENAI__PROJECT="proj-67890"`|
36
+
|`GUIDELLM__OPENAI__VERIFY`| Set to `false` or `0` to disable certificate verification. |`export GUIDELLM__OPENAI__VERIFY=false`|
37
+
|`GUIDELLM__OPENAI__MAX_OUTPUT_TOKENS`| The default maximum number of tokens to request for completions. |`export GUIDELLM__OPENAI__MAX_OUTPUT_TOKENS=2048`|
38
+
39
+
### General HTTP Settings
40
+
41
+
These settings control the behavior of the underlying HTTP client.
The `--data` argument for the `guidellm benchmark run` command accepts several different formats for specifying the data to be used for benchmarking.
4
+
5
+
## Local Data Files
6
+
7
+
You can provide a path to a local data file in one of the following formats:
8
+
9
+
-**CSV (.csv)**: A comma-separated values file. The loader will attempt to find a column with a common name for the prompt (e.g., `prompt`, `text`, `instruction`).
10
+
-**JSON (.json)**: A JSON file. The structure should be a list of objects, where each object represents a row of data.
11
+
-**JSON Lines (.jsonl)**: A file where each line is a valid JSON object.
12
+
-**Text (.txt)**: A plain text file, where each line is treated as a separate prompt.
13
+
14
+
If the prompt column cannot be automatically determined, you can specify it using the `--data-args` option:
0 commit comments