Use this API to track machine learning experiments, runs, and metrics, and to manage the model registry. These endpoints implement the MLflow REST API, so you can point an MLflow client at GitLab.
MLflow artifact API
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow-artifacts/artifacts
MLflow artifacts mapping to GitLab artifacts
Parameters
| Name | Type | Description |
|---|---|---|
pathQuery | String | Path to the artifact, |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
404 | Not Found | — |
Get MLflow artifact file
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow-artifacts/artifacts/{model_version}/{file_path}
Retrieves an MLflow artifact file
Parameters
| Name | Type | Description |
|---|---|---|
model_Path, | String | The model version |
idPath, | String or integer | The ID or URL- Example: 11 |
file_Path, | — | — |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
404 | Not Found | — |
Create experiment
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/experiments/create
https://www.mlflow.org/docs/2.19.0/rest-api.html#create-experiment
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
artifact_ | String | Ignored. |
nameRequired | String | Name of the experiment |
tags | Array | Tags containing metadata about the experiment |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Delete an experiment
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/experiments/delete
https://mlflow.org/docs/2.19.0/rest-api.html#delete-experiment
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
experiment_Required | String | ID of the experiment |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
404 | Not Found | — |
Fetch experiment by experiment_id
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/experiments/get
https://www.mlflow.org/docs/2.19.0/rest-api.html#get-experiment
Parameters
| Name | Type | Description |
|---|---|---|
experiment_Query | String | ID of the experiment, Default: |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Fetch experiment by experiment_name
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/experiments/get-by-name
https://www.mlflow.org/docs/2.19.0/rest-api.html#get-experiment-by-name
Parameters
| Name | Type | Description |
|---|---|---|
experiment_Query | String | Name of the experiment Default: |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
List experiments
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/experiments/list
https://www.mlflow.org/docs/2.19.0/rest-api.html#search-experiments
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
404 | Not Found | — |
Search experiments
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/experiments/search
https://www.mlflow.org/docs/2.19.0/rest-api.html#search-experiments
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
filter | String | Ignored. |
max_ | Integer | Maximum number of experiments to fetch in a page. Default: 200 |
order_ | String | Column and direction to sort experiments by,created_ or name.created_ and nameDefault: created_ |
page_ | String | Token for pagination |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Sets a tag for an experiment
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/experiments/set-experiment-tag
https://www.mlflow.org/docs/2.19.0/rest-api.html#set-experiment-tag
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
experiment_Required | String | ID of the experiment |
keyRequired | String | Name of the tag |
valueRequired | String | Value of the tag |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
404 | Not Found | — |
Gets metric history for a run
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/metrics/get-history
https://www.mlflow.org/docs/2.19.0/rest-api.html#get-metric-history
Parameters
| Name | Type | Description |
|---|---|---|
run_Query, | String | UUID of the run |
metric_Query, | String | Name of the metric |
max_Query | Integer | Maximum number of metrics to return Default: 1000 |
page_Query | String | Token for pagination |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Creates a Model Version
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/model-versions/create
MLFlow Model Versions map to GitLab Model Versions. https://mlflow.org/docs/2.19.0/rest-api.html#create-modelversion
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
description | String | Description of the model version |
name | String | Name of the registered model to create the version for. |
run_ | String | Run ID of the candidate to be promoted to a model version |
tags | Array | Additional metadata for a model version |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Fetch model version by name and version
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/model-versions/get
https://mlflow.org/docs/2.19.0/rest-api.html#get-modelversion
Parameters
| Name | Type | Description |
|---|---|---|
nameQuery, | String | Name of the registered model |
versionQuery, | String | Version of the model |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Fetch the download URI for the model version
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/model-versions/get-download-uri
Returns version in MLflow format “mlflow-artifacts:<version>” https://mlflow.org/docs/2.19.0/rest-api.html#get-download-uri-for-modelversion-artifacts
Parameters
| Name | Type | Description |
|---|---|---|
nameQuery, | String | Name of the registered model |
versionQuery, | Integer | ID of the model version |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Updates a Model Version
PATCH /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/model-versions/update
https://mlflow.org/docs/2.19.0/rest-api.html#update-modelversion
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
description | String | Description of the model version |
name | String | Name of the registered model |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Gets a Model Version by alias
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/registered-models/alias
https://mlflow.org/docs/2.19.0/rest-api.html#get-model-version-by-alias
Parameters
| Name | Type | Description |
|---|---|---|
nameQuery | String | Name of the registered model |
aliasQuery | String | Alias of the model version,1. |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
404 | Not Found | — |
Creates a Registered Model
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/registered-models/create
MLFlow Registered Models map to GitLab Models. https://mlflow.org/docs/2.19.0/rest-api.html#create-registeredmodel
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
description | String | Description of the registered model |
nameRequired | String | Name of the registered model |
tags | Array | Additional metadata for the registered model |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Delete a Registered Model by Name
DELETE /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/registered-models/delete
https://mlflow.org/docs/2.19.0/rest-api.html#delete-registeredmodel
Parameters
| Name | Type | Description |
|---|---|---|
nameQuery | String | Name of the registered model |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Fetch a Registered Model by Name
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/registered-models/get
https://www.mlflow.org/docs/2.19.0/rest-api.html#get-registeredmodel
Parameters
| Name | Type | Description |
|---|---|---|
nameQuery | String | Name of the registered model Default: |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Fetch the latest Model Version for the given Registered Model Name
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/registered-models/get-latest-versions
https://mlflow.org/docs/2.19.0/rest-api.html#get-latest-modelversions
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
name | String | Name of the registered model |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Search Registered Models within a project
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/registered-models/search
https://mlflow.org/docs/2.19.0/rest-api.html#search-registeredmodels
Parameters
| Name | Type | Description |
|---|---|---|
filterQuery | String | Filter for the model search,name='value'. |
max_Query | Integer | Maximum number of models to fetch in a page. Default: 200 |
order_Query | String | Column and direction to sort registered models by,name,name DESC,last_.name and last_.Default: name ASC |
page_Query | String | Token for pagination |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Update a Registered Model by Name
PATCH /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/registered-models/update
https://mlflow.org/docs/2.19.0/rest-api.html#update-registeredmodel
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
description | String | Description of the registered model |
name | String | Name of the registered model |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Creates a Run
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/runs/create
MLFlow Runs map to GitLab Candidates. https://www.mlflow.org/docs/2.19.0/rest-api.html#create-run
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
experiment_Required | Integer | Id for the experiment, |
run_ | String | A name for this run |
start_ | Integer | Unix timestamp in milliseconds of when the run started Default: 0 |
tags | Array | Tags are stored, |
user_ | String | This will be ignored |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Delete a run
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/runs/delete
https://mlflow.org/docs/2.19.0/rest-api.html#delete-run
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
run_Required | String | UUID of the run |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
404 | Not Found | — |
Gets an MLFlow Run, which maps to GitLab Candidates
GET /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/runs/get
https://www.mlflow.org/docs/1.28.0/rest-api.html#get-run
Parameters
| Name | Type | Description |
|---|---|---|
run_Query, | String | UUID of the candidate |
run_Query | String | This parameter is ignored |
idPath, | String or integer | The ID or URL- Example: 11 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Logs multiple parameters and metrics
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/runs/log-batch
https://www.mlflow.org/docs/2.19.0/rest-api.html#log-param
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
metrics | Array of objects | Array that contains metric information Default: [] |
metrics[].Required | String | Name for the metric |
metrics[]. | Integer | Step at which the metric was recorded |
metrics[].Required | Integer | Unix timestamp in milliseconds when metric was recorded |
metrics[].Required | Number | Value of the metric |
params | Array of objects | Array that contains parameter information Default: [] |
params[].Required | String | Name for the metric |
params[].Required | String | Value of the metric |
run_Required | String | UUID of the run |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
404 | Not Found | — |
Logs a metric to a run
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/runs/log-metric
https://www.mlflow.org/docs/1.28.0/rest-api.html#log-metric
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
keyRequired | String | Name for the metric |
run_Required | String | UUID of the run |
step | Integer | Step at which the metric was recorded |
timestampRequired | Integer | Unix timestamp in milliseconds when metric was recorded |
valueRequired | Number | Value of the metric |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
404 | Not Found | — |
Logs a parameter to a run
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/runs/log-parameter
https://www.mlflow.org/docs/2.19.0/rest-api.html#log-param
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
keyRequired | String | Name for the parameter |
run_Required | String | UUID of the run |
valueRequired | String | Value for the parameter |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
404 | Not Found | — |
Searches runs/candidates within a project
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/runs/search
https://www.mlflow.org/docs/2.19.0/rest-api.html#search-runsexperiment_ids supports only a single experiment ID.Introduced in GitLab 16.4
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
experiment_Required | Array | IDs of the experiments to get searches from, |
max_ | Integer | Maximum number of runs/ Default: 200 |
order_ | String | Order criteria.metrics.created_,created_,metrics.Sorting by candidate parameter or metadata is not supportedDefault: created_ |
page_ | String | Token for pagination |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Sets a tag for a run
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/runs/set-tag
https://www.mlflow.org/docs/2.19.0/rest-api.html#set-tag
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
keyRequired | String | Name for the tag |
run_Required | String | UUID of the run |
valueRequired | String | Value for the tag |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
404 | Not Found | — |
Updates a Run
POST /api/v4/projects/{id}/ml/mlflow/api/2.0/mlflow/runs/update
MLFlow Runs map to GitLab Candidates. https://www.mlflow.org/docs/2.19.0/rest-api.html#update-run
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- Example: 11 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
end_ | Integer | Ending time of the run |
run_Required | String | UUID of the candidate |
status | String | Status of the run. Allowed values: RUNNING,SCHEDULED,FINISHED,FAILED,KILLED |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesMlMlflowExperiment
| Property | Type | Description |
|---|---|---|
artifact_ | String | — |
experiment_ | String | Example:1 |
lifecycle_ | String | Example:active |
name | String | Example:my_ |
tags | Array of APIEntities | — |
APIEntitiesMlMlflowGetDownload
| Property | Type | Description |
|---|---|---|
artifact_ | String | Download URI for MLflow artifact |
APIEntitiesMlMlflowGetExperiment
| Property | Type | Description |
|---|---|---|
experiment | APIEntities | — |
APIEntitiesMlMlflowGetMetricHistory
| Property | Type | Description |
|---|---|---|
metrics | Array of APIEntities | — |
next_ | String | — |
APIEntitiesMlMlflowKeyValue
| Property | Type | Description |
|---|---|---|
key | String | — |
value | String | — |
APIEntitiesMlMlflowListExperiment
| Property | Type | Description |
|---|---|---|
experiments | Array of APIEntities | — |
APIEntitiesMlMlflowMetric
| Property | Type | Description |
|---|---|---|
key | String | — |
step | Integer | — |
timestamp | Integer | Unix timestamp in milliseconds |
value | Number | — |
APIEntitiesMlMlflowModelVersion
| Property | Type | Description |
|---|---|---|
aliases | Array of strings | — |
creation_ | Integer | — |
current_ | String | Example:development |
description | String | — |
last_ | Integer | — |
name | String | — |
run_ | String | — |
run_ | String | — |
source | String | — |
status | String | Example:READY |
status_ | String | — |
tags | Array of APIEntities | — |
user_ | String | — |
version | String | — |
APIEntitiesMlMlflowNewExperiment
| Property | Type | Description |
|---|---|---|
experiment_ | String | Example:1 |
APIEntitiesMlMlflowRegisteredModel
| Property | Type | Description |
|---|---|---|
creation_ | Integer | — |
description | String | — |
last_ | Integer | — |
latest_ | Array of APIEntities | — |
name | String | — |
tags | Array of APIEntities | — |
user_ | String | — |
APIEntitiesMlMlflowRun
| Property | Type | Description |
|---|---|---|
data | Object | — |
data. | Array of APIEntities | — |
data. | Array of APIEntities | — |
data. | Array of APIEntities | — |
info | APIEntities | — |
APIEntitiesMlMlflowRunInfo
| Property | Type | Description |
|---|---|---|
artifact_ | String | — |
end_ | Integer | Unix timestamp in milliseconds |
experiment_ | String | — |
lifecycle_ | String | Example:active |
run_ | String | — |
run_ | String | — |
run_ | String | — |
start_ | Integer | Unix timestamp in milliseconds |
status | String | Example:FINISHED |
user_ | String | — |
APIEntitiesMlMlflowUpdateRun
| Property | Type | Description |
|---|---|---|
run_ | APIEntities | — |