Jump to content

Machine Learning/LiftWing/API/ORES migration guide

From Wikitech

This page provides a guide for ORES users to migrate to the Lift Wing API.

Differences between ORES and Lift Wing

Before you start migrating, it may be helpful to understand the basic differences between ORES and Lift Wing.

Service architecture and request structure

Lift Wing is a generic model hosting platform, while ORES is a scoring service only for article revisions. Lift Wing hosts models as microservices: each model serves predictions through its own model server. So, to get a prediction from more than one model using the same input data, you must issue calls to each model. In comparison, ORES acts as a scoring aggregator, and can return predictions for many scores and many article revisions with a single call.

For example, the following ORES call fetches the predictions for article revision with id 123 for the models damaging and goodfaith:

curl https://ores.wikimedia.org/v3/scores/enwiki/123?models=damaging|goodfaith

In Lift Wing, the ORES example above would require two calls: one for each model service:

curl https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-damaging:predict -X POST -d '{"rev_id": 123}'

curl https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-goodfaith:predict -X POST -d '{"rev_id": 123}'
Requests to ORES use the GET method, but all Lift Wing requests use POST, with the POST data including the revision id or other input parameters. See the API reference.

Migrating to microservices built with Lift Wing offers the following advantages:

  • Scalability: Microservices can be independently scaled based on demand, allowing for more efficient resource utilization and improved performance.
  • Flexibility: Microservices architecture enables the use of different languages, and frameworks for each model service, providing greater flexibility in development.
  • Faster Deployment: Smaller code bases and independent deployment of microservices enable faster and more frequent releases, accelerating release to production.
  • Fault Isolation: Failure in one microservice is less likely to impact the entire system, improving overall system resilience and up-time.

To learn more about rationale and plans for modernizing Wikimedia ML infrastructure, see Machine Learning/Modernization.

Caching

In ORES, a precache is a cache that is updated whenever a new revision is made. This helps decrease latency in subsequent identical calls. Although caching is an important aspect of any service, as of 2026 Lift Wing doesn't offer caching. The main reason for this is that Lift Wing is a general purpose system, which could lead to increased complexity when implementing a caching mechanism. The addition of such a feature in Lift Wing will be taken under consideration if it is seen as a necessity for users.

Modern alternatives for ORES and Revscoring models

In the Lift Wing system, models migrated from ORES are collectively referred to as Revscoring models. These models continue to be available on Lift Wing, but the ML team is not going to improve them further (re-training, add support for new wikis, new data labeling, etc.). They won't be removed from Lift Wing without a community consultation and approval process.

A newer, more modern set of models is now available, and can replace several of the Revscoring models. These newer models are multilingual or language-agnostic, and were usually trained with fresher data. The following table shows which Revscoring models have more modern replacements already available through the Lift Wing API:

ORES model Lift Wing Revscoring model Lift Wing modernized model
Edit quality goodfaith goodfaith Multilingual, language-agnostic, or wikidata revert risk
damaging damaging
reverted reverted
Article quality draftquality draftquality
articlequality articlequality Language-agnostic article quality
Topic models drafttopic drafttopic
articletopic articletopic Language-agnostic link-based article topic

Example process to migrate your code

For this example, imagine you have an anti-vandalism tool that runs on Toolforge, and listens to revision-create events. The tool calls ORES for goodfaith and damaging scores for every revision id, taking appropriate actions afterwards.

Understand Lift Wing and decide which models to use

  1. Read and understand the differences between Lift Wing and ORES described above.
  2. Discover that your tool uses a single call to retrieve multiple scores from ORES, so you'll have to adjust to retrieve the goodfaith and damaging scores separately, in two HTTP calls.
  3. Consult the mapping of ORES models to modern Lift Wing models. Note that the Multilingual or language-agnostic revert risk models are more modern replacements for goodfaith and damaging models combined. These newer models offer a single score you can use in your anti-vandalism tool. They were trained with fresher data, and offer better performance and coverage compared to the revscoring models.
  4. Decide if you want to move away from the revscoring goodfaith and damaging models now, or leave that for the future (they will eventually be deprecated, see ORES).

Change your code to use Lift Wing API

At this point, you know that your tool can either:

  • make two calls to Lift Wing to retrieve a revscoring goodfaith and damaging score for a rev-id, or
  • make a single call to retrieve a revertrisk score.

Now, you must figure out how to use the Lift Wing API to get predictions from the model(s) you decided to use.

  1. Since Toolforge tools are considered "external", use the Lift Wing API guide for external users.
  2. Consult the rate limits section to understand which client type fits your use case. For this example, imagine your tool is a low-traffic one, so the restriction of 50k requests/hour fits the anonymous client type. To make more than those 50k requests/hour, you'd have to request an authentication token following the process described at https://api.wikimedia.org/wiki/Authentication.
  3. You're almost done! Change the HTTP calls in your code to call api.wikimedia.org instead of ores.wikimedia.org. The following table shows how to change specific ORES requests to retrieve the same data from Lift Wing services:
ORES Lift Wing revscoring models
curl https://ores.wikimedia.org/v3/scores/enwiki/12345?models=goodfaith curl https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-goodfaith:predict -X POST -d '{"rev_id": 12345}'
curl 'https://ores.wikimedia.org/v3/scores/enwiki/12345?models=goodfaith|damaging' curl https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-goodfaith:predict -X POST -d '{"rev_id": 12345}'

curl https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-damaging:predict -X POST -d '{"rev_id": 12345}'

curl https://ores.wikimedia.org/v3/scores/enwiki/12345/goodfaith?features=True curl https://api.wikimedia.org/service/lw/inference/v1/models/enwiki-goodfaith:predict -X POST -d '{"rev_id": 12345, "extended_output": "True"}'
ORES Lift Wing Revert Risk models
curl https://ores.wikimedia.org/v3/scores/enwiki/12345?models=goodfaith curl https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-language-agnostic:predict -X POST -d '{"rev_id": 12345, "lang": "en"}'
curl https://ores.wikimedia.org/v3/scores/enwiki/12345?models=goodfaith curl https://api.wikimedia.org/service/lw/inference/v1/models/revertrisk-multilingual:predict -X POST -d '{"rev_id": 12345, "lang": "en"}'

For full details and additional example calls, see the Lift Wing API reference. If you need help or have questions, contact the ML team.