Skip to content

Commit 06d9f28

Browse files
committed
FIX: enforce architecture compatibility check even with virtualenv enabled
- 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
1 parent a9aa6d7 commit 06d9f28

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

xinference/model/llm/vllm/core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@ def _update_vllm_supported_lists() -> None:
319319
VLLM_SUPPORTED_MULTI_MODEL_LIST, "Qwen3_5MoeForConditionalGeneration"
320320
)
321321

322+
if effective_version >= version.parse("0.19.0"):
323+
_append_unique(
324+
VLLM_SUPPORTED_MULTI_MODEL_LIST, "Gemma4ForConditionalGeneration"
325+
)
326+
322327

323328
_update_vllm_supported_lists()
324329

xinference/model/utils.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ def _force_virtualenv_engine_params(
217217
218218
Behavior:
219219
- For virtualenv-enabled launches, use match_json to filter specs per engine.
220+
Only engines with matching specs are included - architecture compatibility
221+
is still enforced even with virtualenv.
220222
If the engine is sglang and no specs match, fall back to vLLM's match_json
221223
to reuse its compatibility logic.
222224
- For non-virtualenv launches, keep strict matching and only include engines
@@ -280,11 +282,17 @@ def _force_virtualenv_engine_params(
280282
matched_specs.append(spec)
281283
break
282284

283-
selected_specs = matched_specs or specs
285+
# Only include engine if specs matched - architecture compatibility is required
286+
# even with virtualenv enabled
287+
if not matched_specs:
288+
match_status[engine_name] = False
289+
continue
290+
291+
selected_specs = matched_specs
284292
engine_param_list = param_builder(family, selected_specs)
285293
engine_params[engine_name] = engine_param_list
286294
available_params[engine_name] = engine_param_list
287-
match_status[engine_name] = bool(matched_specs)
295+
match_status[engine_name] = True
288296
continue
289297

290298
has_match = False

0 commit comments

Comments
 (0)