Request: Production inference services available via the Lift Wing API should generate OpenAPI descriptions (OADs) that comply with the OpenAPI specification.
Currently, Lift Wing API reference documentation is only available as manually-created pages on api.wikimedia.org (the "API Portal"), which is planned for deprecation (T415293): https://api.wikimedia.org/wiki/Lift_Wing_API/Reference.
The ML team may need to do a research spike to identify how and whether generating OADs can be accomplished for each of the inference services running on Lift Wing, since the models have varying input requirements and output structures. It's also unclear how KServe versions may impact the ability to auto-generate OAS-compliant OADs.
Timing
We are targeting June 10 to shut down the API Portal, so the Lift Wing API docs need to be published to a new location ideally by June 1 to allow for time to set up redirects.
Project plan
- Create OpenAPI docs for non-revscoring Lift Wing endpoints
- Tech Docs review and edits
- Add the OpenAPI docs to the REST Sandbox on Test Wiki T426081
- Validate the docs on Test Wiki
- Publish the docs to a production wiki (either Wikitech, Meta, and mediawiki.org)
- Create OpenAPI docs for revscoring endpoints
- Tech Docs review and edits
- Redirect API Portal docs to new locations
Project context
As part of the WE5.5 APP KR, the MediaWiki Interface and Technical Documentation teams are working with API maintainers to evolve how we build and surface Wikimedia APIs. This includes work bring our API descriptions into alignment with the OpenAPI specification, which enables standardized, generated, and testable API reference documentation. (strategy doc (Google doc, restricted access) | TechBlog post).
We are also working towards deprecating the API portal (T415293), which requires moving API documentation from there to more sustainable locations, and (ideally) for teams to start generating OpenAPI descriptions to produce that API reference documentation (T416586).
Investigations so far
In discussions with @DPogorzelski-WMF , @AikoChou, and @Sucheta-Salgaonkar-WMF, we hypothesized that upgrading the KServe version being used by our current inference services would then enable service owners to just run a simple command to enable the KServe "out of the box" support for OpenAPI.
Issue: Upgrading KServe is non-trivial (T380723, T380722, T367048), and we don't actually know for sure if that would enable auto-generation of OpenAPI-compliant API descriptions for Lift Wing inference services. More research is needed (see below for what the tech docs team did so far to research this.)Update: Upgrading KServe is unrelated to this work per T419455#11893320
@KBach did some initial exploration and tried to generate an OpenAPI description for the Revscoring goodfaith model, but was not able to successfully do that because of:
- Unclear/incomplete KServe documentation about "out of the box" support for OpenAPI
- Variations in response structure depending on request parameters make the API potentially incompatible with OpenAPI description format.
See full notes in Google doc.
The Link Recommendation API is an example of an ML model-based service (not running on Lift Wing infra) that complies with OpenAPI: see T415312 and https://gerrit.wikimedia.org/r/plugins/gitiles/research/mwaddlink/+/refs/heads/main/swagger/linkrecommendations.yml