Skip to main content
MLflow helps to track and manage your machine learning experiments. With clusters for MLflow in Nebius AI Cloud, you can deploy MLflow in a cloud in just a couple of clicks and connect to it easily from machines that run your workloads. This guide covers how to set up your environment to work with Managed Service for MLflow, create your first cluster, run a simple experiment and access its artifacts in an Object Storage.

Prepare your environment

Meet the following prerequisites, depending on the preferred interface:
Install the MLflow Python package that provides an API to run and manage experiments in your code:
pip install mlflow
Make sure that you (if you are not your tenant’s owner) are in a group that has the admin role within your tenant; for example, the default admins group. You can check this in the Administration → IAM section of the web console.

Create a cluster

  1. In the sidebar, go to https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/sidebar/ai-services.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=ab4ff229f7690c99deb1dc52d3daf987 ML tools → MLflow.
  2. Click Create cluster.
  3. On the cluster creation page that opens, set the following parameters:
    • Name: Enter a name for your cluster.
    • Service account: Select the mlflow-sa service account. It was created for Managed MLflow by default after you signed up for Nebius AI Cloud.
    • Access: Select the Public and private option. In this case, the cluster has both public and private tracking endpoints. You can access the public endpoint from the internet and the private endpoint from the network where the cluster is located (for example, via a virtual machine in this network).
    • Cluster size: Select Medium.
    • Admin credentials: Enter a username and a strong password.
  4. Click Create cluster.
Together with the cluster, Managed Service for MLflow creates a bucket in Object Storage to store the experiment logs and metrics. This bucket is not deleted automatically after you delete the cluster. You are still charged for the bucket until you delete it.

Configure connection to MLflow Tracking

  1. Get the cluster tracking endpoint and save it to an environment variable:
    Go to the cluster page and copy the Public Tracking URI value. Append https:// and save the resulting URL to an environment variable:
    nebius msp mlflow v1alpha1 cluster create \
      --name mlflow-test-cluster \
      --service-account-id $SA_ID \
      --network-id $NETWORK_ID \
      --admin-username admin \
      --admin-password $PASSWORD \
      --public-access=true
    
  2. Set up other environment variables used by MLflow Tracking:
    export MLFLOW_TRACKING_USERNAME=<admin_username>
    export MLFLOW_TRACKING_PASSWORD=<admin_password>
    export MLFLOW_EXPERIMENT_NAME=<default_experiment_name>
    
For more details on secure connection to the tracking server, see MLflow documentation.

Run an experiment and check its results

  1. Run an experiment:
    1. Create a Python script, nebius_mlflow_test.py, that trains a linear regression model on a simple, randomly populated dataset and uses MLflow autologging to log the training:
      import mlflow
      import numpy as np
      from sklearn.model_selection import train_test_split
      from sklearn.linear_model import LinearRegression
      
      np.random.seed(42)
      X = np.random.rand(100, 1)
      y = 3.5 * X.squeeze() + np.random.randn(100) * 0.5
      X_train, X_test, y_train, y_test = train_test_split(
          X, y, test_size=0.2, random_state=42)
      
      mlflow.autolog()
      
      model = LinearRegression()
      model.fit(X_train, y_train)
      
    2. Run the script:
      python3 nebius_mlflow_test.py
      
  2. Check the experiment artifacts:
    Go to the cluster page and click Go to web UI. Enter the admin credentials you specified when creating the cluster.In the left pane, you can see a list of experiments. Select the experiment you just ran and review its results.
If the client where you work requires a certificate, use the certificate that your machine’s OS provides. For example, check the /etc/ssl/ folder for macOS.