NeonLLM / vllm.sh
NeonBohdan's picture
Embed revision into model name
56b174a
raw
history blame
901 Bytes
#!/bin/bash
# Initialize variables with default values
model=""
revision="main"
port=5000
api_key=""
# Function to display help message
usage() {
echo "Usage: $0 --name <model_name> --api-key <api_key> [--revision <revision>] [--port <port>]"
exit 1
}
# Parse command-line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--name)
model="$2"
shift 2
;;
--api-key)
api_key="$2"
shift 2
;;
--revision)
revision="$2"
shift 2
;;
--port)
port="$2"
shift 2
;;
*)
usage
;;
esac
done
# Check if mandatory arguments are provided
if [[ -z "$model" || -z "$api_key" ]]; then
usage
fi
# Run the Python command with the provided arguments
python -m vllm.entrypoints.openai.api_server --model "$model" --revision "$revision" --port "$port" --api-key "$api_key" --served-model-name "$model@$revision"