[Frontend] Add omni benchmark support for image and video endpoints (#4728)

This commit is contained in:
ZacheryAU authored and GitHub committed 2026-09-08 09:28:21 +08:00
1 parent e1c59edec6
commit b1ec136bd7
21 files changed
+1626 -72

No files matched your search

+32
View File
@@ -23,6 +23,37 @@ from vllm_omni.benchmarks.patch.patch import (
should_request_stage_metrics,
)
_ENDPOINT_BACKEND_KEYS = {
"/v1/images/generations",
"/v1/images/edits",
"/v1/videos",
}
def _normalize_endpoint(endpoint: str | None) -> str | None:
if endpoint is None:
return None
endpoint = str(endpoint).strip()
if not endpoint:
return None
if not endpoint.startswith("/"):
endpoint = f"/{endpoint}"
return endpoint
def _use_endpoint_backend_when_implicit(args: argparse.Namespace) -> None:
explicit_keys = getattr(args, "explicit_keys", frozenset())
if "backend" in explicit_keys:
return
# Upstream vLLM defaults --backend to "openai". Treat that non-explicit
# default the same as an empty backend so endpoint-driven omni handlers work.
backend = getattr(args, "backend", None)
if backend not in (None, "", "openai"):
return
endpoint = _normalize_endpoint(getattr(args, "endpoint", None))
if endpoint in _ENDPOINT_BACKEND_KEYS:
args.backend = endpoint
def main(args: argparse.Namespace) -> dict[str, Any]:
if getattr(args, "seed_tts_wer_eval", False):
@@ -31,6 +62,7 @@ def main(args: argparse.Namespace) -> dict[str, Any]:
os.environ["SEED_TTS_WER_SAVE_ITEMS"] = "1"
if getattr(args, "daily_omni_save_eval_items", False):
os.environ["DAILY_OMNI_SAVE_EVAL_ITEMS"] = "1"
_use_endpoint_backend_when_implicit(args)
set_print_stage(getattr(args, "print_stage", False))
args.extra_body = maybe_enable_stage_metrics(
getattr(args, "extra_body", None),