Skip to content

feat: migrate SGLang configuration#6280

Merged
jh-nv merged 8 commits intomainfrom
jihao/sglang_configuration_DIS-1402
Feb 14, 2026
Merged

feat: migrate SGLang configuration#6280
jh-nv merged 8 commits intomainfrom
jihao/sglang_configuration_DIS-1402

Conversation

@jh-nv
Copy link
Copy Markdown
Contributor

@jh-nv jh-nv commented Feb 13, 2026

Overview:

This PR migrates the SGLang backend configuration path to Dynamo’s shared configuration framework and separates Dynamo wrapper arguments from native SGLang engine arguments.

Details:

  • Introduced SGLang-specific wrapper config in components/src/dynamo/sglang/backend_args.py:
  • Refactored components/src/dynamo/sglang/args.py:
  • Added '--disagg-config' and '--disagg-config-key' to clean up overloaded '--config' features.

Where should the reviewer start?

components/src/dynamo/sglang/backend_args.py
components/src/dynamo/sglang/args.py

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • closes GitHub issue: #xxx

Summary by CodeRabbit

Release Notes

  • New Features

    • Added endpoint configuration field for runtime customization.
  • Refactor

    • Reorganized configuration system to modular, type-annotated structure.
    • Consolidated SGLang-specific configuration options into dedicated group for improved organization.

@jh-nv jh-nv requested a review from a team as a code owner February 13, 2026 16:08
@jh-nv jh-nv requested a review from a team February 13, 2026 16:08
@github-actions github-actions Bot added feat backend::vllm Relates to the vllm backend backend::sglang Relates to the sglang backend labels Feb 13, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 13, 2026

Walkthrough

The changes introduce a modular configuration system for Dynamo by creating reusable configuration classes and argument groups, replacing flat argument definitions. An endpoint field is added to runtime configuration with CLI argument support. New helper functions manage YAML disaggregation config loading and merging. The vllm args module removes a now-redundant endpoint field.

Changes

Cohort / File(s) Summary
Configuration Foundation
components/src/dynamo/common/configuration/groups/runtime_args.py, components/src/dynamo/sglang/backend_args.py
Added endpoint field and CLI argument to DynamoRuntimeConfig. Introduced new DynamoSGLangArgGroup and DynamoSGLangConfig classes with SGLang-specific options including tokenizer, multimodal workers, and disaggregation config parameters.
Core Argument Processing
components/src/dynamo/sglang/args.py
Replaced flat Dynamo arguments with modular DynamoConfig class (combines DynamoRuntimeConfig and DynamoSGLangConfig) and DisaggregationMode enum. Refactored parse_args to use argument groups, added helper functions for CLI flag manipulation and YAML config loading/merging, updated Config constructor to accept DynamoConfig instead of DynamoArgs.
Integration Updates
components/src/dynamo/sglang/main.py, components/src/dynamo/sglang/register.py
Updated type hints from DynamoArgs to DynamoConfig across registration functions. Replaced dyn_endpoint_types references with endpoint_types. Updated field references for reasoning_parser and tool_call_parser to use prefixed versions from new config structure.
vLLM Configuration
components/src/dynamo/vllm/args.py
Removed redundant endpoint field from Config class.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 Modular configs hop into place,
Dynamo's arguments find their grace,
From flatland chaos to grouped design,
New endpoints and helpers align,
Configuration harmony—thump thump—divine! 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 76.47% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (71 files):

⚔️ .gitignore (content)
⚔️ components/src/dynamo/common/configuration/groups/runtime_args.py (content)
⚔️ components/src/dynamo/frontend/frontend_args.py (content)
⚔️ components/src/dynamo/frontend/main.py (content)
⚔️ components/src/dynamo/frontend/vllm_processor.py (content)
⚔️ components/src/dynamo/router/__main__.py (content)
⚔️ components/src/dynamo/sglang/args.py (content)
⚔️ components/src/dynamo/sglang/health_check.py (content)
⚔️ components/src/dynamo/sglang/main.py (content)
⚔️ components/src/dynamo/sglang/protocol.py (content)
⚔️ components/src/dynamo/sglang/publisher.py (content)
⚔️ components/src/dynamo/sglang/register.py (content)
⚔️ components/src/dynamo/sglang/request_handlers/__init__.py (content)
⚔️ components/src/dynamo/trtllm/protocols/video_protocol.py (content)
⚔️ components/src/dynamo/trtllm/request_handlers/video_diffusion/video_handler.py (content)
⚔️ components/src/dynamo/trtllm/tests/test_trtllm_video_diffusion.py (content)
⚔️ components/src/dynamo/trtllm/workers/llm_worker.py (content)
⚔️ components/src/dynamo/vllm/args.py (content)
⚔️ components/src/dynamo/vllm/main.py (content)
⚔️ components/src/dynamo/vllm/multimodal_handlers/__init__.py (content)
⚔️ components/src/dynamo/vllm/multimodal_handlers/encode_worker_handler.py (content)
⚔️ components/src/dynamo/vllm/multimodal_handlers/worker_handler.py (content)
⚔️ container/templates/sglang_runtime.Dockerfile (content)
⚔️ deploy/inference-gateway/README.md (content)
⚔️ deploy/inference-gateway/epp/pkg/plugins/dynamo_kv_scorer/plugin.go (content)
⚔️ deploy/inference-gateway/standalone/helm/dynamo-gaie/templates/dynamo-epp.yaml (content)
⚔️ deploy/inference-gateway/standalone/helm/dynamo-gaie/values.yaml (content)
⚔️ deploy/operator/internal/dynamo/component_epp.go (content)
⚔️ docs/pages/backends/trtllm/README.md (content)
⚔️ docs/pages/components/router/router-examples.md (content)
⚔️ docs/pages/components/router/router-guide.md (content)
⚔️ docs/pages/integrations/kv-events-custom-engines.md (content)
⚔️ examples/deployments/router_standalone_trtllm/api.py (content)
⚔️ examples/deployments/router_standalone_trtllm/test_router.py (content)
⚔️ examples/multimodal/components/worker.py (content)
⚔️ lib/bindings/c/src/lib.rs (content)
⚔️ lib/bindings/python/Cargo.lock (content)
⚔️ lib/bindings/python/rust/lib.rs (content)
⚔️ lib/bindings/python/rust/llm/kv.rs (content)
⚔️ lib/bindings/python/src/dynamo/_core.pyi (content)
⚔️ lib/bindings/python/src/dynamo/llm/__init__.py (content)
⚔️ lib/bindings/python/tests/test_mm_kv_router.py (content)
⚔️ lib/kv-router/README.md (content)
⚔️ lib/llm/src/discovery/model_manager.rs (content)
⚔️ lib/llm/src/discovery/watcher.rs (content)
⚔️ lib/llm/src/endpoint_type.rs (content)
⚔️ lib/llm/src/entrypoint/input/common.rs (content)
⚔️ lib/llm/src/http/service/metrics.rs (content)
⚔️ lib/llm/src/http/service/openai.rs (content)
⚔️ lib/llm/src/http/service/service_v2.rs (content)
⚔️ lib/llm/src/kv_router.rs (content)
⚔️ lib/llm/src/kv_router/prefill_router.rs (content)
⚔️ lib/llm/src/kv_router/push_router.rs (content)
⚔️ lib/llm/src/model_type.rs (content)
⚔️ lib/llm/src/preprocessor.rs (content)
⚔️ lib/llm/src/protocols/common/preprocessor.rs (content)
⚔️ lib/llm/src/protocols/openai.rs (content)
⚔️ lib/llm/src/protocols/openai/nvext.rs (content)
⚔️ lib/llm/src/types.rs (content)
⚔️ lib/llm/tests/http-service.rs (content)
⚔️ lib/runtime/src/pipeline/network/egress/push_router.rs (content)
⚔️ recipes/llama-3-70b/vllm/agg/gaie/deploy.yaml (content)
⚔️ recipes/llama-3-70b/vllm/agg/gaie/http-route.yaml (content)
⚔️ tests/basic/test_autodeploy_backend.py (content)
⚔️ tests/fault_tolerance/test_vllm_health_check.py (content)
⚔️ tests/kvbm_integration/test_cuda_graph.py (content)
⚔️ tests/router/common.py (content)
⚔️ tests/router/test_router_e2e_with_mockers.py (content)
⚔️ tests/router/test_router_e2e_with_sglang.py (content)
⚔️ tests/router/test_router_e2e_with_trtllm.py (content)
⚔️ tests/router/test_router_e2e_with_vllm.py (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: migrate SGLang configuration' clearly and concisely summarizes the primary change—migrating SGLang backend configuration to Dynamo's shared framework.
Description check ✅ Passed The description covers the required template sections with sufficient detail: overview explains the migration scope, details describe key changes, reviewer entry points are specified, and related issues are included.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
components/src/dynamo/sglang/register.py (1)

146-162: ⚠️ Potential issue | 🟡 Minor

Stale docstring: function no longer returns None.

The docstring on line 157-158 says "or None if extraction fails", but all code paths now return runtime_config. Update to reflect the actual behavior.

Suggested fix
     Returns:
-        ModelRuntimeConfig with extracted values, or None if extraction fails.
+        ModelRuntimeConfig with extracted values (may be partially populated if scheduler info is unavailable).
components/src/dynamo/sglang/main.py (1)

284-288: ⚠️ Potential issue | 🟡 Minor

Warning message references obsolete flag name --dyn-endpoint-types.

Line 286 mentions --dyn-endpoint-types but the primary flag is now --endpoint-types (with --dyn-endpoint-types as an obsolete alias). Consider updating the warning to reference the current flag name.

🤖 Fix all issues with AI agents
In `@components/src/dynamo/sglang/args.py`:
- Around line 263-269: The code that replaces the config flag currently only
looks for the exact token "--config" (using unknown.index) and misses the
"--config=path" form, causing a duplicate config flag; update the logic in the
function/class handling the unknown list (referenced by unknown and
temp_config_file in args.py, likely inside ConfigArgumentMerger or the argument
merging routine) to detect either an exact "--config" token or any token that
startswith "--config="; if you find "--config" replace the next element with
temp_config_file, and if you find "--config=..." replace that single token with
"--config" and temp_config_file (or replace it in-place to use
"--config=temp_config_file") so only one config specification remains.

In `@components/src/dynamo/sglang/backend_args.py`:
- Around line 84-92: The default for the --image-diffusion-base-url flag uses a
second env var ("DYN_IMAGE_DIFFUSION_BASE_URL") at import time which conflicts
with the add_argument env_var ("DYN_SGL_IMAGE_DIFFUSION_BASE_URL"); fix by
consolidating to a single env var—update the add_argument call that defines
flag_name "--image-diffusion-base-url" (and uses env_var
"DYN_SGL_IMAGE_DIFFUSION_BASE_URL") to remove the
os.environ.get("DYN_IMAGE_DIFFUSION_BASE_URL", ...) lookup and either use a
plain hardcoded default "http://localhost:8008/" or, if legacy support is
required, replace it with os.environ.get("DYN_SGL_IMAGE_DIFFUSION_BASE_URL",
os.environ.get("DYN_IMAGE_DIFFUSION_BASE_URL", "http://localhost:8008/"))) so
precedence is clear and not duplicated.
🧹 Nitpick comments (3)
components/src/dynamo/sglang/args.py (3)

180-186: Usage of private argparse internals (_StoreTrueAction, _StoreFalseAction).

These are CPython implementation details and may break on alternative interpreters or future Python versions. This is a common pragmatic choice, but worth noting.


240-247: Accessing private _group_actions to splice SGLang flags into help output.

sg._group_actions.append(action) relies on an internal argparse attribute. This is a pragmatic workaround for grouping help text, but it's fragile. Consider adding a comment noting this is intentional and why a cleaner API isn't available.


150-162: Temp file cleanup relies on caller — consider NamedTemporaryFile(delete=False) or a context manager.

The temp file is created on line 152 and cleaned up on lines 299-303. If an exception occurs between these points (e.g., during _apply_disagg_config_defaults or config_merger.merge_config_with_args), the temp file leaks. A try/finally wrapper around the full block using the temp file would be more robust.

Comment thread components/src/dynamo/sglang/args.py Outdated
Comment thread components/src/dynamo/sglang/backend_args.py
@ishandhanani
Copy link
Copy Markdown
Contributor

Signed-off-by: jh-nv <jihao@nvidia.com>
@jh-nv jh-nv enabled auto-merge (squash) February 14, 2026 02:57
@jh-nv jh-nv merged commit f4f8276 into main Feb 14, 2026
104 of 107 checks passed
@jh-nv jh-nv deleted the jihao/sglang_configuration_DIS-1402 branch February 14, 2026 18:54
ranrubin pushed a commit that referenced this pull request Feb 16, 2026
Signed-off-by: jh-nv <jihao@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend::sglang Relates to the sglang backend backend::vllm Relates to the vllm backend feat size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants