Skip to content

[model-gateway] add qwen2.5_vl model image processor#14375

Merged
slin1237 merged 1 commit intomainfrom
smg-mm-5/n
Dec 3, 2025
Merged

[model-gateway] add qwen2.5_vl model image processor#14375
slin1237 merged 1 commit intomainfrom
smg-mm-5/n

Conversation

@slin1237
Copy link
Copy Markdown
Collaborator

@slin1237 slin1237 commented Dec 3, 2025

Checklist

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @slin1237, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates the Qwen2.5-VL model into the system's image processing pipeline. By leveraging the existing Qwen2VLProcessor, the change efficiently extends multimodal capabilities without introducing redundant processing logic, ensuring that the new model benefits from established and tested image preprocessing routines.

Highlights

  • New Model Support: Added support for the Qwen2.5-VL model's image processing within the model-gateway.
  • Processor Reusability: The Qwen2.5-VL model is configured to use the existing Qwen2VLProcessor, as it shares identical preprocessing logic with Qwen2-VL.
  • Documentation Updates: Updated internal documentation to reflect the addition of Qwen2.5-VL and clarify its use of the Qwen2VLProcessor.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@slin1237 slin1237 added the run-ci label Dec 3, 2025
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the qwen2.5_vl model by mapping it to the existing Qwen2VLProcessor. The changes are straightforward, mainly involving new model name registrations and documentation updates. My feedback focuses on improving code maintainability by reducing duplication in the registration logic and enhancing consistency in the documentation.

Comment on lines +295 to +307
// Register Qwen2.5-VL (uses identical preprocessing to Qwen2-VL)
registry.register(
"qwen2.5-vl",
Box::new(super::processors::Qwen2VLProcessor::new()),
);
registry.register(
"qwen2_5-vl",
Box::new(super::processors::Qwen2VLProcessor::new()),
);
registry.register(
"qwen2_5_vl",
Box::new(super::processors::Qwen2VLProcessor::new()),
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and reduce code duplication, you can use a loop to register the different patterns for Qwen2.5-VL since they all use the same processor.

Suggested change
// Register Qwen2.5-VL (uses identical preprocessing to Qwen2-VL)
registry.register(
"qwen2.5-vl",
Box::new(super::processors::Qwen2VLProcessor::new()),
);
registry.register(
"qwen2_5-vl",
Box::new(super::processors::Qwen2VLProcessor::new()),
);
registry.register(
"qwen2_5_vl",
Box::new(super::processors::Qwen2VLProcessor::new()),
);
// Register Qwen2.5-VL (uses identical preprocessing to Qwen2-VL)
for pattern in ["qwen2.5-vl", "qwen2_5-vl", "qwen2_5_vl"] {
registry.register(
pattern,
Box::new(super::processors::Qwen2VLProcessor::new()),
);
}

//! - **LLaVA 1.5** (`llava`): CLIP-based preprocessing with configurable aspect ratio
//! - **LLaVA-NeXT** (`llava`): Multi-crop anyres processing
//! - **Qwen2-VL** (`qwen2_vl`): Dynamic resolution with smart resizing
//! - **Qwen2.5-VL** (`qwen2_vl`): Same processor as Qwen2-VL (identical preprocessing)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the registration keys in image_processor.rs and the model_name() function in qwen2_vl.rs (which returns "qwen2-vl"), it would be clearer to use qwen2.5-vl here as the example pattern.

Suggested change
//! - **Qwen2.5-VL** (`qwen2_vl`): Same processor as Qwen2-VL (identical preprocessing)
//! - **Qwen2.5-VL** (`qwen2.5-vl`): Same processor as Qwen2-VL (identical preprocessing)

@slin1237 slin1237 merged commit 8ab5d8b into main Dec 3, 2025
60 of 63 checks passed
@slin1237 slin1237 deleted the smg-mm-5/n branch December 3, 2025 20:51
tom-jerr pushed a commit to tom-jerr/sglang that referenced this pull request Dec 4, 2025
yingluosanqian pushed a commit to yingluosanqian/sglang that referenced this pull request Dec 4, 2025
tonyluj pushed a commit to openanolis/sglang that referenced this pull request Dec 5, 2025
tonyluj pushed a commit to openanolis/sglang that referenced this pull request Dec 5, 2025
yuchengz816-bot pushed a commit to yuchengz816-bot/sglang that referenced this pull request Dec 8, 2025
Kevin-XiongC pushed a commit to novitalabs/sglang that referenced this pull request Dec 9, 2025
tonyluj pushed a commit to openanolis/sglang that referenced this pull request Dec 12, 2025
tonyluj pushed a commit to openanolis/sglang that referenced this pull request Dec 12, 2025
tonyluj pushed a commit to openanolis/sglang that referenced this pull request Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant