diff --git a/sgl-model-gateway/bindings/python/src/sglang_router/router_args.py b/sgl-model-gateway/bindings/python/src/sglang_router/router_args.py index 034b4c8ef..aa0353a08 100644 --- a/sgl-model-gateway/bindings/python/src/sglang_router/router_args.py +++ b/sgl-model-gateway/bindings/python/src/sglang_router/router_args.py @@ -4,7 +4,16 @@ import logging import os from typing import Dict, List, Optional -from sglang_router.sglang_router_rs import get_available_tool_call_parsers +try: + from sglang_router.sglang_router_rs import get_available_tool_call_parsers +except ModuleNotFoundError: + logging.warning( + "sglang_router_rs is not available, get_available_tool_call_parsers will return empty list" + ) + + def get_available_tool_call_parsers() -> List[str]: + return [] + logger = logging.getLogger(__name__)