Debug a service online

更新时间:
复制 MD 格式

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.

Note

Some services do not support online debugging. For example, for ComfyUI and SDWebUI, online debugging is supported only in the Standard Edition.

How to use online debugging

  1. Navigate to the online debugging page.

    1. 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).

    2. On the Inference Service tab, find the service that you want to test. In the service's Actions column, click image > Online Debugging.

  2. 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 POST or GET.

    • 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 Found errors.

    • Request headers: The Authorization token 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 Request or 500 Internal Server Error errors.

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/completions to 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

  1. 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.