#!/bin/bash# Define the prefix for environment variables to look forPREFIX="SM_VLLM_"ARG_PREFIX="--"# Initialize an array for storing the arguments# port 8080 required by sagemaker, https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html#your-algorithms-inference-code-container-responseARGS=(--port8080)# Loop through all environment variableswhileIFS='='read-rkeyvalue;do# Remove the prefix from the key, convert to lowercase, and replace underscores with dashesarg_name=$(echo"${key#"${PREFIX}"}"|tr'[:upper:]''[:lower:]'|tr'_''-')# Add the argument name and value to the ARGS arrayARGS+=("${ARG_PREFIX}${arg_name}")if[-n"$value"];thenARGS+=("$value")fidone<<(env|grep"^${PREFIX}")# Pass the collected arguments to the main entrypointexecvllmserve"${ARGS[@]}"