Skip to content

Commit 02fb601

Browse files
committed
Add an option to supply host as an argument
1 parent 41ee25b commit 02fb601

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

examples/llm_eval/run_lm_eval_vllm.sh

100644100755
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
# Script to run lm-evaluation-harness against a running vLLM OpenAI-compatible server.
2020
#
2121
# Usage:
22-
# bash run_lm_eval_vllm.sh <model_name> [port] [task]
22+
# bash run_lm_eval_vllm.sh <model_name> [port] [task] [host]
2323
#
2424
# Arguments:
2525
# <model_name>: The name of the model being served (e.g., Qwen/Qwen3-30B-A3B). Used for the 'model' argument in lm_eval.
2626
# [port]: The port the vLLM server is listening on (default: 8000).
2727
# [task]: The lm_eval task(s) to run (default: mmlu).
28+
# [host]: The IP address or hostname of the vLLM server (default: localhost).
2829
#
2930
# Example:
3031
# # Start vLLM server first (in another terminal):
@@ -35,23 +36,27 @@
3536
#
3637
# # Run for a different task, e.g., hellaswag:
3738
# bash run_lm_eval_vllm.sh Qwen/Qwen3-30B-A3B 8000 hellaswag
39+
#
40+
# # Run against a remote server:
41+
# bash run_lm_eval_vllm.sh Qwen/Qwen3-30B-A3B 8000 mmlu 10.78.17.40
3842
# ---
3943

4044
set -e
4145
set -x
4246

4347
# --- Argument Parsing ---
4448
if [ -z "$1" ]; then
45-
echo "Usage: $0 <model_name> [port] [task]"
49+
echo "Usage: $0 <model_name> [port] [task] [host]"
4650
exit 1
4751
fi
4852
MODEL_NAME=$1
4953
PORT=${2:-8000} # Default port is 8000 if not provided
5054
TASK=${3:-mmlu} # Default task is mmlu if not provided
55+
HOST=${4:-localhost} # Default host is localhost if not provided
5156

5257
# --- Environment Setup ---
5358
export OPENAI_API_KEY="local" # Not strictly required for local, but good practice
54-
BASE_URL="http://localhost:${PORT}/v1"
59+
BASE_URL="http://${HOST}:${PORT}/v1"
5560
COMPLETIONS_URL="${BASE_URL}/completions"
5661

5762
# --- Evaluation ---

0 commit comments

Comments
 (0)