This section provides reference documentation for EDB Postgres AI AI Accelerator Pipelines Models. It includes information on the functions and views available in the aidb extension for working with Models .
Tables aidb.model_providers
The aidb.model_providers
table stores information about the model providers that have been created in the database.
Functions aidb.create_model
Creates a new model in the system by saving its name, provider and optional configuration.
Parameters Example SELECT aidb. create_model(
name = > 'my_t5' ::text ,
provider = > 't5_local' ::character varying ,
config = > '{"param1": "value1", "param2": "value2"}' ::jsonb,
credentials = > '{"token": "abcd"}' ::jsonb
) ; or equivalently, using default values:
SELECT aidb. create_model( 'my_t5' , 't5_local' ) ; or if updating the credentials of a model's provider, which has already been created.
SELECT aidb. create_model(
name = > 'my_t5' ::text ,
provider = > 't5_local' ::character varying ,
config = > '{"param1": "value1", "param2": "value2"}' ::jsonb,
credentials = > '{"token": "abcd"}' ::jsonb,
replace_credentials = > true
) ; aidb.list_models
Returns a list of all models in the registry and their configured options.
Parameters None
Returns Example SELECT * FROM aidb. list_models( ) ; Output
name | provider | options
-------+------------+---------------
bert | bert_local | {"config={}"}
clip | clip_local | {"config={}"}
t5 | t5_local | {"config={}"} aidb.get_model
Returns the configuration for a model in the registry.
Parameters Returns Example SELECT * FROM aidb. get_model( 't5' ) ; Output
name | provider | options
------+----------+---------------
t5 | t5_local | {"config={}"}
(1 row) aidb.delete_model
Deletes a model from the registry.
Parameters Example SELECT aidb. delete_model( 't5' ) ; Output
delete_model
---------------------------------
(t5,t5_local,"{""config={}""}")
(1 row) Returns aidb.encode_text
Encodes text using a model, generating a vector representation of a given text input.
Parameters aidb.encode_text_batch
Encodes a batch of text using a model, generating a vector representation of a given text inputs.
Parameters aidb.decode_text
Decodes text using a model, generating a vector representation of a given text input.
Parameters Returns aidb.decode_text_batch
Decodes a batch of text using a model, generating a representation of a given text input.
Parameters Returns aidb.encode_image
Encodes an image using a model, generating a vector representation of a given image input.
Parameters Returns aidb.rerank_text
Reranks text using a model, generating a vector representation of a given text input.
Parameters Returns