{"record":{"id":"017b99cd4b2b2d1b","repo":"sgl-project/sglang","slug":"native-grpc-does-not-yet-support-tokenizer-worke","errorCode":null,"errorMessage":"Native gRPC does not yet support --tokenizer-worker-num > 1. Unset --grpc-port or set --tokenizer-worker-num 1.","messagePattern":"Native gRPC does not yet support --tokenizer-worker-num > 1\\. Unset --grpc-port or set --tokenizer-worker-num 1\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":4542,"sourceCode":"                raise ValueError(\n                    \"--sidecar requires SGLang's native gRPC server; \"\n                    \"it cannot be combined with --smg-grpc-mode/--grpc-mode.\"\n                )\n            if cfg.grpc_port is None:\n                raise ValueError(\"--sidecar requires --grpc-port or SGLANG_GRPC_PORT.\")\n        if native_grpc:\n            if cfg.use_ray:\n                raise ValueError(\n                    \"--grpc-port is not supported with --use-ray: the Ray \"\n                    \"serve launch path does not start the native gRPC server.\"\n                )\n            if cfg.encoder_only:\n                raise ValueError(\n                    \"--grpc-port is not supported with --encoder-only: \"\n                    \"encoder disaggregation uses its own server.\"\n                )\n            if cfg.tokenizer_worker_num > 1:\n                raise ValueError(\n                    \"Native gRPC does not yet support --tokenizer-worker-num > 1. \"\n                    \"Unset --grpc-port or set --tokenizer-worker-num 1.\"\n                )\n            if cfg.api_key or cfg.admin_api_key:\n                raise ValueError(\n                    \"--grpc-port is incompatible with --api-key/--admin-api-key: \"\n                    \"the native gRPC listener bypasses HTTP auth middleware.\"\n                )\n\n    def _handle_prefill_delayer_env_compat(self):\n        if envs.SGLANG_SCHEDULER_DECREASE_PREFILL_IDLE.get():\n            self._declare(\n                \"_handle_prefill_delayer_env_compat\",\n                enable_prefill_delayer=True,\n            )\n        if x := envs.SGLANG_PREFILL_DELAYER_MAX_DELAY_PASSES.get():\n            self._declare(\n                \"_handle_prefill_delayer_env_compat\",","sourceCodeStart":4524,"sourceCodeEnd":4560,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L4524-L4560","documentation":"The native gRPC server currently assumes a single tokenizer worker; launching with --tokenizer-worker-num > 1 and --grpc-port fails validation because multi-tokenizer routing is not yet implemented for gRPC.","triggerScenarios":"Setting --tokenizer-worker-num to 2+ while --grpc-port (or SGLANG_GRPC_PORT) is set.","commonSituations":"Scaling up tokenizer workers for high HTTP QPS and reusing the same flags on a gRPC deployment; defaults changed in a shared launch profile.","solutions":["Set --tokenizer-worker-num 1 (the gRPC-supported value)","Or unset --grpc-port / SGLANG_GRPC_PORT and use the HTTP path","Watch release notes for multi-tokenizer gRPC support"],"exampleFix":"# before\n--grpc-port 50051 --tokenizer-worker-num 4\n# after\n--grpc-port 50051 --tokenizer-worker-num 1","handlingStrategy":"validation","validationCode":"if (args.get(\"grpc_port\") or os.environ.get(\"SGLANG_GRPC_PORT\")) and args.get(\"tokenizer_worker_num\", 1) > 1:\n    args[\"tokenizer_worker_num\"] = 1  # or fail fast","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin --tokenizer-worker-num explicitly in every launch config so defaults can't drift","Check release notes when scaling gRPC deployments for new capability gates"],"tags":["grpc","tokenizer-workers","config-validation"],"backgroundTag":"unsupported-feature-combination","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}