Skip to main content
These variables configure caching acceleration for Diffusion Transformer (DiT) models. SGLang supports multiple caching strategies - see performance optimization documentation for an overview. See Environment Variables for a list of all environment variables.

Cache-DiT configuration

See Cache-DiT documentation for detailed configuration.
Environment VariableDefaultDescription
SGLANG_CACHE_DIT_ENABLEDfalseEnable Cache-DiT acceleration
SGLANG_CACHE_DIT_FN1First N blocks to always compute
SGLANG_CACHE_DIT_BN0Last N blocks to always compute
SGLANG_CACHE_DIT_WARMUP4Warmup steps before caching
SGLANG_CACHE_DIT_RDT0.24Residual difference threshold
SGLANG_CACHE_DIT_MC3Max continuous cached steps
SGLANG_CACHE_DIT_TAYLORSEERfalseEnable TaylorSeer calibrator
SGLANG_CACHE_DIT_TS_ORDER1TaylorSeer order (1 or 2)
SGLANG_CACHE_DIT_SCM_PRESETnoneSCM preset (none/slow/medium/fast/ultra)
SGLANG_CACHE_DIT_SCM_POLICYdynamicSCM caching policy
SGLANG_CACHE_DIT_SCM_COMPUTE_BINSnot setCustom SCM compute bins
SGLANG_CACHE_DIT_SCM_CACHE_BINSnot setCustom SCM cache bins

Cloud Storage

These variables configure S3-compatible cloud storage for automatically uploading generated images and videos.
Environment VariableDefaultDescription
SGLANG_CLOUD_STORAGE_TYPEnot setSet to s3 to enable cloud storage
SGLANG_S3_BUCKET_NAMEnot setThe name of the S3 bucket
SGLANG_S3_ENDPOINT_URLnot setCustom endpoint URL (for MinIO, OSS, etc.)
SGLANG_S3_REGION_NAMEus-east-1AWS region name
SGLANG_S3_ACCESS_KEY_IDnot setAWS Access Key ID
SGLANG_S3_SECRET_ACCESS_KEYnot setAWS Secret Access Key