Skip to content

Commit

Permalink
update extproc args
Browse files Browse the repository at this point in the history
Signed-off-by: Huamin Chen <[email protected]>
  • Loading branch information
rootfs committed Mar 6, 2025
1 parent bc0f459 commit 6266cd5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/vllm_router/parsers/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
except ImportError:
semantic_cache_available = False

# Check if extproc module is available
try:
from vllm_router.extproc.service import ExtProcService, serve_extproc
extproc_available = True
except ImportError:
extproc_available = False


# --- Argument Parsing and Initialization ---
def validate_args(args):
Expand All @@ -49,6 +56,9 @@ def validate_args(args):
raise ValueError("Engine stats interval must be greater than 0.")
if args.request_stats_window <= 0:
raise ValueError("Request stats window must be greater than 0.")
# Validate extproc arguments
if args.extproc and not extproc_available:
raise ValueError("Extproc module is not available. Please install the required dependencies.")


def parse_args():
Expand Down Expand Up @@ -194,6 +204,25 @@ def parse_args():
choices=["critical", "error", "warning", "info", "debug", "trace"],
help="Log level for uvicorn. Default is 'info'.",
)

# Add extproc arguments
parser.add_argument(
"--extproc",
action="store_true",
help="Run as an Envoy External Processing service"
)
parser.add_argument(
"--extproc-port",
type=int,
default=50051,
help="Port to run the extproc service on"
)
parser.add_argument(
"--extproc-grace-period",
type=int,
default=5,
help="Grace period in seconds for extproc service shutdown",
)

args = parser.parse_args()
validate_args(args)
Expand Down

0 comments on commit 6266cd5

Please sign in to comment.