DaaS / Products / Custom Model-Powered AIRec Recommendations

Custom Model-Powered AIRec Recommendations

Deploy a custom ranking or scoring model on PAI-EAS for online inference, then integrate it with AIRec as the personalization backend—PAI handles model serving with auto-scaling while AIRec orchestrates recommendation delivery, A/B experimentation, and real-time user targeting.

Products involved

Scenario

Use this workflow when you need to replace AIRec’s default ranking algorithms with a proprietary or fine-tuned model (e.g., a deep learning CTR predictor) while retaining AIRec’s orchestration, real-time user targeting, and A/B testing capabilities. PAI-EAS serves the custom model with GPU/CPU auto-scaling, and AIRec routes live traffic to the endpoint for personalized item scoring.

Integration steps

  1. Package & Upload Model: Export your trained model (SavedModel/ONNX) and upload to an OSS bucket. Bundle preprocessing/postprocessing scripts if deploying a full pipeline.
  2. Deploy to PAI-EAS: Use the PAI console or OpenAPI to create an Elastic Algorithm Service.
  3. ``bash POST /api/v2/services { "name": "custom-ranker-v1", "model_path": "oss://<bucket>/model.tar.gz", "processor": "tensorflow", "auto_scaling": {"min_instances": 2, "max_instances": 10, "target_cpu": 70} } ``

  4. Verify Endpoint: Confirm the service reaches Running state and capture the VPC/public URL (e.g., https://<service-id>.<region>.pai-eas.aliyuncs.com).
  5. Deploy AIRec Instance: If your target region is cn-hangzhou or another supported zone, deploy via console or API:
  6. ``bash POST /v2/instances {"region": "cn-hangzhou", "service_type": "custom_ranking", "vpc_id": "<vpc-id>"} ``

  7. Bind PAI-EAS to AIRec: In AIRec console under Algorithm > Custom Ranking, or via UpdateInstanceConfig:
  8. ``json {"custom_ranker": {"endpoint": "https://<service-id>.pai-eas.aliyuncs.com", "timeout_ms": 500, "request_format": "json"}} ``

  9. Ingest Data: Push user, item, and behavior logs using AIRec’s BatchImport API to populate the feature store.
  10. Configure A/B Testing: Create an experiment via POST /v2/experiments splitting traffic 50/50 between the default AIRec ranker and your PAI-backed model.
  11. Validate: Call AIRec’s Recommend API and verify x-pai-eas-request-id appears in response headers, confirming successful routing.

Architecture

Client requests hit the AIRec Gateway, which fetches real-time user/item features from the AIRec Feature Store. AIRec forwards feature payloads to the PAI-EAS endpoint for custom scoring. PAI-EAS returns ranked item scores, which AIRec applies business rules, diversity filters, and A/B routing logic to before returning the final recommendation payload. PAI manages inference compute and auto-scaling; AIRec manages traffic orchestration and experimentation.

Prerequisites

Common pitfalls

Typical questions

FAQ

Q: How do I integrate a custom model with AIRec for personalized recommendations? A: You deploy a custom ranking or scoring model on PAI-EAS for online inference and integrate it with AIRec as the personalization backend. PAI handles model serving with auto-scaling, while AIRec orchestrates recommendation delivery, A/B experimentation, and real-time user targeting.