Skip to main content

Model API

All URIs are relative to http://localhost:1000

MethodHTTP requestDescription
modelSpecificModelDownloadPOST /model/{model}/download/model/{model}/download [POST]
modelSpecificModelDownloadCancelPOST /model/{model}/download/cancel/model/{model}/download/cancel [POST]
modelSpecificModelDownloadProgressGET /model/{model}/download/progress/model/{model}/download/progress [WS]
modelSpecificModelLoadPOST /model/{model}/load/model/{model}/load [POST]
modelSpecificModelUnloadPOST /model/{model}/unload/model/{model}/unload [POST]
modelUpdatePOST /model/update/model/update [POST]
modelsSpecificModelSnapshotGET /model/{model}/model/{model} [GET]

modelSpecificModelDownload

Model modelSpecificModelDownload(model)

/model/{model}/download [POST]

Downloads a specific model to your local machine.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ModelApi()
val model : kotlin.String = model_example // kotlin.String | model id
try {
val result : Model = apiInstance.modelSpecificModelDownload(model)
println(result)
} catch (e: ClientException) {
println("4xx response calling ModelApi#modelSpecificModelDownload")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ModelApi#modelSpecificModelDownload")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
modelkotlin.Stringmodel id

Return type

Model

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

modelSpecificModelDownloadCancel

Model modelSpecificModelDownloadCancel(model)

/model/{model}/download/cancel [POST]

Cancels a specific model download that is currently in progress.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ModelApi()
val model : kotlin.String = model_example // kotlin.String | model id
try {
val result : Model = apiInstance.modelSpecificModelDownloadCancel(model)
println(result)
} catch (e: ClientException) {
println("4xx response calling ModelApi#modelSpecificModelDownloadCancel")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ModelApi#modelSpecificModelDownloadCancel")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
modelkotlin.Stringmodel id

Return type

Model

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

modelSpecificModelDownloadProgress

ModelDownloadProgress modelSpecificModelDownloadProgress(model)

/model/{model}/download/progress [WS]

This is a WebSocket connection that provides real-time updates on the download progress of a specific model.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ModelApi()
val model : kotlin.String = model_example // kotlin.String | model id
try {
val result : ModelDownloadProgress = apiInstance.modelSpecificModelDownloadProgress(model)
println(result)
} catch (e: ClientException) {
println("4xx response calling ModelApi#modelSpecificModelDownloadProgress")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ModelApi#modelSpecificModelDownloadProgress")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
modelkotlin.Stringmodel id

Return type

ModelDownloadProgress

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

modelSpecificModelLoad

Model modelSpecificModelLoad(model)

/model/{model}/load [POST]

Loads a previously downloaded model into memory. It differs from downloading, as downloading involves transferring the entire model to your machine, while loading simply loads the model into memory.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ModelApi()
val model : kotlin.String = model_example // kotlin.String | model id
try {
val result : Model = apiInstance.modelSpecificModelLoad(model)
println(result)
} catch (e: ClientException) {
println("4xx response calling ModelApi#modelSpecificModelLoad")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ModelApi#modelSpecificModelLoad")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
modelkotlin.Stringmodel id

Return type

Model

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

modelSpecificModelUnload

Model modelSpecificModelUnload(model)

/model/{model}/unload [POST]

Unloads a previously loaded model from memory and effectively frees up the RAM consumed by the model.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ModelApi()
val model : kotlin.String = model_example // kotlin.String | model id
try {
val result : Model = apiInstance.modelSpecificModelUnload(model)
println(result)
} catch (e: ClientException) {
println("4xx response calling ModelApi#modelSpecificModelUnload")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ModelApi#modelSpecificModelUnload")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
modelkotlin.Stringmodel id

Return type

Model

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

modelUpdate

Model modelUpdate(model)

/model/update [POST]

Updates a machine learning model. This functionality is exclusively available for models with the 'custom:true' setting.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ModelApi()
val model : Model = // Model |
try {
val result : Model = apiInstance.modelUpdate(model)
println(result)
} catch (e: ClientException) {
println("4xx response calling ModelApi#modelUpdate")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ModelApi#modelUpdate")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
modelModel[optional]

Return type

Model

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

modelsSpecificModelSnapshot

Model modelsSpecificModelSnapshot(model)

/model/{model} [GET]

Retrieves a specific ML model.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ModelApi()
val model : kotlin.String = model_example // kotlin.String | model id
try {
val result : Model = apiInstance.modelsSpecificModelSnapshot(model)
println(result)
} catch (e: ClientException) {
println("4xx response calling ModelApi#modelsSpecificModelSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ModelApi#modelsSpecificModelSnapshot")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
modelkotlin.Stringmodel id

Return type

Model

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json