Skip to main content

Model usability validation

Explanation:
BASE_URL Please fill in the API Base URL configured in the platform mgt.
API_KEY Please fill in the API Key configured in the platform mgt.
MODEL_NAME/EMB_MODEL_NAME Please fill in the model name (model ID) in the platform mgt.
IMAGE_URL Please fill in the specific image resource address.
👉👉👉 Download Test Script

1. Execute command

BASE_URL='https://<YOUR_BASE_URL>' \
API_KEY='<YOUR_API_KEY>' \
MODEL_NAME='<YOUR_CHAT_MODEL_NAME>' \
EMB_MODEL_NAME='<YOUR_EMBEDDING_MODEL_NAME>' \
bash ./model_api_check.sh

2. Optional: Add image request test (verify that the image is accessible)

BASE_URL='https://<YOUR_BASE_URL>' \
API_KEY='<YOUR_API_KEY>' \
MODEL_NAME='<YOUR_VISION_MODEL_NAME>' \
EMB_MODEL_NAME='<YOUR_EMBEDDING_MODEL_NAME>' \
IMAGE_URL='https://comany.domain.com/path/to/test.jpg' \
bash ./model_api_check.sh

3. Optional: Adjust timeout

CURL_CONNECT_TIMEOUT=10 \
CURL_MAX_TIME=120 \
BASE_URL='https://<YOUR_BASE_URL>' \
API_KEY='<YOUR_API_KEY>' \
MODEL_NAME='<YOUR_CHAT_MODEL_NAME>' \
EMB_MODEL_NAME='<YOUR_EMBEDDING_MODEL_NAME>' \
bash ./model_api_check.sh

Successful Example (Reference)

1. Basic inspection (without pictures)

BASE_URL=https://<YOUR_BASE_URL>
MODEL_NAME=<YOUR_CHAT_MODEL_NAME>
EMB_MODEL_NAME=<YOUR_EMBEDDING_MODEL_NAME>

[OK] Chat Completions OK(content is not empty)
[OK] Embeddings OK (embedding_length=3072)
[OK] Tools OK (tool_calls_length=1 finish_reason=tool_calls)
[INFO] Skip image check (IMAGE_URL not set)

All checks passed

2. Image Check (Set IMAGE URL)

BASE_URL=https://<YOUR_BASE_URL>
MODEL_NAME=<YOUR_VISION_MODEL_NAME>
EMB_MODEL_NAME=<YOUR_EMBEDDING_MODEL_NAME>
IMAGE_URL=https://comany.domain.com/path/to/test.jpg

[OK] Chat Completions OK(content is not empty)
[OK] Embeddings OK (embedding_length=3072)
[OK] Tools OK (tool_calls_length=1 finish_reason=tool_calls)
[OK] Image request OK (model can access image)

All checks passed

3. Timeout parameter check (set timeout)

BASE_URL=https://<YOUR_BASE_URL>
MODEL_NAME=<YOUR_CHAT_MODEL_NAME>
EMB_MODEL_NAME=<YOUR_EMBEDDING_MODEL_NAME>

[OK] Chat Completions OK(content is not empty)
[OK] Embeddings OK (embedding_length=3072)
[OK] Tools OK (tool_calls_length=1 finish_reason=tool_calls)
[INFO] Skip image check (IMAGE_URL not set)

All checks passed