{"record":{"id":"83e33f2f4d076087","repo":"sgl-project/sglang","slug":"python-m-sglang-launch-server-is-still-supporte","errorCode":null,"errorMessage":"'python -m sglang.launch_server' is still supported, but 'sglang serve' is the recommended entrypoint.\n  Example: sglang serve --model-path <model> [options]","messagePattern":"'python -m sglang\\.launch_server' is still supported, but 'sglang serve' is the recommended entrypoint\\.\n  Example: sglang serve --model-path <model> \\[options\\]","errorType":"console","errorClass":"UserWarning","httpStatus":null,"severity":"info","filePath":"python/sglang/launch_server.py","lineNumber":63,"sourceCode":"        # Ray mode: HTTP mode with Ray backend.\n        try:\n            from sglang.srt.ray.http_server import launch_server\n        except ImportError:\n            raise ImportError(\n                \"Ray is required for --use-ray mode. \"\n                \"Install it with: pip install 'sglang[ray]'\"\n            )\n\n        launch_server(server_args)\n    else:\n        # Default mode: HTTP mode.\n        from sglang.srt.entrypoints.http_server import launch_server\n\n        launch_server(server_args)\n\n\nif __name__ == \"__main__\":\n    warnings.warn(\n        \"'python -m sglang.launch_server' is still supported, but \"\n        \"'sglang serve' is the recommended entrypoint.\\n\"\n        \"  Example: sglang serve --model-path <model> [options]\",\n        UserWarning,\n        stacklevel=1,\n    )\n\n    load_plugins()\n\n    server_args = prepare_server_args(sys.argv[1:])\n\n    try:\n        run_server(server_args)\n    finally:\n        kill_process_tree(os.getpid(), include_parent=False)\n","sourceCodeStart":45,"sourceCodeEnd":79,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/launch_server.py#L45-L79","documentation":"Running 'python -m sglang.launch_server' still works but is no longer the recommended CLI. The modern entrypoint is the 'sglang serve' subcommand; the old module path emits this UserWarning at startup.","triggerScenarios":"Executing python -m sglang.launch_server --model-path ... directly, or a legacy systemd/Docker launch script/deployment YAML that still invokes the module form.","commonSituations":"Upgrading sglang and old deployment manifests keep the module invocation; copy-pasted launch commands from older blog posts or READMEs.","solutions":["Replace with: sglang serve --model-path <model> [options]","Update Docker CMD/ENTRYPOINT and any orchestration templates accordingly","If you must keep the old form temporarily, silence with PYTHONWARNINGS or warnings filter, but plan migration"],"exampleFix":"# before\npython -m sglang.launch_server --model-path meta-llama/Llama-3-8B-Instruct\n# after\nsglang serve --model-path meta-llama/Llama-3-8B-Instruct","handlingStrategy":"validation","validationCode":"import subprocess, sys\nsubprocess.run([\"sglang\", \"serve\", \"--model-path\", model, *extra_args])","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin launch commands in a single script constant","Grep deploy scripts for 'python -m sglang.launch_server' each upgrade"],"tags":["deprecation","cli","launch-server","entrypoint","migration"],"backgroundTag":"deprecated-cli-entrypoint","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}