Skip to main content

Api

📄️ 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.<br/><br/>If the model is missing, the server will attempt to download the corresponding file from a remote source.<br/><br/>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.

📄️ Encode::Encode

Generates a vector representation of text or images using the specified embedding model. If the model does not exist or has not been loaded, an error will be returned for that particular data item. <br/><br/>It is recommended that multiple pieces of content are specified in a single request to take advantage of batching, especially when running with an attached <a href='https://onnxruntime.ai/docs/execution-providers/' target='_blank'>GPU.</a> Recommended sizes can be found at <a href='/embedds/supported-models' target='_blank'>embedds/model-details</a> and batching will be automatically done.<br/>----<br/><b>Not all models support [text, images, image_uris]</b> a breakdown of present support is outlined below:<ul><li>ModelClass_INSTRUCTOR - requires: {text and data.instruction}</li><li>ModelClass_CLIP - any_of: {text, images}</li></ul>