Integrate with PolarDB Agent Express

Updated at:

Model Proxy integrates with PolarDB Agent Express to provide unified model access, rate limiting, budget management, and observability for multi-agent applications. This topic describes how to integrate PolarDB Agent Express with Model Proxy.

Integration overview

After you integrate PolarDB Agent Express with Model Proxy, you gain the following capabilities:

  • Rate limiting and budget management: Configure token rate limiting and cost budgets for users and user groups in Model Proxy to prevent excessive resource consumption.

  • Observability: Use Model Proxy to monitor model call metrics for PolarDB Agent Express, including the number of calls, latency, and token consumption.

  • Centralized model management: Use Model Proxy to centrally manage access and routing for model services, which simplifies the model configuration for PolarDB Agent Express.

Integrate PolarDB Agent Express with Model Proxy

  1. In Model Proxy, configure the model service and model API.

  2. In Model Proxy, create the users and user groups for PolarDB Agent Express and obtain the API key.

  3. In your PolarDB Agent Express application, navigate to the Configure > Model Configuration page. Set the BASE URL to a URL that combines the instance Address of your Model Proxy and the base path of the model API. Use the following format: http://<PolarDB_Model_Proxy_internal_network_address>:<port>/<model_API_base_path>. For example, http://pg-xxx.polardbaigateway.rds.aliyuncs.com:8000/test_path or https://pg-xxx.polardbaigateway.rds.aliyuncs.com:8543/test_path.

    Note

    Model Proxy uses port 8000 (HTTP) and port 8543 (HTTPS) by default. Ensure that PolarDB Agent Express and Model Proxy are deployed in the same VPC to enable internal network communication.