Skip to content

Commit 47da1bb

Browse files
yuluo-yxyossiovadia
authored andcommitted
feat: when run test-vllm, get model from openai models api (vllm-project#236)
Signed-off-by: yuluo-yx <[email protected]>
1 parent c4cc177 commit 47da1bb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/make/build-run-test.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ test-tools:
9292
-d '{"model": "auto", "tool_choice": "auto", "messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the weather today?"}], "temperature": 0.7}'
9393

9494
test-vllm:
95+
@echo "Fetching available models from vLLM endpoint..."
96+
@MODEL_NAME=$$(curl -s $(VLLM_ENDPOINT)/v1/models | jq -r '.data[0].id // "auto"'); \
97+
echo "Using model: $$MODEL_NAME"; \
9598
curl -X POST $(VLLM_ENDPOINT)/v1/chat/completions \
9699
-H "Content-Type: application/json" \
97-
-d '{"model": "qwen2.5:32b", "messages": [{"role": "assistant", "content": "You are a professional math teacher. Explain math concepts clearly and show step-by-step solutions to problems."}, {"role": "user", "content": "What is the derivative of f(x) = x^3 + 2x^2 - 5x + 7?"}], "temperature": 0.7}' | jq
100+
-d "{\"model\": \"$$MODEL_NAME\", \"messages\": [{\"role\": \"assistant\", \"content\": \"You are a professional math teacher. Explain math concepts clearly and show step-by-step solutions to problems.\"}, {\"role\": \"user\", \"content\": \"What is the derivative of f(x) = x^3 + 2x^2 - 5x + 7?\"}], \"temperature\": 0.7}" | jq

0 commit comments

Comments
 (0)