Add SGLang serving backend support to ModelDeployment#5
Draft
devin-ai-integration[bot] wants to merge 1 commit into
Draft
Add SGLang serving backend support to ModelDeployment#5devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
- Add serve_sglang.py with build_sglang_serve_app() mirroring
build_vllm_serve_app() but launching sglang.launch_server
- Add backend field to DeployConfig ('vllm' | 'sglang')
- Add extra_sglang_args and sglang_image_tag to DeployConfig
- Update ModelConfig.serve() to dispatch based on deploy.backend
- Fully backward compatible: defaults to vllm when unset
Co-Authored-By: Joy <joyliu.q@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
⚙️ Control Options:
|
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.
Adds SGLang as an alternative serving backend alongside vLLM for
ModelConfig.serve().Changes
modal_training_gym/common/serve_sglang.py(new)build_sglang_serve_app()mirrorsbuild_vllm_serve_app()but launchessglang.launch_serverinside an SGLang Docker imagesglang_image_tag(defaults tolmsysorg/sglang:v0.4.7-cu124) andextra_sglang_argsmodal_training_gym/common/deploy.pyDeployConfiggainsbackend: Literal["vllm", "sglang"](default"vllm"— fully backward-compatible)extra_sglang_args,sglang_image_tagmodal_training_gym/common/models/base.pyModelConfig.serve()dispatches to the correct builder based ondeploy.backendUsage (Qwen3-4B example)
Checklist
latestpython_versionfor the base image, if it is used~=x.y.zor==x.yversion < 1are pinned to patch version,==0.y.zOutside contributors
N/A — internal change.
Link to Devin session: https://app.devin.ai/sessions/6aac27bf99024337a1d27328aac58062
Requested by: @joyliu-q