Jump to content

Machine Learning/LiftWing/API/Internal usage

From Wikitech

This page explains how users internal to WMF production infrastructure can access Lift Wing API endpoints. External users (including Toolforge and Cloud VPS): see External_usage instead.

Types of internal endpoints

Once a model server is deployed on Lift Wing, it is available internally via two endpoints:

  • Production: https://inference.discovery.wmnet:30443/v1/models/{MODEL_NAME}:predict
  • Staging: https://inference-staging.svc.codfw.wmnet:30443/v1/models/{MODEL_NAME}:predict (staging)

Access internal endpoints

Use Machine_Learning/LiftWing#Current_Inference_Services to find the {MODEL_NAME} and {KUBERNETES_NAMESPACE}.

Set the HTTP host header for your caller/client to reflect the following format: {MODEL_NAME}.{KUBERNETES_NAMESPACE}.wikimedia.org

Query internal endpoints using the stat100x nodes to avoid access issues. See the following examples for additional details.

Examples

This section shows sample API calls in different languages, for a few different models.

Each model available through the Lift Wing API has unique input requirements and output formats. Refer to the model card and API reference for each specific model and endpoint to understand how to make requests and interpret the response.

Rate limits for internal usage

There are rate limit filters in place, but please contact the ML team to get approval before initiating large-volume traffic requests.

  • For example: if you plan to run a Spark job on Hadoop to train a model, hitting Lift Wing 1000000 times in a short timeframe to retrieve scores may impact other production workflows. Please communicate with the ML team first to agree on a strategy.

Reference documentation