> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://docs.nvidia.com/dynamo/llms.txt. For full content including API reference and SDK examples, see https://docs.nvidia.com/dynamo/llms-full.txt.

# SGLang Configuration (DynamoSGLangConfig)

`DynamoSGLangConfig` holds the Dynamo-specific configuration for the SGLang backend (`python -m dynamo.sglang`). Every field, type, default, and choice on this page comes from the [`DynamoSGLangArgGroup` and `DynamoSGLangConfig`](https://github.com/ai-dynamo/dynamo/blob/main/components/src/dynamo/sglang/backend_args.py) definitions. For features and operational details, see the [SGLang Reference Guide](/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/reference-guide).

These are **only** the Dynamo wrapper flags. The SGLang backend also accepts every native SGLang `ServerArgs` engine argument (`--model-path`, `--tp-size`, `--mem-fraction-static`, and so on) in the same command, plus the cross-cutting [Dynamo Runtime](/dynamo/dev/components/runtime-configuration) flags (`--namespace`, `--endpoint`, tool/reasoning parsers). This page covers neither — only the SGLang-specific `DYN_SGL_*` surface.

## How the config is loaded

Each field is both a CLI flag and an environment variable. The CLI flag takes precedence; the environment variable is the fallback. Boolean fields are negatable — `--enable-multimodal` sets it on, `--no-enable-multimodal` sets it off.

#### Kubernetes

Set flags in the worker container's `args` and environment variables in its `env`, under the SGLang worker service of a [DynamoGraphDeployment](/dynamo/dev/kubernetes-api/dynamo-graph-deployment) (DGD). The operator passes both through to the process without validation.

```yaml
spec:
  services:
    SGLangDecodeWorker:
      extraPodSpec:
        mainContainer:
          command:
            - python3
            - -m
            - dynamo.sglang
          args:
            - --model-path
            - Qwen/Qwen3-32B
            - --enable-multimodal
          env:
            - name: DYN_SGL_EMBEDDING_TRANSFER_MODE
              value: nixl-read
```

#### Local

Pass the flags directly on the command line:

```bash
python -m dynamo.sglang \
    --model-path Qwen/Qwen3-32B \
    --enable-multimodal \
    --embedding-transfer-mode nixl-read
```

## Worker role

The SGLang wrapper selects a worker role from these flags and the native `--disaggregation-mode` argument. The default, with no role-specific flags, is a standard LLM decode or aggregated worker.

Enable multimodal processing for workers that receive raw image or video inputs. Combine it with `--dedicated-mm-encoder` only for internal workers that consume or forward embeddings from a separate encode worker.

Environment variable: `DYN_SGL_ENABLE_MULTIMODAL`

Select the internal multimodal topology with a dedicated encode worker. Set this on PD, prefill, and decode workers that consume or forward precomputed embeddings. Do not set it on native P/D workers that receive raw media metadata or on the encode worker itself.

Requires `--enable-multimodal` and `--disaggregation-mode=pd`, `--disaggregation-mode=prefill`, or `--disaggregation-mode=decode`.

Environment variable: `DYN_SGL_DEDICATED_MM_ENCODER`

Run as an embedding worker component. Also sets SGLang's native `--is-embedding`.

Environment variable: `DYN_SGL_EMBEDDING_WORKER`

Run as an image diffusion worker for text-to-image generation.

Environment variable: `DYN_SGL_IMAGE_DIFFUSION_WORKER`

Run as a video generation worker for text-to-video and image-to-video (T2V/I2V) generation.

Environment variable: `DYN_SGL_VIDEO_GENERATION_WORKER`

Enable reinforcement-learning training support. Registers the `call_tokenizer_manager` engine route for generic `tokenizer_manager` passthrough.

Environment variable: `DYN_SGL_ENABLE_RL`

## Embedding transfer

Worker embedding transfer mode. `local` keeps embeddings in-process; `nixl-write` and `nixl-read` move them over NIXL RDMA (writer-initiated or reader-initiated).

Allowed values:

local

nixl-write

nixl-read

Environment variable: `DYN_SGL_EMBEDDING_TRANSFER_MODE`

## Disaggregation

Path to a disaggregation configuration file in YAML format. Must be set together with `--disagg-config-key`.

Environment variable: `DYN_SGL_DISAGG_CONFIG`

Key selecting a section from a nested disaggregation configuration file, for example `prefill` or `decode`. Must be set together with `--disagg-config`.

Environment variable: `DYN_SGL_DISAGG_CONFIG_KEY`

## Multimodal decoding

Decode multimodal images in the Rust frontend and transfer the pre-decoded pixels to the backend via NIXL RDMA, bypassing in-engine HTTP fetch and decode. Incompatible with the deprecated EPD multimodal flags (`--multimodal-encode-worker` / `--multimodal-worker`); use it on the default aggregated decode worker instead.

Environment variable: `DYN_SGL_FRONTEND_DECODING`

## Tracing

SGLang global trace level, applied when SGLang's `--enable-trace` is set.

Allowed values:

1 — minimal

2 — per-request

3 — +decode\_loop

4 — full

Environment variable: `SGLANG_TRACE_LEVEL`

## Deprecated

These flags are retained for backward compatibility and will be removed in a future release. Each is mapped to its replacement at startup with a deprecation warning.

Use SGLang's tokenizer for pre- and post-processing. **Deprecated** — use `--dyn-chat-processor sglang` on the frontend instead, which provides the same SGLang-native processing with KV router support. See [SGLang Chat Processor](/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/chat-processor).

Environment variable: `DYN_SGL_USE_TOKENIZER`

**Deprecated** — use `--enable-multimodal --disaggregation-mode=encode`. The legacy flag is mapped to those arguments at startup.

Environment variable: `DYN_SGL_MULTIMODAL_ENCODE_WORKER`

**Deprecated** — use `--enable-multimodal --dedicated-mm-encoder` with `--disaggregation-mode=pd`, `--disaggregation-mode=prefill`, or `--disaggregation-mode=decode`. The legacy flag is mapped to those arguments at startup.

Environment variable: `DYN_SGL_MULTIMODAL_WORKER`

## Validation rules

* `--disagg-config` and `--disagg-config-key` must both be set, or both unset.
* `--dedicated-mm-encoder` requires `--enable-multimodal`.
* `--dedicated-mm-encoder` is valid only with `--disaggregation-mode=pd`, `--disaggregation-mode=prefill`, or `--disaggregation-mode=decode`; do not combine it with `--disaggregation-mode=encode`.
* `--frontend-decoding` cannot be combined with the dedicated EPD multimodal topology (`--dedicated-mm-encoder`, `--multimodal-encode-worker`, or `--multimodal-worker`).

## Related pages

#### [SGLang Reference Guide](/dynamo/dev/knowledge-base/modular-components/backends/sg-lang/reference-guide)

Features, worker roles, and operational details for the SGLang backend.

#### [Runtime Configuration](/dynamo/dev/components/runtime-configuration)

Cross-cutting `DYN_*` flags shared by every backend and the frontend.

#### [vLLM Configuration](/dynamo/dev/backends/v-llm-configuration)

The equivalent Dynamo flag reference for the vLLM backend.

#### [TensorRT-LLM Configuration](/dynamo/dev/backends/tensor-rt-llm-configuration)

The equivalent Dynamo flag reference for the TensorRT-LLM backend.