From d79dad5899f0214e48bd70208b8196f1b8db8362 Mon Sep 17 00:00:00 2001 From: Contributor Date: Thu, 19 Mar 2026 13:41:07 +0000 Subject: [PATCH] openai_http: document extras in BackendArgs and CLI help for backend_kwargs - Add optional extras field to OpenAIHttpBackendArgs with description for merging request body fields (e.g. temperature, top_p) via backend_kwargs. - Update --backend-kwargs help to mention extras.body example for sampling params. - Backend already supported extras; this improves discoverability and schema docs. Made-with: Cursor --- src/guidellm/__main__.py | 3 ++- src/guidellm/backends/openai/http.py | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/guidellm/__main__.py b/src/guidellm/__main__.py index 85b7cfc0c..1c08a6128 100644 --- a/src/guidellm/__main__.py +++ b/src/guidellm/__main__.py @@ -175,7 +175,8 @@ def benchmark(): default=BenchmarkGenerativeTextArgs.get_default("backend_kwargs"), help=( "JSON string of arguments to pass to the backend. E.g., " - '\'{"api_key": "apikey-*", "verify": false}\'' + '\'{"api_key": "apikey-*", "verify": false}\' or ' + '\'{"extras": {"body": {"temperature": 0.6, "top_p": 0.95}}}\' for sampling params.' ), ) @click.option( diff --git a/src/guidellm/backends/openai/http.py b/src/guidellm/backends/openai/http.py index 9e33f54af..ded568215 100644 --- a/src/guidellm/backends/openai/http.py +++ b/src/guidellm/backends/openai/http.py @@ -74,6 +74,13 @@ class OpenAIHttpBackendArgs(BackendArgs): ) }, ) + extras: dict[str, Any] | None = Field( + default=None, + description=( + "Optional request arguments to merge into each request (e.g. body fields). " + 'Use {"body": {"temperature": 0.6, "top_p": 0.95}} to set sampling params.' + ), + ) @field_validator("request_format") @classmethod