Add --served-model-name CLI parameter#125
Merged
waybarrios merged 3 commits intowaybarrios:mainfrom Mar 21, 2026
Merged
Conversation
Allow users to serve a model under a different name in API responses, matching vLLM's --served-model-name behavior.
The cache directory was derived from _model_name which could be overridden by --served-model-name, causing cache misses when the served name changed. Use the actual model path instead.
Owner
|
resolved the merge conflicts with main and pushed to your branch. the PR looks good, clean feature that matches vLLM's --served-model-name behavior. merging now |
raullenchai
pushed a commit
to raullenchai/Rapid-MLX
that referenced
this pull request
Mar 26, 2026
…ection, served-model-name Merge 16 upstream commits (22dcbf8..d235c37) into our fork: - feat: SpecPrefill — attention-based sparse prefill for TTFT reduction (waybarrios#180) - feat: native Qwen3-VL video pipeline with temporal 3D conv + M-RoPE (waybarrios#150) - fix: Disable MambaCache monkey-patch for hybrid models, add MTP auto-injection (waybarrios#97) - feat: Add --served-model-name CLI parameter (waybarrios#125) - feat: Add Qwen3.5 text-only loading and dynamic memory threshold (waybarrios#127) - fix(mllm_scheduler): add adaptive periodic cache clearing (waybarrios#157) - fix: Metal resource leak under high concurrency (waybarrios#92) Conflict resolution strategy: keep all fork features (DeltaNet snapshots, fast SSE templates, tool injection, cloud routing, prompt cache, etc.) while incorporating upstream's new functionality. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 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
--served-model-nameoption tovllm-mlx serve, matching vLLM's behavior. When set, API responses use the specified name instead of the model path (e.g., servemlx-community/Llama-3.2-3B-Instruct-4bitbut have it appear asmy-llamain/v1/modelsand all responses). When omitted, behavior is unchanged./v1/completions,/v1/chat/completions,/v1/messages, and their streaming variants) now consistently use the served model name.Changes
vllm_mlx/cli.py: Added--served-model-nameargument and passed it through toload_model().vllm_mlx/server.py: Addedserved_model_nameparameter toload_model(), added_validate_model_name()helper, wired validation into all three endpoints, and replaced all response-facing uses ofrequest.modelwith_model_name.