1

I'm able to enable model serving by using the mlflow api 2.0 with the following code...

    instance = f'https://{workspace}.cloud.databricks.com'
    headers = {'Authorization': f'Bearer {api_workflow_access_token}'} 
     
    # Enable Model Serving 
    import requests
    url = f'{instance}/api/2.0/mlflow/endpoints/enable'
    requests.post(url, headers=headers, json={"registered_model_name": f'{model_name}'})

However this automatically sets the cluster setting instance type to be m5a.xlarge, which I DO NOT want it to be. I can manually go into the settings on the UI (image below) and change it to be m4.large but I want to be able to do this within the api code above so that I don't have to manually go into the settings and change it. This would allow me to enable and disable serving models without ever needing to interact with the UI.

enter image description here

spies006
  • 2,867
  • 2
  • 19
  • 28
  • I am not seeing any documentation for that endpoint besides a [question](https://community.databricks.com/s/question/0D53f00001UC6aZCAT/how-to-enable-and-disable-model-serving-using-rest-api) on the Databricks Community. Maybe you can try to set `"node_type_id": "m4.large"` in the json request? – David Feb 03 '23 at 03:40
  • I tried that already to no avail. Thanks! – spies006 Feb 03 '23 at 15:03

0 Answers0