FEAT: [model] gemma-4 support#4768
Merged
qinxuye merged 26 commits intoxorbitsai:mainfrom Apr 12, 2026
Merged
Conversation
5ef21fb to
7fab628
Compare
… support - Add _sanitize_generate_config to MLXVisionModel to handle stop/stop_token_ids from model family - Initialize reasoning parser in MLXVisionModel.load() for hybrid models - Pass reasoning_parser to completion methods for proper content parsing - Pass tokenizer to get_full_context for correct jinja template rendering - Set enable_thinking=False as default for MLX models - Enable stream by default for multimodal interface in Gradio UI
…abled - Fix _force_virtualenv_engine_params: only include engines with matching specs, previously fallback to all specs when matched_specs is empty - Add Gemma4ForConditionalGeneration to VLLM_SUPPORTED_MULTI_MODEL_LIST for vllm >= 0.19.0
- VLLMMultiModel: fall back to tokenizer's chat_template when model_family.chat_template is empty - SGLANGVisionModel: same logic as VLLMMultiModel, align with MLX core behavior - SGLANGModel: use empty string instead of asserting when chat_template is empty When chat_template is empty, engines will: 1. Get tokenizer and retrieve its chat_template attribute 2. If still empty, raise ValueError 3. Pass tokenizer to get_full_context for proper template application This aligns the behavior across vllm, sglang, and mlx engines.
When thinking mode is enabled (enable_thinking=True), special tokens are needed for the thinking/reasoning format. Set skip_special_tokens=False in this case to preserve the special tokens.
f36ea85 to
5fd9e51
Compare
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.
Automated sync for model "gemma-4" (llm) by user qinxuye.