Page MenuHomePhabricator

Provide an API endpoint that returns the model's metadata in Lift Wing
Open, Needs TriagePublic

Description

Report from: https://github.com/SWViewer/swviewer-service/issues/1

Related tasks: T330131

Need a machine-readable list of available languages (agnostic / multilingual) and available model names (ORES). Check every day manually from four location -- no way. :)

The above report is related to Revert Risk, the owner of SWViewer was rightfully saying that we should provide a way to return the list of supported wikis for any given Revert Risk model.

There may be multiple things/roads to check:

  1. Should we add an extra POST parameter to :predict to return the list of supported wikis? Easy solution since every Revert Risk model contains the list of supported wikis, but we may pollute the :predict's output.
  2. Override the :explain function in our model servers, and return the metadata from it.
  3. Use the v2 API like indicated in this spec

Event Timeline

I tested overriding the explain endpoint and it works fine. The downside is that we use a post method.
Another option would be to manipulate the FastAPI object and add a route to it, but it doesnt seem like the best option as we would have to make sure this doesn't break in future versions.

Regarding revertrisk models, supported wikis can be accessed both for multilingual and language-agnostic models by accessing the supported_wikis attribute of the model class which is a list. (model.supported_wikis). This means that if we decide on a schema for metadata for our models we can implement the explain endpoint for revertrisk.

I have opened the following issue on GH https://github.com/kserve/kserve/issues/3098 and also opened a relevant conversation in the community's kserve slack channel.

On top of that I tried (but have not yet succeeded) to override the model_ready function which defines the endpoint v1/models/model_name as mentioned in the routes file.
I just defined a new function named model_ready which outputs a bunch of model information other than the standard response which is {"name": model_name, "ready": model_ready}. In my experiment the standard response is returned instead of my enriched one.