R.1

Flags and defaults

These are the flags this manual changes or explains, with the default the code sets, the value our Mac resolved, and when to change it.

sglang serve --help lists 535 options at 0.5.22 (the captured help output). Most of them never matter to you. The table below holds the main ones this manual uses. The sections name a few more flags where they apply.

Many defaults are None in the code. A startup hook replaces them with a value that depends on the GPU, the model, and the free memory. The "On our Mac" column shows that resolved value, from the server_args line of the default server log.

Memory and admission

FlagDefault in the codeOn our MacChange it whenSection
--mem-fraction-staticNone, derived from GPU size at startup0.4, set by the kitthe machine runs other programs, or the server crashes on large batches3.2
--max-total-tokensNone, derived from the memory budget181,574 tokens in the poolyou want a fixed pool size for a test2.3
--max-running-requestsNone, derived from the pool and the context length4,096you know your concurrency limit, or you turn on speculative decoding2.3
--chunked-prefill-sizeNone, derived from GPU memory4,096long prompts stall decode, or prefill is too slow2.2
--max-prefill-tokens16,38416,384rarely2.2
--schedule-conservativeness1.01.0you see retractions in the log, raise it2.3
--page-sizeNone, derived per attention backend1the attention backend needs pages3.1

Scheduling

FlagDefault in the codeOn our MacChange it whenSection
--schedule-policyfcfsfcfsmany queued requests share long prefixes, try lpm2.2
--disable-overlap-scheduleFalseFalseonly to debug, and never on MLX at 0.5.22, where it crashed2.4
--stream-interval11you stream to many clients and want fewer messages2.5

Cache

FlagDefault in the codeOn our MacChange it whenSection
--disable-radix-cacheFalseFalseonly to measure the cache, as our kit does3.3
--radix-eviction-policylrulrua few prefixes are hot and many are cold3.5
--enable-hierarchical-cacheoffoffthe working set of prefixes is larger than GPU memory3.5
--kv-cache-dtypeautoautoyou need more context per GPU and can test the quality4.3
--enable-cache-reportFalseTrue, set by the kitalways, so clients see cached_tokens3.4

Execution

FlagDefault in the codeOn our MacChange it whenSection
--attention-backendNone, chosen per GPU and modeltorch_native, which MLX does not useyou measured a better backend for your model4.2
--grammar-backendNone, which resolves to xgrammarxgrammara grammar fails to compile4.5
--disable-cuda-graph, deprecatedFalseTrue, as the Apple instructions sayon Apple silicon, where CUDA graphs do not exist. Prefer --cuda-graph-backend-decode disabled and --cuda-graph-backend-prefill disabled4.1
--speculative-algorithmNoneNonedecode latency at low concurrency matters most4.4
--enable-deterministic-inferenceFalseFalseyou need the same output for the same input in any batch4.6

--disable-cuda-graph still works at 0.5.22, and the per-phase flags --cuda-graph-backend-decode and --cuda-graph-backend-prefill replace it.

Parallelism and operations

FlagDefault in the codeOn our MacChange it whenSection
--tp-size11one GPU cannot hold the weights6.1
--dp-size11one copy of the model is saturated and you have GPUs for another6.1
--attn-dp-size11you serve an MLA model such as DeepSeek on many GPUs6.1
--ep-size11you serve a large MoE model6.2
--enable-metricsFalseTrue, set by the kitalways in production5.2
--watchdog-timeout300 s300 sa single forward pass can take longer than five minutes7.1

SGLang 0.5.22 · baa9bef · 2026-10-13 · Edition 2026.10