{"record":{"id":"10a5f0b955f10ae1","repo":"sgl-project/sglang","slug":"min-new-tokens-min-new-tokens-is-unavailable-whe","errorCode":null,"errorMessage":"min_new_tokens={min_new_tokens} is unavailable when skip_tokenizer_init=True (requires tokenizer for eos_token_id).","messagePattern":"min_new_tokens=(.+?) is unavailable when skip_tokenizer_init=True \\(requires tokenizer for eos_token_id\\)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/sampling/sampling_params.py","lineNumber":334,"sourceCode":"    to convert output token IDs to text for matching. min_new_tokens requires the\n    tokenizer's eos_token_id to penalize. When skip_tokenizer_init=True, these cannot\n    be used.\n    \"\"\"\n    if tokenizer is not None:\n        return\n\n    if stop_strs:\n        raise ValueError(\n            f\"stop={stop_strs!r} is unavailable when skip_tokenizer_init=True \"\n            \"(requires tokenizer to decode tokens to text for matching).\"\n        )\n    if stop_regex_strs:\n        raise ValueError(\n            f\"stop_regex={stop_regex_strs!r} is unavailable when skip_tokenizer_init=True \"\n            \"(requires tokenizer to decode tokens to text for matching).\"\n        )\n    if min_new_tokens > 0:\n        raise ValueError(\n            f\"min_new_tokens={min_new_tokens} is unavailable when skip_tokenizer_init=True \"\n            \"(requires tokenizer for eos_token_id).\"\n        )\n","sourceCodeStart":316,"sourceCodeEnd":338,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/sampling/sampling_params.py#L316-L338","documentation":"min_new_tokens is enforced by suppressing the EOS token, which requires knowing the tokenizer's eos_token_id. Under --skip-tokenizer-init there is no tokenizer, so raise_if_tokenizer_required rejects min_new_tokens > 0 during normalize().","triggerScenarios":"Server launched with --skip-tokenizer-init while the request sets SamplingParams(min_new_tokens=1 or more), often to prevent empty completions.","commonSituations":"Reusing production sampling params (which set min_new_tokens) against a tokenizer-free benchmark/evaluation server that feeds input_ids directly.","solutions":["Remove min_new_tokens (set 0 or omit) when targeting a skip-tokenizer-init server.","Or launch the server without --skip-tokenizer-init."],"exampleFix":"# before\nSamplingParams(min_new_tokens=10)  # with --skip-tokenizer-init\n# after\nSamplingParams(min_new_tokens=0)","handlingStrategy":"validation","validationCode":"if skip_tokenizer_init and params.get('min_new_tokens', 0):\n    params['min_new_tokens'] = 0","typeGuard":"def min_tokens_ok_without_tokenizer(params: dict) -> bool:\n    return not params.get('min_new_tokens')","tryCatchPattern":null,"preventionTips":["Strip eos-dependent sampling knobs (min_new_tokens) from configs used against tokenizer-free servers."],"tags":["skip-tokenizer-init","min-new-tokens","sampling-params","sglang"],"backgroundTag":"feature-requires-tokenizer","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}