[misc] Rename minilb install env & remove files & fix lint (#13831)
This commit is contained in:
@@ -1,6 +0,0 @@
|
|||||||
raise RuntimeError(
|
|
||||||
"""The 'mini_lb' module has been relocated to the 'sglang_router' package.
|
|
||||||
We recommend installing 'sglang-router' with Rust support for optimal performance.
|
|
||||||
If you encounter issues building the router with Rust, set the environment variable
|
|
||||||
'SGLANG_ROUTER_BUILD_NO_RUST=1' and add '--mini-lb' to the command line to use the Python version of 'mini_lb'."""
|
|
||||||
)
|
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
import os
|
import os
|
||||||
|
import warnings
|
||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
no_rust = os.environ.get("SGLANG_ROUTER_BUILD_NO_RUST") == "1"
|
with_rust = os.environ.get("SGLANG_ROUTER_BUILD_WITH_RUST", None)
|
||||||
|
with_rust = with_rust is None or (not with_rust.lower() in ["0", "false", "no"])
|
||||||
|
|
||||||
rust_extensions = []
|
rust_extensions = []
|
||||||
if not no_rust:
|
if with_rust:
|
||||||
from setuptools_rust import Binding, RustExtension
|
from setuptools_rust import Binding, RustExtension
|
||||||
|
|
||||||
rust_extensions.append(
|
rust_extensions.append(
|
||||||
@@ -15,6 +17,10 @@ if not no_rust:
|
|||||||
binding=Binding.PyO3,
|
binding=Binding.PyO3,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
warnings.warn(
|
||||||
|
"Building 'sglang-router' without Rust support. Performance may be degraded."
|
||||||
|
)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
rust_extensions=rust_extensions,
|
rust_extensions=rust_extensions,
|
||||||
|
|||||||
Reference in New Issue
Block a user