Skip to main content

Models API

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

MethodHTTP requestDescription
modelsCreateNewModelPOST /models/create/models/create [POST]
modelsDeleteSpecificModelPOST /models/{model}/delete/models/{model}/delete [POST]
modelsDeleteSpecificModelCachePOST /models/{model}/delete/cache/models/{model}/delete/cache [POST]
modelsSnapshotGET /models/models [GET]
unloadModelsPOST /models/unload/models/unload [POST]

modelsCreateNewModel

Model modelsCreateNewModel(seededModel)

/models/create [POST]

Creates a machine learning model. By default, all models created through this endpoint will have the 'custom' attribute set to true. Additionally, the endpoint ensures that no duplicate models exist before creating a new one.

Example

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

val apiInstance = Models API()
val seededModel : SeededModel = // SeededModel |
try {
val result : Model = apiInstance.modelsCreateNewModel(seededModel)
println(result)
} catch (e: ClientException) {
println("4xx response calling Models API#modelsCreateNewModel")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Models API#modelsCreateNewModel")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
seededModelSeededModel[optional]

Return type

Model

Authorization

No authorization required

HTTP request headers

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

modelsDeleteSpecificModel

modelsDeleteSpecificModel(model)

/models/{model}/delete [POST]

Deletes a specific model. It is exclusively available for custom models with the 'custom: true' attribute.

Example

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

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

Parameters

NameTypeDescriptionNotes
modelkotlin.Stringmodel id

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

modelsDeleteSpecificModelCache

ModelDeleteCacheOutput modelsDeleteSpecificModelCache(model, modelDeleteCacheInput)

/models/{model}/delete/cache [POST]

Deletes the data associated with a specific model, such as assets or libraries downloaded specifically for this model. Note: This functionality is currently only available for LLM models.

Example

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

val apiInstance = Models API()
val model : kotlin.String = model_example // kotlin.String | model id
val modelDeleteCacheInput : ModelDeleteCacheInput = // ModelDeleteCacheInput |
try {
val result : ModelDeleteCacheOutput = apiInstance.modelsDeleteSpecificModelCache(model, modelDeleteCacheInput)
println(result)
} catch (e: ClientException) {
println("4xx response calling Models API#modelsDeleteSpecificModelCache")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Models API#modelsDeleteSpecificModelCache")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
modelkotlin.Stringmodel id
modelDeleteCacheInputModelDeleteCacheInput[optional]

Return type

ModelDeleteCacheOutput

Authorization

No authorization required

HTTP request headers

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

modelsSnapshot

Models modelsSnapshot()

/models [GET]

This will get a snapshot of all of your models.

Example

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

val apiInstance = Models API()
try {
val result : Models = apiInstance.modelsSnapshot()
println(result)
} catch (e: ClientException) {
println("4xx response calling Models API#modelsSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Models API#modelsSnapshot")
e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

Models

Authorization

No authorization required

HTTP request headers

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

unloadModels

unloadModels()

/models/unload [POST]

Unloads all available machine learning models that are unloadable.

Example

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

val apiInstance = Models API()
try {
apiInstance.unloadModels()
} catch (e: ClientException) {
println("4xx response calling Models API#unloadModels")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Models API#unloadModels")
e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined