After deploying a service, you can use the online debugging feature in the console to test if it runs correctly. This graphical user interface (GUI) lets you send test requests and view responses directly, without writing code.
How to use online debugging
-
Navigate to the online debugging page.
-
Log on to the PAI console. Select a region on the top of the page. Then, select the desired workspace and click Elastic Algorithm Service (EAS).
-
On the Inference Service tab, find the service that you want to test. In the service's Actions column, click
> Online Debugging.
-
-
Construct and send the request. API definitions, especially the URL path and request body format, vary significantly by model. Ensure that you provide the correct request parameters. A standard request includes the following elements:
-
Method: Typically
POSTorGET. -
Request path: The online debugging tool automatically populates the base address. You may need to append a specific API path. An incorrect path is the most common cause of
404 Not Founderrors. -
Request headers: The
Authorizationtoken is typically populated automatically and requires no modification. -
Request body: The request body must be formatted according to the API requirements. A malformed body is the primary cause of
400 Bad Requestor500 Internal Server Errorerrors.
-
Example
This example shows how to test the chat completions API of a Qwen2.5-7B-Instruct model service deployed with vLLM. The parameters are as follows:
-
Method: POST
-
Request path:
http://***********/v1/chat/completions(Append/v1/chat/completionsto the auto-populated URL.) -
Request body:
{ "model": "Qwen2.5-7B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of Canada?" } ] }
A successful request returns a 200 status code. The response body contains a chat.completion object, where the content field returns The capital of Canada is Ottawa. The usage details show 36 prompt_tokens, 8 completion_tokens, and 44 total_tokens.
FAQ
-
How do I determine the correct URL and request body?
This depends on the model you deployed. For more information, see Construct Requests for Typical Scenarios.
Next steps
-
Evaluate performance: Use the EAS stress testing feature to assess service performance.
-
Invoke the service: Once the service meets your performance requirements, you can start invoking it. For more information, see service invocation.