can I serve multiple models thru the same port using MLflow?

huangapple go评论61阅读模式
英文:

can I serve multiple models thru the same port using MLflow?

问题

我正在阅读有关使用MLflow时开箱即用的部署工具。似乎您可以通过执行类似以下操作从注册表中提供模型:

mlflow models serve -m runs:/<run_id>/model <some server>:<some port>

然后,通过执行以下操作发送一些数据并获得预测:

curl http:/<some server>:<some port>/invocations -H 'Content-Type: application/json' -d '{
    "inputs": {<some data>}
}'.

这很不错,但这是否意味着您只能在一个端口上提供一个模型?这是最佳实践还是技术限制,还是情况并非如此?

英文:

I was reading about the deployment tools you get out of the box when using MLflow.

It seems you can serve a model from the registry by doing something like

mlflow models serve -m runs:/<run_id>/model <some server>:<some port>.

and then, you send some data and get back a prediction by doing

curl http:/<some server>:<some port>/invocations -H 'Content-Type: application/json' -d '{
    "inputs": {<some data>}
}'. 

This is great but does this mean you can only serve one model on one port? Is this a best practice or a technical limitation or not the case?

答案1

得分: 1

You can serve any model using MLflow, if you want to use a single endpoint for multiple models you can package all your models into a single model using pyfunc module and deploy this one. Here an example of this.

In that example, there are two models, and wrapper is created around these models, then, during inference time we choose which model get predictions from using input parameters.

Here you can also find an example published for Azure Databricks.

英文:

You can serve any model using MLflow, if you want to use a single endpoint for multiple models you can package all your models into a single model using pyfunc module and deploy this one. Here an example of this.

In that example, there are two models, and wrapper is created around these models, then, during inference time we choose which model get predictions from using input parameters.

Here you can also find an example published for Azure Databricks

huangapple
  • 本文由 发表于 2023年5月15日 07:09:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76250041.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定