mlflow / mlflow

Open source platform for the machine learning lifecycle
https://mlflow.org
Apache License 2.0
18.79k stars 4.24k forks source link

[FR] Support completions for `pyfunc` predict in OpenAI #9436

Open santiagxf opened 1 year ago

santiagxf commented 1 year ago

Willingness to contribute

Yes. I can contribute this feature independently.

Proposal Summary

OpenAI flavor add PyFunc into the model for the tasks chat.completions and embeddings. I would like to extend this support to completions.

Motivation

What is the use case for this feature?

OpenAI for NLU supports 3 tasks: embeddings, chat.completions, and completions. Not all of them were implemented in MLflow flavor.

Why is this use case valuable to support for MLflow users in general?

Users willing to use completions can't use pyfunc implementation in MLflow.

Why is this use case valuable to support for your project(s) or organization?

We have customers looking to use the full set of features of OpenAI.

Why is it currently difficult to achieve this use case?

They are not supported as indicated at:

https://github.com/mlflow/mlflow/blob/50a4b658968db3a57f106e215b7ebb6b6f27ea78/mlflow/openai/__init__.py#L75C2-L75C24

Details

I would like to expand the support of MLflow pyfunc to include all the NLU tasks supported by OpenAI which should help users to adopt MLflow model format for these tasks. Today, this limitation imposes restrictions.

What component(s) does this bug affect?

What interface(s) does this bug affect?

What language(s) does this bug affect?

What integration(s) does this bug affect?

BenWilson2 commented 1 year ago

Sounds great! Let us know when it's ready :)

mlflow-automation commented 1 year ago

@mlflow/mlflow-team Please assign a maintainer and start triaging this issue.