feat(openai): add pass_video_url and enable_thinking_kwarg for vLLM-served video tasks#1366
Open
min1321 wants to merge 1 commit into
Open
feat(openai): add pass_video_url and enable_thinking_kwarg for vLLM-served video tasks#1366min1321 wants to merge 1 commit into
min1321 wants to merge 1 commit into
Conversation
…erved video tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OpenAICompatible:pass_video_urlandenable_thinking_kwarg, so a vLLM-served Qwen3-VL / Qwen3.5-VL backend can do server-side video decoding instead of forcing client-side frame extraction.pass_video_url=Truesends each video as{"type": "video_url", "video_url": {"url": "file://..."}}so vLLM can applymedia_io_kwargs.num_framesand attach absolute-time signals;enable_thinking_kwargforwardschat_template_kwargs.enable_thinkingviaextra_body.In scope
lmms_eval/models/chat/openai.py:OpenAICompatible.__init__: acceptpass_video_url: bool = Falseandenable_thinking_kwarg: object = None.build_payload_for_index: whenpass_video_url=True, build the OpenAImessageslist manually (skipto_openai_messages) and emit each video as avideo_urlpart. When either flag is set, populatepayload["extra_body"]withmedia_io_kwargsand/orchat_template_kwargs.Out of scope
vllm,sglang,huggingface,litellm, …). Same idea would apply but each has its own video path; happy to follow up if maintainers want.qwen_vl_utilsorprotocol.py.Validation
python -m lmms_eval --model openai --tasks extremewhenbench --model_args "...,pass_video_url=True,max_frames_num=768,enable_thinking_kwarg=False,..."against vLLM-served Qwen3.5-9B | sample size:N=2,273| key metrics: mIoU | result: 0.048 with new flags vs. 0.003 default (existing path) — pass. Matches a hand-rolledopenai-client reference (0.047) within run-to-run noise.--model openaiwithout the new flags produce identical output | result: pass.Risk / Compatibility
extra_bodyis OpenAI-API spec-compliant; non-vLLM backends that don't understandmedia_io_kwargssimply ignore it (server-specific).Type of Change