Skip to main content

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.

Request Body required
  • models object[]

    A list of models to be initialized

  • Array [
  • model_class apiModelClass

    Possible values: [ModelClass_Unknown, ModelClass_CLIP, ModelClass_INSTRUCTOR, ModelClass_E5]

    Default value: ModelClass_Unknown

  • model_name string required

    specific name of the model to apply the encoding transformation

  • num_threads int64

    The 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 boolean

    Enable/disable the parallel execution of the graph. Parallel execution can improve model execution speed at the cost of increased memory usage.

  • ]
Responses

A successful response.


Schema
  • results object[]
  • Array [
  • model_class apiModelClass

    Possible values: [ModelClass_Unknown, ModelClass_CLIP, ModelClass_INSTRUCTOR, ModelClass_E5]

    Default value: ModelClass_Unknown

  • model_name string

    specific name of the model to apply the encoding transformation

  • initialized boolean

    whether or not the model was successfully initalized

  • err_message string

    error details outlining why the model could not be initialized

  • ]
Loading...