Use this API to upload and download the files attached to a version of a machine learning model in the model registry. To create models and model versions, use an MLflow client.
Download an ml_model package file
GET /api/v4/projects/{id}/packages/ml_models/{model_version_id}/files/{file_name}
This feature was introduced in GitLab 16.8
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
file_Path, | String | File name |
statusQuery | String | Package status Allowed values: default,hidden |
model_Path, | String | Model version id |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Workhorse upload model package file
PUT /api/v4/projects/{id}/packages/ml_models/{model_version_id}/files/{file_name}
Introduced in GitLab 16.8
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
file_Path, | String | File name |
model_Path, | String | Model version id |
Request body (multipart/form-data)
| Property | Type | Description |
|---|---|---|
fileRequired | String (binary) | The package file to be published (generated by Multipart middleware) |
status | String | Package status Allowed values: default,hidden |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Workhorse authorize model package file
PUT /api/v4/projects/{id}/packages/ml_models/{model_version_id}/files/{file_name}/authorize
Introduced in GitLab 16.8
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
file_Path, | String | File name |
model_Path, | String | Model version id |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
status | String | Package status Allowed values: default,hidden |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Download an ml_model package file
GET /api/v4/projects/{id}/packages/ml_models/{model_version_id}/files/{path}/{file_name}
This feature was introduced in GitLab 16.8
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
file_Path, | String | File name |
pathPath, | String | File directory path |
statusQuery | String | Package status Allowed values: default,hidden |
model_Path, | String | Model version id |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Workhorse upload model package file
PUT /api/v4/projects/{id}/packages/ml_models/{model_version_id}/files/{path}/{file_name}
Introduced in GitLab 16.8
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
file_Path, | String | File name |
pathPath, | String | File directory path |
model_Path, | String | Model version id |
Request body (multipart/form-data)
| Property | Type | Description |
|---|---|---|
fileRequired | String (binary) | The package file to be published (generated by Multipart middleware) |
status | String | Package status Allowed values: default,hidden |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Workhorse authorize model package file
PUT /api/v4/projects/{id}/packages/ml_models/{model_version_id}/files/{path}/{file_name}/authorize
Introduced in GitLab 16.8
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
file_Path, | String | File name |
pathPath, | String | File directory path |
model_Path, | String | Model version id |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
status | String | Package status Allowed values: default,hidden |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |