[Misc] Clean up python/sglang package structure (#35062)

This commit is contained in:
Lianmin Zheng
2026-08-17 14:24:35 -07:00
committed by GitHub
parent 770e7b47a2
commit 198a7b2fc9
54 changed files with 319 additions and 830 deletions
+1 -1
View File
@@ -3,9 +3,9 @@
import re
from typing import Callable, List, Optional, Union
from sglang.global_config import global_config
from sglang.lang.backend.base_backend import BaseBackend
from sglang.lang.choices import ChoicesSamplingMethod, token_length_normalized
from sglang.lang.global_config import global_config
from sglang.lang.ir import (
SglExpr,
SglExprList,
@@ -8,10 +8,10 @@ from typing import Dict, List, Optional, Union
import aiohttp
import requests
from sglang.global_config import global_config
from sglang.lang.backend.base_backend import BaseBackend
from sglang.lang.chat_template import get_chat_template, get_chat_template_by_model_path
from sglang.lang.choices import ChoicesDecision, ChoicesSamplingMethod
from sglang.lang.global_config import global_config
from sglang.lang.interpreter import StreamExecutor
from sglang.lang.ir import (
REGEX_BOOL,
+27
View File
@@ -0,0 +1,27 @@
"""Global configuration for the frontend language API."""
class GlobalConfig:
"""Store mutable process-wide frontend settings."""
def __init__(self):
# Verbosity level
# 0: do not output anything
# 2: output final text after every run
self.verbosity = 0
# Default backend of the language
self.default_backend = None
# Output tokenization configs
self.skip_special_tokens_in_output = True
self.spaces_between_special_tokens_in_out = True
# Language frontend interpreter optimization configs
self.enable_precache_with_tracing = True
self.enable_parallel_encoding = True
global_config = GlobalConfig()
__all__ = ["GlobalConfig", "global_config"]
+1 -1
View File
@@ -14,7 +14,7 @@ from typing import Any, Callable, Dict, List, Optional
import tqdm
from sglang.global_config import global_config
from sglang.lang.global_config import global_config
from sglang.lang.ir import (
SglCommitLazy,
SglConcateAndAppend,
+1 -1
View File
@@ -5,8 +5,8 @@ import inspect
import warnings
from typing import List, Optional, Union
from sglang.global_config import global_config
from sglang.lang.choices import ChoicesSamplingMethod
from sglang.lang.global_config import global_config
REGEX_INT = r"[-+]?[0-9]+[ \n]*"
REGEX_FLOAT = r"[-+]?[0-9]*\.?[0-9]+[ \n]*"