Encode::Initialize
Intializes an ONNX based embedding model, adding it to the pool of models available for vector generation. ONNX models are loaded from the folder designated by EMBBEDDS_CACHE_FOLDER
and it is recommended that this folder be volume mounted if running within a container.
If the model is missing, the server will attempt to download the corresponding file from a remote source.
embedds must be created with EMBEDDS_ALLOW_ADMIN=true
as the unrestricted creation of models can lead to resource starvation. If you are exposing the process to non-trusted clients, we recommended that EMBEDDS_ALLOW_ADMIN
be set to false.
- application/json
Request Body required
models object[]
A list of models to be initialized
Array [model_class apiModelClassPossible values: [
ModelClass_Unknown
,ModelClass_CLIP
,ModelClass_INSTRUCTOR
,ModelClass_E5
]Default value:
ModelClass_Unknown
model_name string requiredspecific name of the model to apply the encoding transformation
num_threads int64The number of threads to parallelize the execution of the graph - if the graph can be parallelized.
If unset, defaults to the available parallelism on the underlying machine.parallel_execution booleanEnable/disable the parallel execution of the graph. Parallel execution can improve model execution speed at the cost of increased memory usage.
]
- 200
- default
A successful response.
- application/json
- Schema
- Example (from schema)
Schema
results object[]
Array [model_class apiModelClassPossible values: [
ModelClass_Unknown
,ModelClass_CLIP
,ModelClass_INSTRUCTOR
,ModelClass_E5
]Default value:
ModelClass_Unknown
model_name stringspecific name of the model to apply the encoding transformation
initialized booleanwhether or not the model was successfully initalized
err_message stringerror details outlining why the model could not be initialized
]
{
"results": [
{
"model_class": "ModelClass_Unknown",
"model_name": "string",
"initialized": true,
"err_message": "string"
}
]
}
An unexpected error response.
- application/json
- Schema
- Example (from schema)
Schema
- code int32
- message string
details object[]
Array [@type string]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}